3d segmentation refinement

Hi!
I’ve a 3d mask segmentation that I would like to improve by using some method. For example, something like use the mask like a “seed” and refine the segmentation with the original image information.

Original image
image
Segmentation that I want to improve
image

Could you help me?
Thank you very much :slight_smile:

Hello @AmericaBG,

Possibly look into using a watershed based segmentation approach.

Not sure if you are using SimpleITK or ITK. If SimpleITK, this Jupyter notebook illustrates the use of watershed based segmentation. This notebook is a complete workflow, from image to shape analysis. The relevant section there is titled Seed based watershed segmentation.

1 Like

Thank you very much @zivy .
I’m going to try and I’ll said you about the result :slight_smile:

Employing the images that I’ve shown before in the next expression:

ws=sitk.MorphologicalWatershedFromMarkers(
img, marker_img (mask), markWatershedLine=True, fullyConnected=False)

I obtain a 3D matrix full of 1’s. Do you know what could be the problem?

I’ve tried by applying sitk.GradientMagnitude to the original image prior to the sitk.MorphologicalWatershedFromMarkers function, but it’s the same, a 3D matrix full of 1’s as the result.

Thank you!

Hello @AmericaBG,

To better understand the watershed based segmentation in ITK, highly recommend reading the corresponding Insight Journal paper.

Is the initial segmentation a binary image? The initial segmentation visualization has multiple colors that all belong to the foreground so a bit suspicious. This could be just a visualization issue. Looks like the default matplotlib color map, viridis and I’d expect gray matplotlib.pyplot.cm.Greys_r.

In any case, the seed points should be unique integer labels. Please play a bit with the examples in the watershed notebook so that you have a good understanding of what the inputs are and how settings affect the resulting watershed segmentation.