Import files into DICOM database

Hello,
I wanted to access “Import DICOM files” modal dialog window to open automatically just after opening of application but not by clicking button “Import DICOM files”.

Includes
“…\Modules\Scripted\DICOM.py”
“…\Modules\Scripted\DICOM\Resources\UI\DICOM.ui”
“…\Applications\SlicerApp\Testing\Python\Utiltest.py”

Could you please help?
Thanks.

You can open the DICOM import popup like this:

slicer.util.selectModule('DICOM')
slicer.util.getModuleGui('DICOM').importFolder()

You can find more DICOM module scripting examples in the script repository.


Thanks for the reply.

I wanted to open DICOM import popup window just after starting of application.
It is currently opening after clicking button Import DICOM files.

Screenshot is attached

Have you read @lassoan’s comment just above? Do you have any questions about that?

@cpinter
Yes I have read @lassoan’s comment and I can open the DICOM import popup by that but not as I want.
I wanted to open DICOM import popup window automatically just after starting of application without clicking on any button.
Please guide.

If you add those lines in your .slicerrc.py file then it will run at startup and it will open the window for you. You can easily find that file in Application settings / General / Application startup script.

Thank You @lassoan @cpinter .
It was very much helpful.