Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoscale the affine transform when viewer and overlay images have different pixel sizes. #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zindy
Copy link

@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)
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.

1 participant