How to make tiffs where ITK from monai knows the pixel size? #8383
joaomamede
started this conversation in
General
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a pipeline from fluorescence microscopy that is working very well. I want to generalize it to different magnifications and microscopes and I am a bit stuck into making the input and ground truths DataSet() have the metadata for pixel size (X,Y,Z) be read from the tiff. This to pass it to the dataset dictionaries to transform it with SpacindD().
Here, I want tiff because it's the most common used format, and also to read it directly from the raw metadata to avoid data duplication (for example with bioio). For the inference I basically need a overall method that would work without LoadImaging through monai and I would just pass the pytorch tensor to the transforms.
Right now, for training model purposes I basically have my input and ground truths in nii.gz where I basically make it with this function, this works:
I have an option to save the tiff, I tried different metadata passes to tifffile but nothing seems to work:
So, question #1 is how can I write the tiffs so that ITK/Monai have the pixel_size_x and pixel_size_z (these are 3d Z-stacks) properly read?
Question #2 how can I transform an array directly and pass the metadata for pixel_size_x to the monai.Data.DataSet class?
Right now I'm doing the production inference like this, what I need from this is an adaptation where I can have the metadata passed when I call
frame_tensor = val2_transforms(frame_tensor)
This is the whole function:
Beta Was this translation helpful? Give feedback.
All reactions