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
Show method does not preserve pixel spacing #438
Comments
Show
does not preserve pixel spacing
This is an unfortunate limitation of ImageJ. It does not render anisotropic pixel spacing. You can configure |
I understand that ImageJ doesn't render anisotropic pixel spacing, but it does support measurements on an image with anisotropic pixel spacing. Even when using isotropic pixel spacing as in: import SimpleITK as sitk
image = sitk.Image(64, 64, sitk.sitkFloat32)
image.SetSpacing((2.0, 2.0))
sitk.Show(image) # Image shown in ImageJ has unity pixel spacing The image shown in ImageJ by |
The intermediate file should have the spacing in it. Do you know what file formats that ImageJ supports with spacing? You can configure the file extension used by Show.
On Apr 10, 2018, at 5:52 PM, Taylor Braun-Jones <notifications@github.com<mailto:notifications@github.com>> wrote:
I understand that ImageJ doesn't render anisotropic pixel spacing, but it does support measurements on an image with anisotropic pixel spacing.
Even when using isotropic pixel spacing as in:
import SimpleITK as sitk
image = sitk.Image(64, 64, sitk.sitkFloat32)
image.SetSpacing((2.0, 2.0))
sitk.Show(image) # Image shown in ImageJ has unity pixel spacing
The image shown in ImageJ by Show has 1 unit pixel spacing in all directions. From Analyze > Set Scale ... menu, this is what I see:
[image]<https://user-images.githubusercontent.com/514960/38585388-aed7a67e-3ce7-11e8-90fc-d02c8f5d06f8.png>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub<#438 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AATmJRxm6Duu_ZXH-L_UAWTFL-zB5ZMYks5tnSligaJpZM4TOrJo>.
|
Yep, using NRRD fixed it: import os
os.environ["SITK_SHOW_EXTENSION"] = ".nrrd" Being the default format used by SimpleITK and one designed for medical imaging I'd assumed that NIFTI supported pixel spacing information. Does it not? If not, perhaps the default format used by |
That is good you were able to find a work around. The NIFTI file format certainly support spacing and other geometric imaging information. The limitation is in ImageJ(FIJI) not recognizing and using the spacing information. I would file a bug report with them. We choose NIFTI over NRRD as the default export file format because ImageJ supports all pixel types for NIFTI, where as ImageJ does not support complex pixel types with NRRD file types. |
Thanks for following up. I've filed an upstream bug: fiji/fiji#191
I see. That's unfortunate... |
Looks like [1] http://lists.openmicroscopy.org.uk/pipermail/ome-users/2018-May/007060.html |
When the Show function uses Fiji, the default image format is set to '.mha'. We did that because for '.nii' Fiji brings up the Bio-Formats Import Options dialog box. |
My expectation is that with the code below:
The image shown in ImageJ should have the same pixel spacing as
image
((2.0, 3.0)
in this case).The text was updated successfully, but these errors were encountered: