Segment resolution changes after subtraction

Thank you for the response.

I smoothed the model using the Median method and it did shorten the update time when using eraser tool to adjust segmentation, however I noticed the smoothing isn’t retained by the model when the following is performed:

  1. Import segmentation from obj file
  2. Copy into existing model segmentation (which is smoothed)
  3. Using logical operator, subtract the imported segmentation from existing model
  4. The smoothed model becomes grainier when subtract operator completes its job
  5. Each time the subtract operator is used, the model becomes grainier progressively
    However if the subtract operator takes a segment created from the editor tools(eg. paint) as the modifier, the model stays smooth. Any input on why this is happening? I have attached some screenshots of the segmentation before and after using subtract operator.
    1 2 3

Can you save the scene as a .mrb file and share it via dropbox/onedrive/gdrive?

I’ve attached the scene with the model here: https://drive.google.com/file/d/1Nlkp4hUTY_DZmVLv-lyatALaDx9D4yhQ/view?usp=sharing. There’s a green rod shaped tool that I use as the modifier segment, loaded from .obj. To use the logical operator you need to transform the modifier to intersect the bone model, then copy the modifier into the model segmentation.

After exploring the issue a little further, I noticed that saving the scene, restarting slicer, and loading the scene seemed to help. With those procedures done the subtract operator didn’t mess up the smoothing the first time you use it. In the same session without saving, if you transform and copy the imported modifier into the model segment a second time and use the subtract operator, the smoothness decreases. These are my observations on the nightly version.

Thanks so much for helping!

I wanted to clarify how to recreate the behaviour step by step.

  1. Load the scene CopySegmentBinaryOperator.mrb
  2. Copy the Toggable Sphere Segment to the Spine Segmentation
    a. Go to the segmentations module
    b. Select the Spine Segmentation as the active segmentation
    c. Go to copy/move segments
    i. Current segmentation select Segmentation Sphere
    ii. Select Toggable Sphere
    iii. Add the Toggable Sphere segment to the Spine Segmentation node by pressing <+
  3. Subtract the Toggable Sphere Segment from the Model Segment
    a. Go to the Segment Editor module
    i. Select Model as the active segment
    ii. Select the Logical Operators effect
    iii. Select Substract operation
    iv. Select Toggable Sphere from Substract Segment
    v. Hit Apply

The problem is that the whole 3d surface visualized changes, rather than just where the segments intersect. The segment becomes much less smooth.

Thanks for the detailed report, I could reproduce and fix the issue (fix available in rev28498).

The problem was that the modifier segment had different geometry (origin, spacing) as the modified segment. The effect resampled the modified segment with the geometry of the modifier segment and you saw the effect of this resampling.

I’ve fixed the issue now in the latest Preview Release, but if you use different version then as a workaround you can avoid the error by using the same labelmap geometry in the modifier segment. For example, you can achieve this by importing the modifier segment directly from a model node.

Thanks Andras for fixing the issue! I can confirm that the behaviour as described has been fixed…onto the next error but that’s for another thread.

1 Like