how to fill in an existing segment

Operating system: windows 10 64bit
Slicer version: 4.11.2020
Expected behavior: I am trying to segment a liver in non-contrast CT. The steps are as follows:

  1. threshold HU 0~100 for masking.
  2. paint liver in multiple axial slices.
  3. use fill between slices to get volume segmentation of liver.
  4. The result is a pretty good definition of liver volume. HOWEVER, inside the liver VOI, there are multiple small pixel sized holes in the liver because of the initial threshold. I would like to fill in these holes.
  5. I select the liver VOI → paint → in the masking section, I changed the editable intensity range set to -1024~3071, change the editable area to “inside segment_1” (which is the liver VOI).
  6. Then using a sphere shaped paint brush, i paint the whole liver. I expected the liver pixel holes to “fill up” within the boundaries of liver VOI, as the masking is fully open, and the editable area is within the liver VOI.

Actual behavior: painting anywhere in the CT doesn’t do anything in this setting. no paints on any area, either within the liver VOI or outside the VOI. Only by changing the editable area to “everywhere” does the paint brush paint anything. but this will not solve my problem as I have to re-paint the liver again, and worry about the margins. “inside all segments” does not work either, as the paint brush paints outside the liver VOI. it also does not fill in the small pixels inside the liver VOI.

Sorry for the long question. any help will be appreciated.


It sounds like you could use the Island tools.

This will prevent all painting outside your liver segment. Holes are outside the segment, too, so you won’t be able to fill them, so do not select this masking option, just use the default (Editable area: everywhere; Editable intensity range: disabled; Modify other segments: all).

You can fill in holes one by one using Islands effect as @pieper suggested above, or you can get all the internal holes filled fully automatically using “Wrap solidify” effect (provided by SurfaceWrapSolidify extension).