In our project, instead of sphere brush (default), we would like to import our own medical tools (obj) file and make an erase effect on 3D model from that medical tool. What will be the fastest and convenient way to do so.
@lassoan, By the way, we already have Virtual Reality version for this simulator, we would like to implement it also in the PC version. My current plan is to load the obj file (medical tool) and transform it to the sphere tool of the segment editor.
Secondly,
Is the link primary source code which is controlling paint and erase effect of 3D Slicer ?
Segment Editor is not ideal for real-time simulation of drilling. For real-time volume removal, you are probably better off using volume rendering for 3D display and blanking out parts of the volume by combining your tool volume (rasterized volume of the tool model) with the displayed volume. This should be all doable in Python and since you can do everything with numpy array operations, it should be very fast.
Hi @lassoan , thank you for reply. Actually our spine models are built/resected with uploading patient specific MR/CT scans and using Segment Editor module.
Yes for our Virtual Reality system there is huge latency during the resection and we tried to use volume rendering technique instead of using closed surface representation. The study is still going on.
In addition with VR simulation, we do have regular PC version simulation, right now we are just using 3D sphere or scissor effect for resection. Though it doesn’t look real time but is acceptable for training purpose.
Our plan is instead of using 3d sphere or brush for erase effect, we planned to import medical tools like burr/ Kerrison as obj file and make a erase effect.
You can apply a transform to your 3D model, import it into the segmentation, and erase from another segment using Logical operators effect. You can find examples for each of these steps in the script repository.
Thank you for the suggestions. Only one thing, I got stuck is how to get the node of the 3D sphere being used in paint/erase effect before apply transform to imported 3D model.
Last question, I am still struggling . In segment Editor 3D sphere brush is used for paint/erase effect. How can I access that 3D sphere Brush node so that I can transform my loaded obj to that model node.
You can implement custom user interactions in your module (add observers to mouse events, etc. or create custom effect, using qSlicerSegmentEditorPaintEffect as base class and customizing the updateBrushModel method). I would not recommend doing this, though. Displaying the bone using volume rendering and blanking out regions that are being removed results in much higher quality rendering and a magnitude higher frame rate.