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.
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.
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.
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.