New feature: Soft edge option in volume masking

“Mask Volume” is a Segment Editor effect that can paint a a segment’s shape inside an image volume. It can be used for removing anything from the image (e.g., remove the patient table from a CT by blanking out the area) or it can be used for painting in structures (e.g., to simulate presence of objects or to fix problems during imaging). A limitation of the tool was that the edited images often had noticeable artifacts at the boundary of the painted region.

A new “Soft edge” option has been added to “Mask Volume” effect that removes the boundary artifacts of the in-painting by gradually blending the solid painted region with the original image. The effect has a single parameter, which specifies the size of the transition zone for this blending.

Example 1: Painting in a structure

Without soft edge (notice the blocky edges and color artifacts due to very high gradient):

Using soft edge option with 0.5mm thickness:

Example 2: Remove a structure from the image

Without soft edge (notice the artifacts where the table touched the patient skin):

Soft edge (less edge artifacts):

Soft edge (very wide edge, even less edge artifacts but the transition zone somewhat eats into the image):

The feature is available in recent Slicer Preview Releases (Slicer-5.3.0-2023-03-03 and later). Development was funded by SlicerHeart project.

1 Like

5 posts were split to a new topic: Volume masking “soft edge” option requires non-empty output volume

Hello Prof.Lasso

That is a great and very useful addition in Slicer. May I ask in how much time can this addition be added in a stable version instead of a preview?


We have released a stable version very recently and the next one is scheduled in 3 months. Until then you can overwrite the ...\lib\Slicer-5.3\qt-scripted-modules\SegmentEditorEffects\ file in the latest stable release by the one that comes from the latest preview release.

Hello again and thank you a lot for your answer :slight_smile:

It might sound obvious and maybe I understood something wrong here but:
The last stable version of Slicer I can see in the website is 5.2.2 ando not 5.3 where this module is available.

Thank you again for your help,

The new feature is available in Slicer-5.3. You can copy the feature from Slicer-5.3 to Slicer-5.2 by copying the file I mentioned above.