# Warning when closing scene

**URL:** <https://discourse.slicer.org/t/warning-when-closing-scene/31220>\
**Category:** Support\
**Created:** [August 18, 2023, 12:19pm UTC](https://discourse.slicer.org/t/warning-when-closing-scene/31220 "2023-08-18T12:19:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukasvanderstricht](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@lukasvanderstricht](https://discourse.slicer.org/u/lukasvanderstricht)\
**Post date:** [August 18, 2023, 12:19pm UTC](https://discourse.slicer.org/t/warning-when-closing-scene/31220/1 "2023-08-18T12:19:14Z")

</div>

Hi everyone!

I am working with slicer and I have developed some scripts that automate certain aspects of the segmentation workflow. These include the functionality that run MONAILabel’s automatic segmentation on consecutive samples. The only thing I am struggling with however is the fact that every time a new sample is loaded, there is a pop-up screen asking the user to confirm that the scene can be closed, such as the one below.

![Screenshot from 2023-08-18 14-07-41](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/a/aa20b415a5fea36f53e7c26ad643a5cc031038a0.png)

Of course this pop-up takes away from the automatic streamlined workflow of my scripts because user interaction is necessary to move on here.

**My question is: is there a way to disable this pop-up (either from the GUI or in Python).**

I have already looked into the application settings of Slicer and have found an option called `Confirm on scene close` under `General` that seems to allow this pop-up to be turned off (see below).

 ![Screenshot from 2023-08-18 14-05-09](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/6/86aa1408b29a171dec71cfce062fb55e2ef7a7fb.png)

However, even after deselecting the corresponding box and restarting the application, the pop-up window still pops up every time I retrieve the next sample.

Any ideas for alternatives?

Thanks in advance!

Kind regards

Lukas

---

<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 18, 2023, 4:05pm UTC](https://discourse.slicer.org/t/warning-when-closing-scene/31220/2 "2023-08-18T16:05:41Z")

</div>

this dialog is actually in the MONAILabel code, so you should be able to make a PR with an option to disable it.

> <https://github.com/Project-MONAI/MONAILabel/blob/main/plugins/slicer/MONAILabel/MONAILabel.py#L1216-L1223>
