# Observing and tracking ScriptedLoadableModuleLogic

**URL:** <https://discourse.slicer.org/t/observing-and-tracking-scriptedloadablemodulelogic/3975>\
**Category:** Support\
**Created:** [September 3, 2018, 3:25pm UTC](https://discourse.slicer.org/t/observing-and-tracking-scriptedloadablemodulelogic/3975 "2018-09-03T15:25:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominicrushforth](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@dominicrushforth](https://discourse.slicer.org/u/dominicrushforth)\
**Post date:** [September 3, 2018, 3:25pm UTC](https://discourse.slicer.org/t/observing-and-tracking-scriptedloadablemodulelogic/3975/1 "2018-09-03T15:25:15Z")

</div>

I am doing some image processing in a ScriptedLoadableModuleLogic module. I would like to set up a progress bar to show that the logic is running and connect to another routine on completion.

I have been trying to emulate the qSlicerCLIProgressBar with an observer like that below to trigger the status updates and completion routine…

self.cliNodeObserverTag = self.cliNode.AddObserver(‘ModifiedEvent’, self.onCLIEvent)

…however I’ve not been having much success.

I suspect I may be over complicating the problem and that there may be a much more straighforward solution. I’d be grateful for any suggestions 🙂

---

<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:** [September 3, 2018, 4:36pm UTC](https://discourse.slicer.org/t/observing-and-tracking-scriptedloadablemodulelogic/3975/2 "2018-09-03T16:36:10Z")

</div>

The CLI runs in a separate process, so there the progress update is event driven/asynchronous.

For a scripted module running in the main thread, you need to update the progress manually based on steps in your computation, something like what is done in the DICOM module:

> <https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/DICOMLib/DICOMWidgets.py#L720-L746>
