-
Notifications
You must be signed in to change notification settings - Fork 14
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
Spacing image information in TIFF and PNG format #28
Comments
@fbudin69500 Really sorry for dropping the ball on this till now. I am juggling a lot of things, so you are always welcome to ping me at regular intervals if I do not answer in a timely manner. Upon cursory inspection, I think you are right about the calibrations not being propagated. In the meantime, has anyone at Kitware looked into a fix? If this is still an outstanding issue, fixing it might be as simple as adding code like the following after the meta.setPixelsPhysicalSizeX(FormatTools.getPhysicalSizeX(pSizeX), 0);
meta.setPixelsPhysicalSizeY(FormatTools.getPhysicalSizeY(pSizeY), 0);
meta.setPixelsPhysicalSizeZ(FormatTools.getPhysicalSizeZ(pSizeZ), 0);
meta.setPixelsTimeIncrement(FormatTools.getTime(pSizeT, null), 0);
double startingWavelength = getStartingWavelength(); // what should it be??
for (int c = 0; c < dimc; c++) {
double wave = startingWavelength + c * pSizeC;
meta.setChannelEmissionWavelength(FormatTools.getWavelength(wave), 0, c);
} Note that Bio-Formats now has support for units; the code above assumes the default units, since the Lastly, note that the |
Thanks for the input! As far as I know, nobody has tried to tackle this problem yet. The lines of code that you are suggesting might be very helpful! (CC @thewtex ). |
Thanks @fbudin69500 for the great report and @ctrueden for the great suggestions. We should have an opportunity to test further in a few months. |
It seems that the image spacing information is not saved when using SCIFIO to save these formats.
I have written a small reader and writer that use SCIFIO, for test purposes:
https://github.com/fbudin69500/scifio-spacing-test
When using the default PNG and TIFF writers, the spacing information is saved in the image.
Is this a known issue? I looked in the bioformat library and I had the impression that the spacing was not handled [1] [2].
[1] https://github.com/openmicroscopy/bioformats/blob/v5.0.0/docs/sphinx/formats/png-metadata.txt
[2] https://github.com/openmicroscopy/bioformats/blob/v5.0.0/docs/sphinx/formats/tiff-metadata.txt
Additionally, the spacing information does not seem to be passed from scifio-imageio to bioformat:
https://github.com/scifio/scifio-itk-bridge/blob/master/src/main/java/io/scif/itk/SCIFIOITKBridge.java#L538-L550
@thewtex @ctrueden
Do you think I am doing anything wrong or that this issue would be easy to address?
The text was updated successfully, but these errors were encountered: