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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/odemis/dataio/tiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

md[model.MD_EBEAM_VOLTAGE] = float(tfs_md[beam_type]["hv"])
md[model.MD_EBEAM_CURRENT] = float(tfs_md[beam_type]["beamcurrent"])

Expand Down
Loading