[ITK] ITK MorphologicalWatershed failed on simple test image

Lowekamp, Bradley (NIH/NLM/LHC) [C] blowekamp at mail.nih.gov
Mon Jun 20 11:25:17 EDT 2016


Hello,

I think your expectations for the algorithm are not correct. Here is a Jupyter notebooks which may help:

http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/32_Watersheds_Segmentation.html

The input to the algorithms is expected to be a “feature” image, which is usually and edge map, or a distance field.

I think you are trying to run a “binary watershed” algorithm as opposed to a “grayscale watershed” algorithm, so a distance field is likely what you want.

There should be plenty of information out there about this common algorithm and different way to use it.

HTH,
Brad




On Jun 20, 2016, at 11:05 AM, Shawn SA Zhang <shawn.sa.zhang at gmail.com<mailto:shawn.sa.zhang at gmail.com>> wrote:

Hi Dear fellow ITK/SimpleITK developers,

I encountered a strange issue where the attached simple test image fails in MorphologicalWatershed filter.

The following python code produces an image with all “1”s, using the attached input_inv.vtk file.


Import SimpleITK as sitk

input_inv = sitk.ReadImage(“input_inv.vtk”)
input_watershed = sitk.MorphologicalWatershed(input_inv)
sitk.WriteImage(input_watershed, "input_watershed.vtk")


For quick diagnosis, I attached the visualization of the input_inv.vtk file.

Any suggestion will be greatly appreciated. Many thanks for your attention and help!

-Shawn
Independent Image Processing Consultant
<input_inv.vtk><input_visualization.png>_______________________________________________
Community mailing list
Community at itk.org<mailto:Community at itk.org>
http://public.kitware.com/mailman/listinfo/community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160620/a46caede/attachment-0001.html>


More information about the Community mailing list