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:

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.

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

Ended up using the following call

slicer.modules.DICOMWidget.detailsPopup.show()