Sikerdebaard / dcmrtstruct2nii

DICOM RT-Struct to mask
MIT License
91 stars 27 forks source link

nii conversion throws Error: unsupported 3 dimensions. #5

Closed kundan1974 closed 4 years ago

kundan1974 commented 4 years ago

I have a dicom files along with RTstructure file for multiple patients. when I aim trying to convert them to mask using dcmrtstruct2nii then for some cases it throws this error while in some there is no error..

I am sharing link for one of the case file. it is a folder containing images, doses, RTstructures and RTplans. RTstructure file is 02.dcm https://1drv.ms/u/s!AnttAOxuyQ3foYAf3NF84P5V4B1M4g?e=3Tsqxs

ERROR LOG:

RuntimeError: Exception thrown in SimpleITK ImageSeriesReader_Execute: /tmp/SimpleITK/Code/IO/src/sitkImageSeriesReader.cxx:163: sitk::ERROR: The file in the series have unsupported 3 dimensions.

Full Error goes like this:

RuntimeError Traceback (most recent call last)

in ----> 1 dcmrtstruct2nii("/media/airadiomicslab/LINUX/NSCLC-Cetuximab_486/0617-457446/02.dcm", "/media/airadiomicslab/LINUX/NSCLC-Cetuximab_486/0617-457446", "/home/airadiomicslab/notebooks/test") ~/.conda/envs/tensorflow-gpu/lib/python3.7/site-packages/dcmrtstruct2nii/facade/dcmrtstruct2nii.py in dcmrtstruct2nii(rtstruct_file, dicom_file, output_path, structures, gzip, mask_background_value, mask_foreground_value, convert_original_dicom) 65 66 rtstructs = rtreader.ingest(rtstruct_file) ---> 67 dicom_image = DcmInputAdapter().ingest(dicom_file) 68 69 dcm_patient_coords_to_mask = DcmPatientCoords2Mask() ~/.conda/envs/tensorflow-gpu/lib/python3.7/site-packages/dcmrtstruct2nii/adapters/input/image/dcminputadapter.py in ingest(self, input_dir) 22 dicom_reader.SetFileNames(dicom_file_names) 23 ---> 24 dicom_image = dicom_reader.Execute() 25 26 return dicom_image ~/.conda/envs/tensorflow-gpu/lib/python3.7/site-packages/SimpleITK/SimpleITK.py in Execute(self) 8471 8472 """ -> 8473 return _SimpleITK.ImageSeriesReader_Execute(self) 8474 8475 RuntimeError: Exception thrown in SimpleITK ImageSeriesReader_Execute: /tmp/SimpleITK/Code/IO/src/sitkImageSeriesReader.cxx:163: sitk::ERROR: The file in the series have unsupported 3 dimensions.
kundan1974 commented 4 years ago

This error was because of RTdose, & RTplan files which were in the same folder where dicom images were present. once I removed these files and only kept RT structure files and dicom images file in the folder, things were working fine.