Binary erode while preserving cell topology

In Slicer using the Simple Filters module, I’ve been doing binary thresholding of a CT volume:

But I want thinner walls so I thought I could fix this with binary erosion:

The problem is that the black cells starts to grow into each other and the walls disappears (red lines in picture). Is there a way to inflate the black cells without growing them into each other so that the cell topology is preserved? I just want thinner walls. The result doesn’t need to look exactly as the initial image.

I have the problem of finding a good thresholding value on the original CT volume: My thresholding either removes visual walls between the cells or fills up small cells. Could there be a way to postprocess my initial image (for example sharpening edges/shapes?) so I can make a binary image that looks like how we humans see the cells and walls?

Hello @joachim,

Possibly look into using watershed based segmentation. Take a look at this jupyter notebook, segmentation of bacteria from a 3D Focused Ion Beam Scanning Electron Microscopy. Specifically the section titled “Seed based watershed segmentation”.

1 Like

Thank you, I will have a look at watershed in that notebook. It will take me a little time to get deeper into ITK.

J

Maybe the binary thinning filter might be of interest to you - it keeps all cell walls, but you will get al of them thinned down to a single pixel.

In my experience it does not work too well if the structures to be thinned are too thick in the input image; and we have encountered what seems to be a bug in the current version, leading to additional artefacts in the thinning - but I don’t have the details of that issue handy at the moment.

1 Like

Thanks, I will take a look at the binary thinning filter too :slight_smile: