MIC-DKFZ / nnUNet

Apache License 2.0
5.95k stars 1.77k forks source link

Spacing info for tiff files #2542

Closed GXcells closed 2 days ago

GXcells commented 1 month ago

Hi, What do you mean by "json file that contains spacing information is required for TIFF files. An example for a 3D TIFF stack with units corresponding to 7.6 in x and y, 80 in z is"

What are the units? pixels, um?, inch? What if you have only 1 z so no z information?

karllandheer commented 4 weeks ago

Hello, the units should be physical units (i.e., not pixels), so that the physical size across images is consistent. I think if you just have a single slice then you can set the spacing in that dimension to whatever you want

mrokuss commented 2 days ago

Hey @GXcells

Since TIFF files are just a sequence of images, nnUNet needs to know the spacing between the pixels and single images to resample all volumes to a common spacing (can be non-isotropic). Usually this is measured in mm but you can choose any physical unit as long as you are consistent (also during inference on new images!).

Think about converting the 3D TIFF stack to another imaging format such as NIFTI for easier processing.

Best, Max