How to segment all pores and its connecting paths seperately

Dear altruists,
I am trying to segment this 3d binary volume of having many spherical blobs connected to one another with some small path. Can you suggest me simple way of segmenting all the pores individually and seperating connection region, so that I can get properties of each spheres which is important for my work. I have attached an image for reference
Any suggestion is appriciated.

Hi - looks like the image didn’t come through - can you try again?


unfortunately, image was not uploaded previously. Here is the pore 3D volume I need to segment individually.

With the Segment Editor you could definitely threshold, then shrink with the margins tool, and then use the split option in the islands operator. That should get you most of the way.


In the Segment Editor, assuming you can get to the segmentation in your image (e.g. via thresholding), you should be able to do a pretty good job of isolating the spherical parts via the “Smoothing” tool with the Smoothing Method set to “Opening”. This should eliminate the small connections between spheres while only minimally modifying the spheres themselves. Next you can use the “Islands” tool with the option to “Split islands to segments”. That should make each sphere into it’s own segment.

If you want the connecting paths isolated, you can use the “Logical Operations” to subtract the opened object from the original connected object. If you want those as separate objects, you could again use the “Islands” tool and split them into individual segments.


Thanks Mike for your kind suggestion.
However I could not get satisfactory result out of that.
I did smoothing twice consecutively by opening with 3X3X3 kernal which did not open the connections.
Is there any shape based (for example spherical) object segmentor?
Island labeled unconnected object, but need segment on conencted spheres.

Probably you don’t need a model-based segmentation method. Instead, you can erode massively (it is enough if a couple of voxels remain in each sphere), split to islands, and do grow from seeds (with the intensity range set to match the sphere’s intensities). If you can upload a sample data set and post the link here then we can give more specific suggestions.

1 Like

Using a larger opening kernel should work well for cases where there is a thin connecting path between the large spheres. You just need a kernel larger than the connections, and the larger objects should be only minimally modified. Cases where the connections are really two spheres touching (rather than linked via a thin connector) might end up reconnected when the spheres are restored.

Because of that, Andras’s suggestion of eroding (Margin => Shrink), separating (Islands => Split), followed by Grow from seeds with a threshold applied may work better for you. If you are left with small connector paths that you don’t want, applying morphological opening (Smoothing => Opening) to your final objects should get rid of any small projections off the sphere surfaces that you don’t want.

This reference gives a quick overview of morphological image processing: Erode and Dilate operations are available via the Margin tool, and Open and Close are available via the Smoothing tool.


Thanks everyone for their suggestion, I will try to apply those.

This page is not letting tiff file to be uploded, so sharing this link of sample object

Here is a sample segment of 3D stacked binary image (.tiff) file which can be loaded as a volume in slicer.

I’ve gave it a try and the workflow we described above works quite well, except that certain operations takes minutes to complete. They can be automated, though, so if you have to run this analysis on many images then you don’t need to click and wait, just start the script and you get all the results at the end.


  • Go to Segment editor module, add segment
  • Threshold effect: Apply (to add all bright areas to the segment)
  • Margin effect: margin size = 3.0mm, operation = shrink, Apply 2 times (maybe 3x, to separate blobs)
  • Island effect: Split islands to segments, minimum size = 30 voxels (it takes a few minutes, creates a separate segment from each blob)
  • Threshold effect: Use for masking (to make sure segments will remain inside bright areas)
  • Grow from seeds effect: seed locality = 1.0, click Initialize, then Apply (takes 10-20 minutes, we’ll have to investigate why, we should be able to fix it so that it completes within 1-2 minutes)
  • If you need to remove clipped segments at the boundary: this can be automated with some Python scripting but you can do it manually, too: select Paint effect, enable “Color smudge”, then for each segment: click on the segment in the image (this will select the segment), then click Remove to delete the segment
  • Compute statistics using Segment Statistics module


Dear Dr Lasson,
Thanks and much appreciated.
I have tried according to your previos suggestions last week and could get segmention on most spheres. I had to use more than 21mm karnel shrink to seperate adjecent spheres.
Below here, you can see some sphere belonging to same island/segment that needs to be separated. Here it is small portion so manually I can split by cutting tool but my original data is much bigger and splitting manually will be difficult.
Any suggestion on making this segmentation better?

One more thing, from segment statistics I can get surface area, volume and (radius considering sphere), but is there a way of equivalent major axis, minor axis measurement for ellipsoid fitting?


You can increase the kernel size even further. If you find that a large enough kernel size completely erases smaller spheres than you can apply additional shrinking operations for only large islands.

Oriented bounding box size can be computed by ITK and we started to look into making it available in Segment Statistics - @Sunderlandkyl may be able to give an estimate about when it could be ready.

There’s only a small amount left to do. It should be available early next week.

1 Like

Thanks for the idea. Previosly did not nitice multiple segment editing or visualisation control option was there.

Thanks, Bounding box would be nice to have in Segment Statistics.
Is it going to provide segment centroid coordinates?
That would be important for calculating 3d dstribution inside.

Yes, it will provide centroid coordinates as well.