Search code examples
dicomsimpleitk

How to load Dicom data into simple ITK


I try to load PET/CT data (folder available in https://wwsi365-my.sharepoint.com/:f:/g/personal/s9956jm_ms_wwsi_edu_pl/EkoL7bs8rvxLq7-YHminlA0Bhc0PBY5_rG3zwMI2coHUAQ?e=TuekJa) - file can be opened via slicer for example so is not corrupted, but when I try to load it via simpleitk in python code below- I get error

code

 dirOfExample
="C:\\Users\\1\\Downloads\\bad45Y\\bad45Y\\DICOM\\21071306"
    reader = sitk.ImageSeriesReader()
    dicom_names = reader.GetGDCMSeriesFileNames(dirOfExample)
    reader.SetFileNames(dicom_names)

error

WARNING: In D:\a\1\sitk-build\ITK\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx, line 113

GDCMSeriesFileNames (00000000679B0CC0): No Series can be found, make sure your restrictions are not too strong

Thanks for help!


Solution

  • It looks like your DICOM files are down within some sub-directories of "21071306". The SimpleITK ImageSeriesReader is only going to look for DICOM image files within the directory that you give it. It does not do a recursive search of the sub-directories.