Autoscale the affine transform when viewer and overlay images have different pixel sizes.#10
Conversation
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)
petebankhead
left a comment
There was a problem hiding this comment.
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.
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, |
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