# How to use TotalSegmentator from Script with "--no-main-window" option

**URL:** <https://discourse.slicer.org/t/how-to-use-totalsegmentator-from-script-with-no-main-window-option/28144>\
**Category:** Support\
**Created:** [March 2, 2023, 5:03pm UTC](https://discourse.slicer.org/t/how-to-use-totalsegmentator-from-script-with-no-main-window-option/28144 "2023-03-02T17:03:10Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [March 2, 2023, 9:49pm UTC](https://discourse.slicer.org/t/how-to-use-totalsegmentator-from-script-with-no-main-window-option/28144/5 "2023-03-02T21:49:39Z")

</div>

This thread should help:

> [@Python script crashes when running w/o GUI due to smoothing effect](https://discourse.slicer.org/t/python-script-crashes-when-running-w-o-gui-due-to-smoothing-effect/28118):
>
> I try to run a python script via the command ./Slicer --no-splash --no-main-window --python-script ‘customScript.py’. It crashes when executing the following line: segmentEditorWidget.setActiveEffectByName("Smoothing"), however, it works when I remove the flag --no-main-window and also when the same code is run via a Jupyter Notebook. Is there any way to apply smoothing effect w/o a GUI? Slicer version: 5.2.2 Thanks!

---

_[View the full topic](https://discourse.slicer.org/t/how-to-use-totalsegmentator-from-script-with-no-main-window-option/28144)._
