# Using Dicom Module from Script

**URL:** https://discourse.slicer.org/t/using-dicom-module-from-script/8048
**Category:** Development
**Created:** [August 15, 2019, 8:15pm UTC](https://discourse.slicer.org/t/using-dicom-module-from-script/8048 "2019-08-15T20:15:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![burnhamd](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@burnhamd](https://discourse.slicer.org/u/burnhamd)
#### Post date: [August 15, 2019, 8:15pm UTC](https://discourse.slicer.org/t/using-dicom-module-from-script/8048/1 "2019-08-15T20:15:30Z")

</div>

I would like to load the dicom browser in my slicelet. Is there an example of doing this? I am able to access the browser through slicer.modules.dicom.widgetRepresentation, but of course this is empty.

I am assuming I have to set some dicom database to see my dicom datasets, but am at a loss of how to do this.

---

<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: [August 15, 2019, 11:24pm UTC](https://discourse.slicer.org/t/using-dicom-module-from-script/8048/2 "2019-08-15T23:24:56Z")

</div>

You can access the instance with `slicer.modules.DICOMInstance`, but this is created lazily, so you may need to first enter the module, which you can do with:

```auto
slicer.util.mainWindow().moduleSelector().selectModule('DICOM') 

```

But typically you shouldn’t need to access the module widget, but instead use the logic and plugins directly. There are some examples [in the tests](https://github.com/Slicer/Slicer/blob/aedb7d6702a30b485be952f2c933dfd96f072f02/Applications/SlicerApp/Testing/Python/DICOMReaders.py).

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [August 15, 2019, 11:50pm UTC](https://discourse.slicer.org/t/using-dicom-module-from-script/8048/3 "2019-08-15T23:50:32Z")

</div>

I would recommend taking a look in the script repository. There are tons of examples, grouped by topic.  
[https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#DICOM\_2](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#DICOM_2)

---

<div class="post-metadata">

### Author: ![burnhamd](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@burnhamd](https://discourse.slicer.org/u/burnhamd)
#### Post date: [August 19, 2019, 7:40pm UTC](https://discourse.slicer.org/t/using-dicom-module-from-script/8048/4 "2019-08-19T19:40:27Z")

</div>

Ended up using the following call

`slicer.modules.DICOMWidget.detailsPopup.show()`
