ITK
ITK copied to clipboard
ITK Python and output of WatershedImageFilter
Description
WatershedImageFilter produces an itk.ULL (IdentifierType) Image. CastImageFilter doesn't wrap itk.ULL.
https://github.com/InsightSoftwareConsortium/ITK/blob/f98f6a8920c2b8af175865458fade50439a81c3a/Modules/Segmentation/Watersheds/include/itkWatershedImageFilter.h
Expected behavior
The current Python example: https://itk.org/ITKExamples/src/Segmentation/Watersheds/SegmentWithWatershedImageFilter/Documentation.html
works by using ScalarToRGBColormapImageFilter which is wrapped for ULL.
Would like to be able to have either ULL supported/wrapped in CastImageFilter or modifying WaterShedImageFilter to take OutputImageType (with default IdentifierType) as a parameter. Thoughts?
Versions
itk-5.2.0.post2
If the commit number is required, run $ git rev-parse --short HEAD
. -->
Environment
Python 3.7.6 Windows 10
Watershed filter tends to produce a lot of segments. It is probably not enough to just add an output image template type which defaults to the current output type. If anyone takes up modifying it, they will have to ensure that segment count overflows don't crash the filter and are handled somehow.
Adding a type specification for ULL->UL (and maybe some other target types) should be relatively easy and straightforward.
Sure, so just add a ULL to UL and ULL to double in the CastImageFilter wrapping?
With dimensions 2,3,4 as that is what itk.Image is wrapped for (don't see any ULL in vector images).
Yes, I think that will do it.
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.