# Load DICOM via python and ignore 'Warnings detected during load' dialog

**URL:** <https://discourse.slicer.org/t/load-dicom-via-python-and-ignore-warnings-detected-during-load-dialog/4672>\
**Category:** Support\
**Created:** [November 7, 2018, 4:27pm UTC](https://discourse.slicer.org/t/load-dicom-via-python-and-ignore-warnings-detected-during-load-dialog/4672 "2018-11-07T16:27:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_George](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ben_george/32/2992_2.png) [@Ben\_George](https://discourse.slicer.org/u/Ben_George)\
**Post date:** [November 7, 2018, 4:27pm UTC](https://discourse.slicer.org/t/load-dicom-via-python-and-ignore-warnings-detected-during-load-dialog/4672/1 "2018-11-07T16:27:02Z")

</div>

Hi

The latest version of Slicer has added a pop-up confirmation dialog when DICOM series are loaded which contain errors. This directs the user to look at the Advanced Information panel in the DICOM browser to find the warnings, or press OK to continue.

When using ‘–no-main-window’ and ‘–python-script’ flags to run some code which imports DICOMs, this dialog is not displayed and the script hangs at this point.

Is there any way to accept this warning when loading DICOMs in this way? Either programatically or having the dialog box displayed?

Thanks

Ben

---

<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:** [November 7, 2018, 9:02pm UTC](https://discourse.slicer.org/t/load-dicom-via-python-and-ignore-warnings-detected-during-load-dialog/4672/2 "2018-11-07T21:02:15Z")

</div>

Unfortunately, widget and logic are mixed in DICOM module. It would need significant rework to nicely separate them - I’ve added a ticket to track this task: [https://issues.slicer.org/view.php?id=4655](https://issues.slicer.org/view.php?id=4655)

Until it is fixed (probably will not happen soon unless some dedicated funding arrives or somebody volunteers), you can change `warnUserIfLoadableWarningsAndProceed` function in DICOMWidgets.py in your local Slicer installation to not display a popup but for example write the warnings to a log file instead:

> <https://github.com/Slicer/Slicer/blob/da6ad88dba4d60b7784953b01e82c5dd21670503/Modules/Scripted/DICOMLib/DICOMWidgets.py#L897-L909>
