In Dynamic Modeler, is it possible to use a sphere ROI node to perform ROI cut?

Hi,

I would like to use a sphere ROI node to perform ROI cut. However I cannot figure out how to create a sphere ROI.

In Dynamic Modeler, is it possible to use a sphere ROI node to perform ROI cut ?

Thanks in advance,

Best regards,

Vincent

In Slicer the ROI markup node is a box, there is no sphere option. If your model is closed, then you can convert it to a segmentation and edit it as you wish.

Thank you so much for your advise.

In this thread , Dynamic Modeler is suggested. I need to simulate bone drilling in real-time. Segment editing is not fast enough.

Is it possible to add sphere option to ROI markup node?

This from above is still true. It is always possible to add more options, but it requires contributing C++ code.

Hi!

For rendering in version 5.10.0 you can use the AnatomyCarve extension:
https://github.com/andrey-titov/SlicerAnatomyCarve

Hi @Esteban_Barreiro thank you so much for your advise. I cannot figure out how to use AnatomyCarve extension to simulate bone drilling in real-time. Would you mind giving me simple code to demonstrate how to use AnatomyCarve extension to simulate bone drilling in real-time?

@Vincent I have the sensation that you did’t see this. Have you explored this option?

Hi @cpinter , yes I have explored this option. That is why I said segment editing is not fast enough to simulate bone cutting in real-time. In this thread, @pieper and @lassoan recommended the Dynamic Modeler.

You can try Combine Models module in Sandbox extension. It can combine meshes using Boolean operations. If the mesh resolution is not too high and you cut the edited mesh to the minimum size then it may be fast enough.

You can also go meshless and use direct volume rendering. You can start from the original CT and set values of voxels that you remove to -1000. Then the only thing that takes time is to update the CT voxels, which can be very quick (as you just need a single np.minimum operation to combine the CT array with the small 3D array of the drill).

@lassoan thank you so much.

I tried Combine Models module. It may produce wrong empty mesh when performing Difference operation multiple times.

For example, two sphere Difference

sphere = vtk.vtkSphereSource()
sphere.SetRadius(10)
modelNode = slicer.modules.models.logic().AddModel(sphere.GetOutputPort())

sphere2 = vtk.vtkSphereSource()
sphere2.SetRadius(10)
sphere2.SetCenter(3.0, 0, 0)
modelNode2 = slicer.modules.models.logic().AddModel(sphere2.GetOutputPort()) 

How to prevent Combine Models module from producing wrong empty mesh ?