MIC-DKFZ / nnUNet

Apache License 2.0
5.97k stars 1.77k forks source link

Converting Tiff to Nifti #751

Open dsitnik opened 3 years ago

dsitnik commented 3 years ago

Hi,

I am trying to convert tiff images into the required nifti format using the following function:

https://github.com/MIC-DKFZ/nnUNet/blob/06505439d5e3239105c867c6b380a95f44090431/nnunet/utilities/file_conversions.py#L63

What exactly is "spacing"? There is no explanation in the functions' description.

----> file_conversions.convert_3d_tiff_to_nifti(path+"imagesTs/"+name,"./"+out_name) TypeError: convert_3d_tiff_to_nifti() missing 1 required positional argument: 'spacing'

Do you have a working example?

sainatarajan commented 3 years ago

I think it refers to the Image Pixel Spacing. It is the distance between the centers of the adjacent pixels. For eg: It could be [1.0, 1.0, 1.5].

FabianIsensee commented 3 years ago

thanks @sainatarajan . Yes it refers to the pixel resolution. If your images don't have a resolution you can set this to (1, 1, 1)

nileshkumar0726 commented 2 years ago

I ran into the same problem when preprocessing the LiTS dataset.

dojoh commented 1 year ago

Hello,

Did you manage to resolve the problem or do you need further assistance? Otherwise, I will close the issue as its quite dated.

Cheers Ole