I am now trying to read source code to learn but I have no idea to find the exact file or location for the method I am interested in at this moment. Can anyone help?
I searched “margin” on the Slicer github repository and looked through the first few code results. I knew I was looking for a Segment Editor Effect, which helped.
There is also this example in the script repository which uses a VTK filter directly (though note that the margin is specified as a kernel size is in voxels rather than millimeters in that case).Script repository — 3D Slicer documentation