I’m trying to enable continuous cutting of segments by another segment, specifically in virtual reality, which I’m implementing using the subtraction logical operator and the slicerVirtualReality extension. Ideally I should be able to “grind” away segments using a modifier segment. This works quite efficiently when editing smaller segments. However there is a short lag after editing larger segments for the model to update. I have set smoothing in the conversion rules to 0, selected bypassMasking, but it’s still not fast enough for my purpose. This behavior is quite noticeable when I’m in virtual reality view, as the slow update causes the entire model to “jitter” a little. In 3D view on the PC, the lag is there but more difficult to see.
Steps to reproduce on PC:
- Create segmentation nodes containing sample segments of contrasting sizes
- Import model and convert to binary labelmap, import this to a new segmentation node which will be the modifier segment for the logical operator
- Transform the modifier segmentation node so that it overlaps with the sample segments
- Copy the modifier segment into a node containing a sample segment
- Apply subtraction logical operator to the sample segment and notice the update speed in 3D window. Compare between sample segments of various sizes. In my Python implementation, the application of editor effect can be triggered at very high frequency if the user wants to cut away on a segment continuously.
I ran profiler against a slicer build, SetBinaryLabelmapToSegment() -> ConvertSegmentsUsingPath() -> Convert() -> Update() is taking most of the CPU time when editor effect is applied. It makes sense that this process is proportional to the sizes of the segments. How I can further improve the conversion update speed so that I don’t see the lag? Is there a faster way to edit segments than the logical operator? Any ideas are greatly appreciated.
Operating system: Windows 10
Slicer version: Nightly 4.11
Expected behavior: Instantaneous update of modified segments in virtual reality view
Actual behavior: Short lag after modifying a larger segment with segment editor, preventing continuous application of the effect.