From f3e328657fc08d7d5d62397ed763032137250c41 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 29 Jul 2020 17:07:47 -0400 Subject: [PATCH] BUG: Do not wrap unsigned char for connected component output Often the generated labels exceed 255. --- .../wrapping/itkConnectedComponentImageFilter.wrap | 2 ++ .../wrapping/itkHardConnectedComponentImageFilter.wrap | 2 ++ .../wrapping/itkScalarConnectedComponentImageFilter.wrap | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Modules/Segmentation/ConnectedComponents/wrapping/itkConnectedComponentImageFilter.wrap b/Modules/Segmentation/ConnectedComponents/wrapping/itkConnectedComponentImageFilter.wrap index 0ba44a403fe..10a4c7ef0fe 100644 --- a/Modules/Segmentation/ConnectedComponents/wrapping/itkConnectedComponentImageFilter.wrap +++ b/Modules/Segmentation/ConnectedComponents/wrapping/itkConnectedComponentImageFilter.wrap @@ -2,6 +2,8 @@ itk_wrap_class("itk::ConnectedComponentImageFilter" POINTER) # Create wrappers from every selected integral (signed and un) type to every # selected unsigned type. Also force ulong output for the watershed filter. UNIQUE(to_types "UL;${WRAP_ITK_INT}") + # Supports too few labels. + list(REMOVE_ITEM to_types "UC") itk_wrap_image_filter_combinations("${WRAP_ITK_INT}" "${to_types}" 2+) itk_wrap_image_filter_combinations("${WRAP_ITK_VECTOR}" "${WRAP_ITK_INT}" 2+) itk_end_wrap_class() diff --git a/Modules/Segmentation/ConnectedComponents/wrapping/itkHardConnectedComponentImageFilter.wrap b/Modules/Segmentation/ConnectedComponents/wrapping/itkHardConnectedComponentImageFilter.wrap index 12aa29f4e41..1176d098628 100644 --- a/Modules/Segmentation/ConnectedComponents/wrapping/itkHardConnectedComponentImageFilter.wrap +++ b/Modules/Segmentation/ConnectedComponents/wrapping/itkHardConnectedComponentImageFilter.wrap @@ -2,5 +2,7 @@ itk_wrap_class("itk::HardConnectedComponentImageFilter" POINTER) # Create wrappers from every selected integral (signed and un) type to every # selected unsigned type. Also force ulong output for the watershed filter. UNIQUE(to_types "UL;${WRAP_ITK_INT}") + # Supports too few labels. + list(REMOVE_ITEM to_types "UC") itk_wrap_image_filter_combinations("${WRAP_ITK_INT}" "${to_types}") itk_end_wrap_class() diff --git a/Modules/Segmentation/ConnectedComponents/wrapping/itkScalarConnectedComponentImageFilter.wrap b/Modules/Segmentation/ConnectedComponents/wrapping/itkScalarConnectedComponentImageFilter.wrap index 02679a5e80c..43f3d61586b 100644 --- a/Modules/Segmentation/ConnectedComponents/wrapping/itkScalarConnectedComponentImageFilter.wrap +++ b/Modules/Segmentation/ConnectedComponents/wrapping/itkScalarConnectedComponentImageFilter.wrap @@ -1,3 +1,6 @@ itk_wrap_class("itk::ScalarConnectedComponentImageFilter" POINTER_WITH_SUPERCLASS) - itk_wrap_image_filter("${WRAP_ITK_INT}" 2 2+) + UNIQUE(to_types "UL;${WRAP_ITK_INT}") + # Supports too few labels. + list(REMOVE_ITEM to_types "UC") + itk_wrap_image_filter_combinations("${WRAP_ITK_INT}" "${to_types}" 2+) itk_end_wrap_class()