Observing and tracking ScriptedLoadableModuleLogic

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 :slight_smile:

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: