AIM-Harvard / pyradiomics

Open-source python package for the extraction of Radiomics features from 2D and 3D images and binary masks. Support: https://discourse.slicer.org/c/community/radiomics
http://pyradiomics.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.18k stars 497 forks source link

DICOM file #395

Closed Sophile closed 6 years ago

Sophile commented 6 years ago

Does the input file format have to be .nrrd? I only have DICOM files,and didn't find any function about dcm,so do I need to transfer them to nrrd?and is there any approach in @@pyradiomics? kind regards,

lisherlock commented 6 years ago

You can use dcm files to get radiomics features correctly.

fedorov commented 6 years ago

@lisherlock no, you cannot use the DICOM files directly, unless you are processing a single DICOM file. SimpleITK does not sort the DICOM files in geometric order. If you are working with a volumetric acquisition, you should first preprocess the DICOM series to generate a volume saved in any of the formats readable by ITK, and then use that as the input image for pyradiomics.

You can use dcm2niix, or plastimatch convert to geometrically sort files in a DICOM series and save them as a volume.

If your input is multiple series, you can first sort the files into separate series using the dicomsort tool.

lisherlock commented 6 years ago

@fedorov Hi! As you said, i first convert multiple dcm files to single dcm file by using matlab. Then i get the 3D features of sigma. It's right that if i just only use one dcm file, i can't get the 3D features. So you should first convert many dcm files to one as order.

fedorov commented 6 years ago

This is interesting!

Can you please let us know what Matlab function you use for that conversion?

lisherlock commented 6 years ago

@fedorov Of course! The main solution that converting multiple dcm files to single dcm file is to build a 4D matrix. The 4D matrix includes the size of dcm files, pixel values and the number of frames. Then when you open the single dcm file converted, you will see it includes the series of dcm files. So you can get 3D features by using pyradiomics. By the way, the example nrrd file of the brain is one file but when you open it you will find it has many slices of nrrd files.

fedorov commented 6 years ago

Sounds like you wrote some code yourself to deal with this issue in Matlab, but I am not sure how this can help @Sophile. So I think @Sophile should follow the steps suggested in https://github.com/Radiomics/pyradiomics/issues/395#issuecomment-405599780.