# Import file dicom in Python Pyradiomics

**URL:** <https://discourse.slicer.org/t/import-file-dicom-in-python-pyradiomics/24197>\
**Category:** Feature requests\
**Created:** [July 6, 2022, 8:25am UTC](https://discourse.slicer.org/t/import-file-dicom-in-python-pyradiomics/24197 "2022-07-06T08:25:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Van\_Tran\_Sang\_Huynh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/van_tran_sang_huynh/32/15043_2.png) [@Van\_Tran\_Sang\_Huynh](https://discourse.slicer.org/u/Van_Tran_Sang_Huynh)\
**Post date:** [July 6, 2022, 8:25am UTC](https://discourse.slicer.org/t/import-file-dicom-in-python-pyradiomics/24197/1 "2022-07-06T08:25:55Z")

</div>

Hello,  
I want to import 1 patient CT dicom image file (about 100+ images) into python pyrradiomics for feature extraction. How can I use the code? hope the helping.  
Thank.  
Sang

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 6, 2022, 1:40pm UTC](https://discourse.slicer.org/t/import-file-dicom-in-python-pyradiomics/24197/2 "2022-07-06T13:40:26Z")

</div>

You can script that, like in these examples, then use pyradiomics/SlicerRadiomics.  
[https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#dicom](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#dicom)

---

<div class="post-metadata">

**Author:** ![Van\_Tran\_Sang\_Huynh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/van_tran_sang_huynh/32/15043_2.png) [@Van\_Tran\_Sang\_Huynh](https://discourse.slicer.org/u/Van_Tran_Sang_Huynh)\
**Post date:** [July 7, 2022, 12:38pm UTC](https://discourse.slicer.org/t/import-file-dicom-in-python-pyradiomics/24197/3 "2022-07-07T12:38:18Z")

</div>

I am getting error when using this code on Python 3.6.4, I am importing CT data for feature extraction using the Python Pyradiomics library package. Is there any way to use it?  
The purpose I need to import a patient’s CT DICOM data file into Python and extract features using the Pyradiomics library package.  
Hope for a help.  
Thank.  
Sang

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/3/53b51c73bafdfaa245cf38269afd7d4b696c4be5.png)

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 7, 2022, 7:45pm UTC](https://discourse.slicer.org/t/import-file-dicom-in-python-pyradiomics/24197/4 "2022-07-07T19:45:02Z")

</div>

Pyradiomics in native python does not support dicom directly (not all sets of dicom files will map to a volumetric image) instead it needs a nrrd or nifti of a volume. The Slicer example code I linked only works in Slicer’s python, so you can use that to determine the right volume data from your CT dicom files. Then you can use pyradomics.
