Skip to content

Conversation

@zindy
Copy link
Contributor

@zindy zindy commented Aug 20, 2024

Hello,

this pull request is for calculating a scaling factor between viewer and overlay images if their pixel size is different, and apply it to the transform matrix.

This issue (aligning images with different pixel sizes) was discussed on the forum:
https://forum.image.sc/t/align-tool-difference-in-pixel-size-for-the-fixed-and-moving-images-is-not-accounted-for/95973

Scaling can occur when a new overlay is selected and when the reset button is pressed. The new code handles both scenarios.

Cheers,
Egor

zindy added 3 commits August 19, 2024 17:08
This helper calculates the scaling factor between viewer and overlay if their pixel size is different. It returns a scaled affine transform matrix which is then used in ImageServerOverlay(final QuPathViewer viewer, final ImageServer<BufferedImage> server)
Copy link
Member

@petebankhead petebankhead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that automatically fixing the scales would be really useful and important. I haven't tried running it yet, but have added some comments from reading the code - please let me know if you'd like to update your PRs, otherwise one of us will look into reviving this extension soon and can use them instead for inspiration.

@zindy
Copy link
Contributor Author

zindy commented Apr 12, 2025

@petebankhead

please let me know if you'd like to update your PRs, otherwise one of us will look into reviving this extension soon and can use them instead for inspiration.

I will update this particular PR because I would consider it a "bug" that needs fixing.

Regarding the other two PRs clogging the queue:

So to answer your question: I wouldn't mind getting this "scaling bug" PR merged when you're happy with the code. Then definitely use the other two PRs for inspiration if they help you in any way.

Cheers,
Egor

@Rylern Rylern merged commit 5efad29 into qupath:main May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants