2D/3D fill tool


Just a simple question for which I hope there is a simple answer.

I’m exploring 3DSlicer as a possible alternative to Mimics. To do this I’m segmenting a femur that I already segmented with Mimics to compare the outcome.
I started by first thresholding for the cortical layer. Then I made sure that there are no more holes connecting the inside of the femur to the outside world by closing them manually with the paint tool (cortex layer is now completely closed).
Now I want to fill the complete inside of the femur like I normally do in Mimics with their ‘Fill cavity’ tool which works in 3D as well as in 2D. Is there a Slicer- tool that can 2D/3D-fill the entire slice/bone (like in Mimics) and where can I find it?

Greeting Léon

You can fill small holes using Smoothing effect / Closing (fill holes). If large cavities remain then you can fill them by following these steps:

  • Logical operators effect, Invert operation => Apply
  • Islands effect, Keep largest island => Apply
  • Logical operators effect, Invert operation => Apply

Let us know if you have any further questions. You should be able to do everything that you could to with Mimics, and much more.


I’m thinking we might want to starta specific guide like “Segment Editor for Mimics Users” (analogous to numpy for matlab users)

Might be a good idea. But in the meantime it is a very usefull tool that I’m missing here.

Do you get the cavity filling effect that you need by following the 3 steps that I described above (invert, keep largest island, invert)?

If it works well and the only problem is that it takes 8 mouse clicks then we may create a dedicated “Fill cavity” effect that does the same with a single mouse click.

Hi Andras,

That process worked for me (I happened to also be segmenting a femur). If your steps are enclosed in margin effect ‘grow’ and ‘shrink’ operations the amount of manual editing to close the cortical bone gaps is reduced. (Equivalent to using Mimics morphology operations ‘dilate’ and ‘erode’ to accomplish the same task around a cavity fill operation.)



1 Like

Have you tried using Does Smoothing effect / Closing (fill holes) before cavity fill instead? It is simpler to do then margin growing/shrinking (since it is just one step instead of two) and may provide very similar result.

That worked fine for me.
I don’t know if it’s going to work in other situations too, but for now it’s ok.

But I still think that a simple 2D/3D-bucketfill tool like Mimics uses would be much nicer and more intuitive to work with, specially when you can also use it to easily fill a hole in a 2D plane/slice. Maybe something to consider?
By the way, Seg3D also has a fill tool (which only works in 3D mode).

For now it’s one point for the Mimics guys! :wink:


That only works well when you’re dealing with small gaps of maybe 2 to 3 voxels. Higher settings will eventually affect your morphology, because you loose the smaller details, so I think you should be very carefull with this option.

When I manually close the gaps in a cortical layer I always start with Mimics paint/lasso tool in threshold setting and I lower the lowest threshold value and start to paint over the gaps, so that the software ‘finds’ the missing voxelcontour, which leads to a more smoother closing then by using a solid paintbrush. At the end I close the final gaps with a solid paintbrush.

I’m not so sure. There are two bucket fill features available in the Segment Editor (I admit, not easy to find).

  1. Islands effect / Add selected island

  2. Flood fill effect (provided by SegmentEditorExtraEffects extension) - this one has some experimental features to limit leaking through small holes

The main advantage of Slicer compared to proprietary packages is that we can move faster, make changes and improve things based on user feedbacks in a matter of days. So, if you find that anything is lacking or you have any suggestions then let us know.

Note that you can enable thresholding for any effect, including in Paint and Draw (=lasso):

  • select an effect
  • in Masking section, enable “Editable intensity range”

To set editable intensity range with preview:

  • select Threshold effect
  • adjust threshold slider, selected intensity range will be glowing in the image
  • click “Use for masking” to set selected range for “Editable intensity range”

Thanks Andras,

I already discovered this threshold painting and lassoing. Works kinda similar as in Mimics.
About the bucket fill; I must admit I didn’t know that. I have to play a little bit more, but things (for me as an experienced Mimics user) are hard to find in Slicer and the workflow is different. Needs some time.

I recently rediscovered Slicer after my first try about a year ago and I now experimenting to see if it can be used instead of Mimics (although this is a very power- and feature full application). We have a lot of students here who have to do segmentations and Mimics is very pricey, so we only have 3 licences. Maybe Slicer can help us in reducing that.


I’ve ‘played’ with both. Not sure yet which I prefer or the indicators for which to use and when. I tend to be conservative with smoothing operations. Have a couple of hip segmentations mid May and will try both approaches with each.



Just as an aside, I think a lot of things come down to getting used to the UI and workflow. I used to use Volume Graphics VG Studio Max 3 up until about a year ago, when I “cut the cord” and switched to Slicer. For my purposes, I’ve yet to find anything that I have missed from VG Studio Max that Slicer can’t do, and there are many things (for me) that Slicer does better (or VG just doesn’t do). And the active community of developers and users is simply fantastic.

Disclaimer - this could easily de-volve into a religious discussion regarding pros and cons of various applications, so I’ll just say whatever works for you is great.



Absolutely true, care is required. The tactic, used properly, reduces but does not eliminate manual editing to close mask (label) gaps.

Yes, cost may be an important factor, but it is not just that. Slicer and commercial clinical applications are playing in different fields.

For research, prototyping, and education purposes Slicer is much better, due to its openness, extensibility, comprehensive feature set, and large, very helpful and knowledgeable user/developer community.

For routine clinical tasks, you are required to use regulatory-approved software, with simpler, locked-down user interface and feature set. Mimics and other commercial software address this need directly. In contrast, clinical use of Slicer is the user’s own responsibility (we need obtain ethics/institutional review board approval for each study) and often user interface customization is needed for ease of use.

I think a boolean calculate( unite and subtract ) based on the 3D file( not the 2D, operation in 3d slicer) is very important as well as.
The result in 3d slicer generated by the method calculate a segment in segmentation for STL is very rough
And now I must have a subtract boolean calculate in Blender or 3matic for STL.

You can get very fine, smooth result in Slicer, you just need to use higher resolution labelmap representation in the segmentation. For example, for 3D printing set voxel spacing to 0.1 to 0.3 mm should work well. This may require lot of memory if you don’t crop the volume to a small region. Both cropping an resampling can be done using Crop volume module. When the high-resolution cropped volume is ready then you need to create a new segmentation node from scratch and select that as master volume.

Thank you for showing the steps.

Can I do that when I import sol file ?

Thank you

Can you describe what a sol file is? Maybe you mean STL?