Update 3D view if node changes

Hello Slicer Developers,

I am quite new to slicer and still in exploring stage. I have developed a small application in which a track can be generated from the given markup

Then I changed the coordinates of the markup simply by

Preformatted textmarkups.SetNthFiducialPositionFromArray(markups.GetNumberOfFiducials() - 1, newCord)Preformatted text

Now I want to change the coodinates of the markup in a loop which can easily be done.

The problem is the 3D view is not updating at each iteration after updating the markup Node? is there any command to update the 3D view while the processing the loop.

Thank you

Slicer is event driven, so rendering only happens when all events have been processed. So you can either call processEvents, like in ScreenCapture, or you can set up a timer to make your changes like in Rock mode for the viewer.

Thank you for your response, it kind of worked for me.

Is there any option in Slicer for dynamic update? My project needs some heavy computations which might need some time for the processing, is there any way that my module keeps on processing meanwhile user can interact in the rendering window?

Thank you for your help

You can put your computation into a CLI module, which can run in the background. See a Python example here: https://github.com/lassoan/SlicerPythonCLIExample

Thank you Lassoan, This is exactly what I needed.

Thanks alot