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

[fix] disable scan rotation metadata for tfs #2692

Merged

Conversation

patrickcleeve2
Copy link
Contributor

@patrickcleeve2 patrickcleeve2 commented Mar 1, 2024

Users reporting all images are flipped 180 degrees. This is due to scan rotation metadata being inconsistent with idemis display.

This PR disables (set to zero) scan rotation metadata to make displayed odemis images consistent with acquired images.

@patrickcleeve2 patrickcleeve2 force-pushed the meteor-969-fix-tfs-rotation-metadata branch 2 times, most recently from 2067de1 to b443396 Compare March 1, 2024 07:06
@patrickcleeve2 patrickcleeve2 changed the title fix: consider both scan rotation and stage rotation [fix] disable scan rotation metadata for tfs Mar 1, 2024
@@ -2743,7 +2743,8 @@ def _convert_thermo_fisher_to_odemis_metadata(metadata: str) -> dict:
try:
# beam metadata
beam_type = tfs_md["Beam"]["beam"]
md[model.MD_ROTATION] = float(tfs_md[beam_type]["scanrotation"])
# tmp: disable scan rotation metadata, as it is inconsistent with how odemis displays images
md[model.MD_ROTATION] = 0 # float(tfs_md[beam_type]["scanrotation"])
Copy link
Contributor

Choose a reason for hiding this comment

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

If it is consistently flipped by 180 degrees, why not just add 180 degrees to float(tfs_md[beam_type]["scanrotation"])?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be more specific, the display rotation should depend on both scan rotation and stage rotation. But stage rotation = 0 isnt the flat to sem rotation, depends on the specific microscope. So we'd need to read the configuration metadata (which isn't really something we'd want to depend on at image loading time, because it might be different (e.g. different microscope)). So for now its just easier to disable the rotation, so that users see the same images as they took

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I've seen similar issues before. The problem is that the way the SEM image should be displayed depends a lot on the rest of the system. Sometimes we really want to see it rotated, sometime it should be shown at 0°, because the scan rotation is there precisely to compensate for some other rotation!
I think it's fine to "play dumb" and just not report the scan rotation. That's how it's shown in the SEM software anyway.

@patrickcleeve2 patrickcleeve2 force-pushed the meteor-969-fix-tfs-rotation-metadata branch from f487f4a to 49de6ab Compare March 5, 2024 03:44
@@ -2743,7 +2743,8 @@ def _convert_thermo_fisher_to_odemis_metadata(metadata: str) -> dict:
try:
# beam metadata
beam_type = tfs_md["Beam"]["beam"]
md[model.MD_ROTATION] = float(tfs_md[beam_type]["scanrotation"])
# tmp: disable scan rotation metadata, as it is inconsistent with how odemis displays images
md[model.MD_ROTATION] = 0 # float(tfs_md[beam_type]["scanrotation"])
Copy link
Member

Choose a reason for hiding this comment

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

Yes, I've seen similar issues before. The problem is that the way the SEM image should be displayed depends a lot on the rest of the system. Sometimes we really want to see it rotated, sometime it should be shown at 0°, because the scan rotation is there precisely to compensate for some other rotation!
I think it's fine to "play dumb" and just not report the scan rotation. That's how it's shown in the SEM software anyway.

@patrickcleeve2
Copy link
Contributor Author

I think this can be merged @tepals @pieleric

@pieleric pieleric merged commit 7bc8eec into delmic:master Mar 12, 2024
5 checks passed
@patrickcleeve2 patrickcleeve2 deleted the meteor-969-fix-tfs-rotation-metadata branch March 12, 2024 09:22
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