# Scripting Dicom load

**URL:** <https://discourse.slicer.org/t/scripting-dicom-load/3597>\
**Category:** Support\
**Created:** [July 28, 2018, 1:42am UTC](https://discourse.slicer.org/t/scripting-dicom-load/3597 "2018-07-28T01:42:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bphilip](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@bphilip](https://discourse.slicer.org/u/bphilip)\
**Post date:** [July 28, 2018, 1:42am UTC](https://discourse.slicer.org/t/scripting-dicom-load/3597/1 "2018-07-28T01:42:38Z")

</div>

Operating system: Windows 10

Slicer version: 4.8.1

Expected behavior/Goal: Load DICOMS --\> Show Scene --\> Rigid Register them --\> Export as nifti’s to an output dir

Programming Level: Beginner

Actual behavior: Imported DICOMLib, used importDicom function - got a True!

Problem: Scene didn’t change? Also lost on how to programmatically perform affine registration. (I see the gui and can do this using that. But I have a lot of images and want to just make it so I can for loop through the directory of images). I understand the for looping through dir part, I am lost on the getting Slicer to do its part.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 28, 2018, 4:38pm UTC](https://discourse.slicer.org/t/scripting-dicom-load/3597/2 "2018-07-28T16:38:23Z")

</div>

DICOM importing and loading are two separate steps. Import step: add files into Slicer’s DICOM database. Loading step: load data from DICOM database to the scene.

Details on how to do each step has been discussed before in several topics, such as [Load DICOM series using python](https://discourse.slicer.org/t/load-dicom-series-using-python/3257/3). If you cannot find answer to some questions in any of the topics, examples, or documentation then let us know.
