I am getting started with image analysis in python and have issues importing the metadata from microscopy data .tif-files that I hope you might be able to help with.
The data I am looking at might consist of bigger stacks, so ideally I would like to import the meta data before opening the desired part of the image only.
In principle, this can be done using the SimpleITK ImageFileReader, setting it up and then using GetMetaDataKeys() for reading the meta data and creating calling the ImageFileReader a second time to extract the desired part of the image after setting the constraints. But I run into the following issues:
Most of the meta data is returned as one long string that belongs to a single key. (Currently, I am creating a dictionary from by ‘manually’ splitting this string.)
Some of the meta data keys can’t be accessed at all in this way. In these cases the GetMetaData() function returns the default string ‘[UNKNOWN_PRINT_CHARACTERISTICS]’. However, the meta data can be accessed in Fiji and matlab.
The 5D data is only interpreted as 3D by the ImageFileReader. The skimage.io.imread() function however manages to interpret the data correctly as 5D (but can’t be used to import a fraction of the data only). This problem is a little less relevant than the first two, but to me it seems that this is caused by the issue of not reading and interpreting the meta data properly.
Some more information: I am using python version 3.7(.4), SimpleITK version 1.2rc1, the data I am processing consists of 5D stacks (3 spatial dimensions, time, channel). I only want to read .tif files, but the metadata is stored using different conventions.
If you need more info, please let me know.
I am hope some of you can help with this. ( @Christian_Tischer thank you for sending this to people who may be able to.)
Best and thanks,