How do I add Ultrasonic probe STL into a scene?

Hi, I’m writing a module.
I’d like to implement a function that will load a probe in the upper right after pressing the Apply button.
Like this,


How do I write this part of my Python program.
Thanks!

You can use slicer.util.loadModel() function. See many examples in the script repository. You can find Python scripting tutorials and documentation here.

1 Like

Thank you very much.
How can I add interaction to the model so that I can resize and position it.

You can create a transform node in the Transforms module, and use that to transform (rotate, shift, etc.) any model, including your ultrasound model. I’m not sure what exactly you are trying to achieve, but maybe some of these tutorial will help too: User tutorial | SlicerIGT

1 Like