I have 2 STLs, one is a model of bone with defect, the other one is an intact one. I want to get a 3D model of the defect (the difference between the two files). I know how to substract with Logical Operators in Segment Editor, but I believe it only works if I did a segmentation from volume data (such as CT) in the Slicer itself. I want to be able to import 2 STLs and substract them. How to do it in Slicer?
You can load the two STLs as segmentation and use the logical operators as you describe. But depending on where they came from they probably won’t line up correctly. So you need to first register them either manually or with a model registration tool. This can be challenging when parts are missing from one of the bones, but you should be able to get a good approximation.
I’ve done registration with SlicerIGT (still not perfect but I just want to try the features for now). I’ve tried 2 things that didn’t really work.
This one I’ve imported the two STLS as models, and all of the Segment Editor is greyed out. My models did not appear in the Segmentation list.
I’ve also tried importing the two STLs as segmentation. My data did appear in the Segmentation list in the Segment Editor, but I can only choose one or the other. And all the buttons on the left are also greyed out, including Logical Operators.
What should I do so I can substract them?
You probably need to import one of the CT scans too so the segment editor has a reference volume, then you can edit. Use the Segmentations module to copy a segment from one segmentation to the other.
Loading the original CT as @pieper suggested is the best, as it allows you to verify that all segmentation operations are sufficiently accurate. Alternatively, you can create a default blank volume as described in the documentation.
Your segmented surfaces look very noisy. You could consider smoothing it before doing any other operation. Also, volumetry is not appropriate for compatison when you work with very thin structures as we can see in your image. Instead, you can measure surface-to-surface distance (using ModelToModelDistance extension) or you can fill in cavities and work with solid objects (using SurfaceWrapSolidify extension).