Skip to content

Commit c32c1e9

Browse files
Simon RitSimonRit
authored andcommitted
COMP: Fix Python redefinition warnings with default options
1 parent 0cc6639 commit c32c1e9

File tree

5 files changed

+55
-59
lines changed

5 files changed

+55
-59
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77
itk-wheel-tag: 'v5.4rc01'
88
itk-python-package-tag: '5ad02309321621cdc7269b9b68a35013c912271c'
99
itk-python-package-org: 'InsightSoftwareConsortium'
10-
itk-module-deps: "RTKConsortium/ITKCudaCommon@v1.0.1"
10+
itk-module-deps: "RTKConsortium/ITKCudaCommon@b4f15f28fe7547f43de543b229d1a962df828e7f"
1111

1212
jobs:
1313
build-linux-cuda-python-packages:

wrapping/itkCudaImageDataManagerRTK.wrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if(RTK_USE_CUDA)
88
list(FIND ITK_WRAP_IMAGE_DIMS "4" _index)
99
if(${_index} EQUAL -1)
1010
itk_wrap_template("CI${ITKM_F}4" "itk::CudaImage<${ITKT_F}, 4>")
11-
foreach(c 2 3 4 5)
11+
foreach(c 2 3 4)
1212
itk_wrap_template("CI${ITKM_VF${c}}4" "itk::CudaImage<${ITKT_VF${c}}, 4>")
1313
itk_wrap_template("CI${ITKM_CVF${c}}4" "itk::CudaImage<${ITKT_CVF${c}}, 4>")
1414
endforeach()

wrapping/itkCudaImageRTK.wrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if(RTK_USE_CUDA)
66
list(FIND ITK_WRAP_IMAGE_DIMS "4" _index)
77
if (${_index} EQUAL -1)
88
itk_wrap_template("F4" "${ITKT_F}, 4")
9-
foreach(c 2 3 4 5)
9+
foreach(c 2 3 4)
1010
itk_wrap_template("${ITKM_VF${c}}4" "${ITKT_VF${c}}, 4")
1111
itk_wrap_template("${ITKM_CVF${c}}4" "${ITKT_CVF${c}}, 4")
1212
endforeach()

wrapping/itkImageSourceRTK.wrap

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,41 @@ itk_wrap_class("itk::ImageSource" POINTER)
4141
if (ITK_WRAP_double)
4242
itk_wrap_template("ID4" "itk::Image<${ITKT_D}, 4>")
4343
endif()
44-
if(RTK_USE_CUDA)
44+
endif()
45+
46+
# Wrap CUDA types
47+
if(RTK_USE_CUDA)
48+
itk_wrap_include(itkCudaImage.h)
49+
50+
# Wrap ITK dimension 4 missing types
51+
list(FIND ITK_WRAP_IMAGE_DIMS "4" _index)
52+
if (${_index} EQUAL -1)
4553
itk_wrap_template("CIF4" "itk::CudaImage<${ITKT_F}, 4>")
4654
endif()
55+
56+
# Force VECTOR_COMPONENTS to "2;3;4;5"
57+
UNIQUE(imageDimensions "${ITK_WRAP_IMAGE_DIMS};2;3;4")
58+
UNIQUE(vectorComponents "${ITK_WRAP_VECTOR_COMPONENTS};2;3;4;5")
59+
foreach(c ${vectorComponents})
60+
foreach(d ${imageDimensions})
61+
list(FIND ITK_WRAP_IMAGE_DIMS "${d}" _indexd)
62+
list(FIND ITK_WRAP_VECTOR_COMPONENTS "${c}" _indexc)
63+
if (${_indexd} EQUAL -1 OR ${_indexc} EQUAL -1)
64+
itk_wrap_template("CI${ITKM_VF${c}}${d}" "itk::CudaImage<${ITKT_VF${c}}, ${d}>")
65+
endif()
66+
endforeach()
67+
endforeach()
68+
4769
endif()
4870

4971
# Force ITK_WRAP_IMAGE_DIMS to contain "2;3;4"
5072
UNIQUE(imageDimensions "${ITK_WRAP_IMAGE_DIMS};2;3;4")
51-
set(vectorComponents 2 3 4 5)
73+
set(vectorComponents "2;3;4;5")
5274
remove(vectorComponents "${vectorComponents}" "${ITK_WRAP_VECTOR_COMPONENTS}")
53-
foreach(component ${vectorComponents})
75+
foreach(c ${vectorComponents})
5476
foreach(vt ${WRAP_ITK_VECTOR_REAL})
5577
foreach(d ${imageDimensions})
56-
itk_wrap_template("I${ITKM_${vt}${component}}${d}" "itk::Image<${ITKT_${vt}${component}}, ${d}>")
78+
itk_wrap_template("I${ITKM_${vt}${c}}${d}" "itk::Image<${ITKT_${vt}${c}}, ${d}>")
5779
endforeach()
5880
endforeach()
5981
endforeach()
@@ -64,37 +86,13 @@ itk_wrap_class("itk::ImageSource" POINTER)
6486
list(FIND ITK_WRAP_IMAGE_DIMS "${d}" _index)
6587
if (${_index} EQUAL -1)
6688
foreach(vt ${WRAP_ITK_VECTOR_REAL})
67-
foreach(component ${ITK_WRAP_VECTOR_COMPONENTS})
68-
itk_wrap_template("I${ITKM_${vt}${component}}${d}" "itk::Image<${ITKT_${vt}${component}}, ${d}>")
89+
foreach(c ${ITK_WRAP_VECTOR_COMPONENTS})
90+
itk_wrap_template("I${ITKM_${vt}${c}}${d}" "itk::Image<${ITKT_${vt}${c}}, ${d}>")
6991
endforeach()
7092
endforeach()
7193
endif()
7294
endforeach()
7395

74-
# Wrap CUDA types
75-
if(RTK_USE_CUDA)
76-
itk_wrap_include(itkCudaImage.h)
77-
foreach(d ${ITK_WRAP_IMAGE_DIMS})
78-
itk_wrap_template("CI${ITKM_F}${d}" "itk::CudaImage<${ITKT_F}, ${d}>")
79-
endforeach()
80-
81-
# Wrap ITK dimension 4 missing types
82-
list(FIND ITK_WRAP_IMAGE_DIMS "4" _index)
83-
if (${_index} EQUAL -1)
84-
itk_wrap_template("CIF4" "itk::CudaImage<${ITKT_F}, 4>")
85-
endif()
86-
87-
# Force VECTOR_COMPONENTS to "2;3;4;5"
88-
UNIQUE(imageDimensions "${ITK_WRAP_IMAGE_DIMS};2;3;4")
89-
UNIQUE(vectorComponents "${ITK_WRAP_VECTOR_COMPONENTS};2;3;4;5")
90-
foreach(component ${vectorComponents})
91-
foreach(d ${imageDimensions})
92-
itk_wrap_template("CI${ITKM_VF${component}}${d}" "itk::CudaImage<${ITKT_VF${component}}, ${d}>")
93-
endforeach()
94-
endforeach()
95-
96-
endif()
97-
9896
# Wrap ITK CovariantVector missing types
9997
if (NOT ITK_WRAP_covariant_vector_double)
10098

wrapping/itkImageToImageFilterRTK.wrap

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
itk_wrap_class("itk::ImageToImageFilter" POINTER)
22

3-
# Wrap ITK double missing types --
3+
# Wrap ITK double missing types
44
if (NOT ITK_WRAP_double)
55
itk_wrap_template("ID1ID1" "itk::Image<${ITKT_D}, 1>, itk::Image<${ITKT_D}, 1>")
66
itk_wrap_template("ID3ID2" "itk::Image<${ITKT_D}, 3>, itk::Image<${ITKT_D}, 2>")
@@ -52,44 +52,44 @@ itk_wrap_class("itk::ImageToImageFilter" POINTER)
5252
endif()
5353
endif()
5454

55+
# Wrap CUDA types
5556
if(RTK_USE_CUDA)
5657
itk_wrap_include(itkCudaImage.h)
57-
foreach(d ${ITK_WRAP_IMAGE_DIMS})
58-
itk_wrap_template("CI${ITKM_F}${d}CI${ITKM_F}${d}"
59-
"itk::CudaImage<${ITKT_F}, ${d}>, itk::CudaImage<${ITKT_F}, ${d}>")
60-
endforeach()
6158

6259
# Wrap ITK dimension 4 missing types
6360
list(FIND ITK_WRAP_IMAGE_DIMS "4" _index)
6461
if (${_index} EQUAL -1)
65-
itk_wrap_template("CIF4CIF4" "itk::CudaImage<${ITKT_F}, 4>, itk::CudaImage<${ITKT_F}, 4>")
62+
itk_wrap_template("CI${ITKM_F}4CI${ITKM_F}4"
63+
"itk::CudaImage<${ITKT_F}, 4>, itk::CudaImage<${ITKT_F}, 4>")
6664
endif()
6765

6866
# Force VECTOR_COMPONENTS to "2;3;4;5"
6967
UNIQUE(imageDimensions "${ITK_WRAP_IMAGE_DIMS};2;3;4")
7068
UNIQUE(vectorComponents "${ITK_WRAP_VECTOR_COMPONENTS};2;3;4;5")
71-
foreach(component ${vectorComponents})
69+
foreach(c ${vectorComponents})
7270
foreach(d ${imageDimensions})
73-
itk_wrap_template("CI${ITKM_VF${component}}${d}CI${ITKM_VF${component}}${d}"
74-
"itk::CudaImage<${ITKT_VF${component}}, ${d}>, itk::CudaImage<${ITKT_VF${component}}, ${d}>")
71+
list(FIND ITK_WRAP_IMAGE_DIMS "${d}" _indexd)
72+
list(FIND ITK_WRAP_VECTOR_COMPONENTS "${c}" _indexc)
73+
if (${_indexd} EQUAL -1 OR ${_indexc} EQUAL -1)
74+
itk_wrap_template("CI${ITKM_VF${c}}${d}CI${ITKM_VF${c}}${d}"
75+
"itk::CudaImage<${ITKT_VF${c}}, ${d}>, itk::CudaImage<${ITKT_VF${c}}, ${d}>")
76+
endif()
7577
endforeach()
7678
endforeach()
7779

7880
endif()
7981

8082
# Force ITK_WRAP_IMAGE_DIMS to contain "2;3;4"
8183
UNIQUE(imageDimensions "${ITK_WRAP_IMAGE_DIMS};2;3;4")
82-
set(vectorComponents 2 3 4 5)
83-
foreach(component ${vectorComponents})
84-
list(FIND ITK_WRAP_VECTOR_COMPONENTS "${component}" _index)
85-
if (${_index} EQUAL -1)
86-
foreach(vt ${WRAP_ITK_VECTOR_REAL})
87-
foreach(d ${imageDimensions})
88-
itk_wrap_template("I${ITKM_${vt}${component}}${d}I${ITKM_${vt}${component}}${d}"
89-
"itk::Image<${ITKT_${vt}${component}}, ${d}>, itk::Image<${ITKT_${vt}${component}}, ${d}>")
90-
endforeach()
84+
set(vectorComponents "2;3;4;5")
85+
remove(vectorComponents "${vectorComponents}" "${ITK_WRAP_VECTOR_COMPONENTS}")
86+
foreach(c ${vectorComponents})
87+
foreach(vt ${WRAP_ITK_VECTOR_REAL})
88+
foreach(d ${imageDimensions})
89+
itk_wrap_template("I${ITKM_${vt}${c}}${d}I${ITKM_${vt}${c}}${d}"
90+
"itk::Image<${ITKT_${vt}${c}}, ${d}>, itk::Image<${ITKT_${vt}${c}}, ${d}>")
9191
endforeach()
92-
endif()
92+
endforeach()
9393
endforeach()
9494

9595
# Force ITK_WRAP_VECTOR_COMPONENTS to contain "2;3;4;5"
@@ -101,19 +101,19 @@ itk_wrap_class("itk::ImageToImageFilter" POINTER)
101101
list(FIND ITK_WRAP_IMAGE_DIMS "${d}" _index)
102102
if (${_index} EQUAL -1)
103103
foreach(vt ${WRAP_ITK_VECTOR_REAL})
104-
foreach(component ${ITK_WRAP_VECTOR_COMPONENTS})
105-
itk_wrap_template("I${ITKM_${vt}${component}}${d}I${ITKM_${vt}${component}}${d}"
106-
"itk::Image<${ITKT_${vt}${component}}, ${d}>, itk::Image<${ITKT_${vt}${component}}, ${d}>")
104+
foreach(c ${ITK_WRAP_VECTOR_COMPONENTS})
105+
itk_wrap_template("I${ITKM_${vt}${c}}${d}I${ITKM_${vt}${c}}${d}"
106+
"itk::Image<${ITKT_${vt}${c}}, ${d}>, itk::Image<${ITKT_${vt}${c}}, ${d}>")
107107
endforeach()
108108
endforeach()
109109
endif()
110110
endforeach()
111111

112112
# Combination
113113
set(vectorComponents 2 3 4 5)
114-
foreach(component ${vectorComponents})
114+
foreach(c ${vectorComponents})
115115
foreach(vt ${WRAP_ITK_VECTOR_REAL})
116-
itk_wrap_template("I${ITKM_${vt}${component}}4I${ITKM_${vt}${component}}3" "itk::Image<${ITKT_${vt}${component}}, 4>, itk::Image<${ITKT_${vt}${component}}, 3>")
116+
itk_wrap_template("I${ITKM_${vt}${c}}4I${ITKM_${vt}${c}}3" "itk::Image<${ITKT_${vt}${c}}, 4>, itk::Image<${ITKT_${vt}${c}}, 3>")
117117
endforeach()
118118
endforeach()
119119

@@ -140,5 +140,3 @@ itk_wrap_class("itk::ImageToImageFilter" POINTER)
140140
endforeach()
141141

142142
itk_end_wrap_class()
143-
144-

0 commit comments

Comments
 (0)