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

ImageJ export: preserve physical size units #3295

Merged
merged 1 commit into from Jan 9, 2019

Conversation

melissalinkert
Copy link
Member

See #3127

Both the physical sizes and units are now taken from the ImagePlus' Calibration. This should have no impact on the common case where physical sizes are unchanged after import, but should fix the case when units are changed after import.

To test, make sure that the original bug is fixed by running the macro in #3127 with this change. showinf -omexml on the resulting file should also confirm that the correct physical sizes are stored. Also test with line 12 of the macro commented out (the first run("Properties..." ...) and uncommented but with a unit that obviously cannot be mapped to an OME unit (I tried unit=december). Opening files using the Bio-Formats importer plugin and then exporting again should also continue to work as before.

Not sure if there are any other use cases to consider, or if/how this differs from the NPE-producing test mentioned in #3127 (comment).
ImageJ allows the specified units to be free-form, so I do wonder if we should be doing any extra checking/logging in the case where a unit string cannot be mapped to real unit enum (as in the unit=december test above).

See ome#3127

Both the physical sizes and units are now taken from the ImagePlus'
Calibration.  This should have no impact on the common case where
physical sizes are unchanged after import, but should fix the case
when units are changed after import.
@dgault dgault added this to the 6.0.0 milestone Jan 7, 2019
@dgault
Copy link
Member

dgault commented Jan 9, 2019

Tested using the macro from #3127

The resulting log shows:

Pixel size (orig):  x=100nm y=100nm
Pixel size (reloaded):  x=0.1microns y=0.1microns

It still uses microns for the reloaded image but the value has been correctly scaled. When using showinf to view the OME-XML the value is correct and in nm as expected.

This PR is working as expected and good to merge.

@dgault dgault merged commit 3135102 into ome:develop Jan 9, 2019
@melissalinkert melissalinkert deleted the imagej-export-units branch January 15, 2019 21:29
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.

None yet

2 participants