Skip to content

Commit 6041be3

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 863ba8d commit 6041be3

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

.github/workflows/build-test-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ on:
1212

1313
jobs:
1414
cxx-build-workflow:
15-
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.3
15+
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.6
1616

1717
python-build-workflow:
18-
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.4.3
18+
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.4.6
1919
secrets:
2020
pypi_password: ${{ secrets.pypi_password }}

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)