I am currently working on a voice interface for 3D slicer. I’m implementing it using a scripted module for 3d Slicer where it creates a child process, and then continually listens for words from the child process (by checking a queue). It must then perform a change to the mrml scene using this received word (e.g., selecting the ROI tool; applying a window preset to a selected volume; changing the color lookup table of a volume).
My first issue is that when I start a child process using python multiprocessing, this results in the Slicer application crashing. Is python multiprocessing not supported by Slicer?
Furthermore, I am running into an issue when implementing listening. I have tried using a qt timer to constantly check the queue, but for some reason the behavior is unstable, and the applications crashes when I click something in the tool bar (e.g, change a module, select a different markup). I also tried creating a child thread which constantly checks the word queue, but this creates unstable and delayed behavior (I have seen forum posts saying that Slicer does not support multi threading). Lastly, I tried a solution using signals, but the signal handler has a massive delay (I’m not sure if 3D Slicer supports signals).
Have my approaches been wrong, or maybe there’s an error in the code I’m writing?
Any advice would be greatly appreciated, cheers!