Using Dicom Module from Script

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.

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:


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.

I would recommend taking a look in the script repository. There are tons of examples, grouped by topic.

Ended up using the following call