Aligning Segmentation and CT slices for feature extraction via Pyradiomics

Currently I am trying to extract higher order and texture based features from NLST chest CTs from their downloaded DICOM format.

I was having trouble properly formatting the data for insertion into a feature extraction pipeline. Upon downloading the data using AWS, the CT slices are returned as a separate DICOM per slice, while the segmentation is stored entirely as one DICOM.

For patient with PID 100002 for instance,

CT scans (126 slices):

Segmentation Mask (2697 slices):

Thus it cannot be simply fed into a pipeline with the respective file paths as they do not match up.

Do you have any ideas to align or overlay both the mask and CT slices in order to extract higher order and texture features from their respective DICOMs?

1 Like

@Nav_Malhotra thank you for reaching out to ask about this in the forum!

pyradiomics, as many other tools, is designed to work more reliably with the data converted to one of the 3d research formats, such as NRRD or NIfTI. IDC data is stored in DICOM. Fortunately, conversion from DICOM to those research format is quite straightforward. I recommend the following:

  1. for DICOM CT series, you can use dcm2niix command line converter - you can install binary for your platform from the releases page here: Releases · rordenlab/dcm2niix · GitHub. Once you installed it, run dcm2niix pointing it to the directory containing a single CT series.
  2. for DICOM SEG series (I see from the identifier 9629abf6-d1de-4931-bc6a-061890ae275c in your screenshot that you were looking at the TotalSegmentator segmentations collection in IDC), you can use dcmqi segimage2itkimage tool for conversion (again, you can download binaries of dcmqi in the repo: Releases · QIICR/dcmqi · GitHub).

Can you tell me how you are downloading the files from IDC? We recently added some convenience functions to the idc-index that aim to simplify the process. You can learn about this from the updated download instructions page. Would be very interested to hear your thoughts and any feedback on this new functionality!

Hope this helps, but do let us know if you need more assistance!