Skip to content

Commit ce8d439

Browse files
hjmjohnsonclaude
andcommitted
BUG: Fix duplicate SWIG template instantiation in StructureTensor wrapping
The VariableSizeMatrix Image wrapping iterated over WRAP_ITK_REAL types but always used double for the matrix element type, producing multiple names for the same underlying type. SWIG -Werror turned the resulting Warning 404 (duplicate template instantiation) into a build failure. Remove the redundant foreach(t) loop for Image and ImageSource wrappings where the type is always VariableSizeMatrix<double>, and use consistent template names across all related wrappings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b15d79d commit ce8d439

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

wrapping/itkStructureTensorImageFilter.wrap

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@ itk_wrap_include("itkVariableSizeMatrix.h")
22

33
itk_wrap_class("itk::Image" POINTER)
44
foreach(d ${ITK_WRAP_IMAGE_DIMS})
5-
foreach(t ${WRAP_ITK_REAL})
6-
itk_wrap_template("VSM${ITKM_I${t}}${d}"
7-
"itk::VariableSizeMatrix< ${ITKT_D} >, ${d}")
8-
endforeach()
5+
itk_wrap_template("VSM${d}"
6+
"itk::VariableSizeMatrix< ${ITKT_D} >, ${d}")
97
endforeach()
108
itk_end_wrap_class()
119

1210
itk_wrap_class("itk::ImageSource" POINTER)
1311
foreach(d ${ITK_WRAP_IMAGE_DIMS})
14-
foreach(t ${WRAP_ITK_REAL})
15-
itk_wrap_template("VSM${ITKM_I${ITKM_${t}}}${d}"
16-
"itk::Image<itk::VariableSizeMatrix< ${ITKT_D} >, ${d} >")
17-
endforeach()
12+
itk_wrap_template("IVSM${d}"
13+
"itk::Image<itk::VariableSizeMatrix< ${ITKT_D} >, ${d} >")
1814
endforeach()
1915
itk_end_wrap_class()
2016

@@ -29,7 +25,7 @@ itk_end_wrap_class()
2925
itk_wrap_class("itk::ImageToImageFilter" POINTER)
3026
foreach(d ${ITK_WRAP_IMAGE_DIMS})
3127
foreach(t ${WRAP_ITK_REAL})
32-
itk_wrap_template("${ITKM_I${t}${d}}VSM${ITKM_I${ITKM_${t}}}${d}"
28+
itk_wrap_template("${ITKM_I${t}${d}}IVSM${d}"
3329
"${ITKT_I${t}${d}}, itk::Image<itk::VariableSizeMatrix< ${ITKT_D} >, ${d} >")
3430
endforeach()
3531
endforeach()
@@ -38,9 +34,8 @@ itk_end_wrap_class()
3834
itk_wrap_class("itk::StructureTensorImageFilter" POINTER)
3935
foreach(d ${ITK_WRAP_IMAGE_DIMS})
4036
foreach(t ${WRAP_ITK_REAL})
41-
itk_wrap_template("${ITKM_I${t}${d}}VSM${ITKM_I${ITKM_${t}}}${d}"
37+
itk_wrap_template("${ITKM_I${t}${d}}IVSM${d}"
4238
"${ITKT_I${t}${d}}, itk::Image<itk::VariableSizeMatrix< ${ITKT_D} >, ${d} >")
4339
endforeach()
4440
endforeach()
4541
itk_end_wrap_class()
46-

0 commit comments

Comments
 (0)