Skip to content

Commit f61993e

Browse files
committed
ENH: Wrapping of SobelOperator only for 2D or 3D
A followup to 35d6a3d ENH: static_assert SobelOperator can only be instantiated for 2D or 3D These changes could be reverted if an ND compatible SobelOperator is implemented.
1 parent 0e473ca commit f61993e

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Modules/Core/Common/wrapping/itkSobelOperator.wrap

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ set(types "${WRAP_ITK_REAL}")
22

33
itk_wrap_class("itk::SobelOperator")
44
foreach(d ${ITK_WRAP_IMAGE_DIMS})
5-
foreach(t ${types})
6-
itk_wrap_template("${ITKM_${t}}${d}" "${ITKT_${t}}, ${d}")
7-
endforeach()
5+
if( ${d} GREATER_EQUAL 2 AND ${d} LESS_EQUAL 3 )
6+
foreach(t ${types})
7+
itk_wrap_template("${ITKM_${t}}${d}" "${ITKT_${t}}, ${d}")
8+
endforeach()
9+
endif()
810
endforeach()
911
itk_end_wrap_class()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
itk_wrap_class("itk::SobelEdgeDetectionImageFilter" POINTER)
2-
itk_wrap_image_filter("${WRAP_ITK_REAL}" 2)
2+
itk_wrap_image_filter("${WRAP_ITK_REAL}" 2 "2;3")
33
itk_end_wrap_class()
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
itk_wrap_class("itk::GradientDifferenceImageToImageMetric" POINTER)
2-
itk_wrap_image_filter("${WRAP_ITK_SCALAR}" 2 2+)
2+
# Depends on SobelOperator that is only available in 2D and 3D
3+
itk_wrap_image_filter("${WRAP_ITK_SCALAR}" 2 "2;3")
34
itk_end_wrap_class()

0 commit comments

Comments
 (0)