Long running process problem

I have a set of code for imaging processing that takes quite a long while to run.

If I run the code in command-line with PythonSlicer, the code completes and generates a new image.

However, when I run the code inside my Slicer extension, Slicer has a spin busy cursor for a long while and then the whole Slicer studio quits.

Just wonder if the 3d Slicer has a built-in timeout with an adjustable parameter for the timeout.

Thanks,
Bing Zhu
UCLA

If you can reproduce this with a script you can share it will be easier for people to help.

i think you can use the extension [SlicerParallelProcessing] to put the complex computation in that,and the main process listen to the sub process when it finished,that won’t cause a spin busy cursor.
but i encount a problem when i import qt in [SlicerParallelProcessing],the sub process stop with error , i dont’t know why @pieper

ParallelProcessing uses PythonSlicer by default so it can communicate via stdin/stdout of the subprocess. if you have a use case that requires Qt, you could start Slicer --no-main-window instead, but you’d need to implement a different communication strategy since the main Slicer app doesn’t communicate via stdin/stdout (although I wish it did and perhaps we should implement that). An option for communicating a helper Slicer background process would be to run with the WebServer in either the helper or the main Slicer and passing commands and data back and forth via http.

thank you pieper,it helps me!