-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add python wrapping for CudaCommon
This wrapping differs from the one that used to be in RTK by the fact that it only wraps the interface for floating type data and only for image dimensions included in ${ITK_WRAP_IMAGE_DIMS} and vector components included in ${ITK_WRAP_VECTOR_COMPONENTS}. RTK will have to wrap itself everything else it needs.
- Loading branch information
1 parent
2999fc3
commit 095abb2
Showing
9 changed files
with
112 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
if(RTK_USE_CUDA) | ||
|
||
itk_wrap_simple_class("itk::CudaDataManager" POINTER) | ||
|
||
endif() | ||
itk_wrap_simple_class("itk::CudaDataManager" POINTER) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,18 @@ | ||
if(RTK_USE_CUDA) | ||
itk_wrap_class("itk::CudaImage" POINTER_WITH_CONST_POINTER) | ||
|
||
itk_wrap_class("itk::CudaImage" POINTER_WITH_CONST_POINTER) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("F${d}" "float, ${d}") | ||
endforeach() | ||
|
||
foreach(component ${ITK_WRAP_VECTOR_COMPONENTS}) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("F${d}" "float, ${d}") | ||
endforeach() | ||
|
||
list(FIND ITK_WRAP_IMAGE_DIMS "4" _index) | ||
if (${_index} EQUAL -1) | ||
itk_wrap_template("F4" "${ITKT_F}, 4") | ||
endif() | ||
|
||
# Force VECTOR_COMPONENTS to "2;3;4;5" | ||
# Force ITK_WRAP_IMAGE_DIMS to "2;3;4" | ||
UNIQUE(imageDimensions "${ITK_WRAP_IMAGE_DIMS};2;3;4") | ||
UNIQUE(vectorComponents "${ITK_WRAP_VECTOR_COMPONENTS};2;3;4;5") | ||
foreach(component ${vectorComponents}) | ||
foreach(d ${imageDimensions}) | ||
foreach(vt ${WRAP_ITK_VECTOR_REAL}) | ||
itk_wrap_template("${ITKM_${vt}${component}}${d}" "${ITKT_${vt}${component}}, ${d}") | ||
endforeach() | ||
foreach(cvt ${WRAP_ITK_COV_VECTOR_REAL}) | ||
itk_wrap_template("${ITKM_${cvt}${component}}${d}" "${ITKT_${cvt}${component}}, ${d}") | ||
endforeach() | ||
foreach(vt ${WRAP_ITK_VECTOR_REAL}) | ||
itk_wrap_template("${ITKM_${vt}${component}}${d}" "${ITKT_${vt}${component}}, ${d}") | ||
endforeach() | ||
foreach(cvt ${WRAP_ITK_COV_VECTOR_REAL}) | ||
itk_wrap_template("${ITKM_${cvt}${component}}${d}" "${ITKT_${cvt}${component}}, ${d}") | ||
endforeach() | ||
endforeach() | ||
endforeach() | ||
|
||
itk_end_wrap_class() | ||
|
||
endif() | ||
itk_end_wrap_class() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,16 @@ | ||
if(RTK_USE_CUDA) | ||
itk_wrap_include(itkCudaImage.h) | ||
|
||
itk_wrap_include(itkCudaImage.h) | ||
itk_wrap_class("itk::CudaImageDataManager" POINTER) | ||
|
||
itk_wrap_class("itk::CudaImageDataManager" POINTER) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}" "itk::CudaImage<${ITKT_F}, ${d}>") | ||
endforeach() | ||
|
||
foreach(component ${ITK_WRAP_VECTOR_COMPONENTS}) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}" "itk::CudaImage<${ITKT_F}, ${d}>") | ||
itk_wrap_template("CI${ITKM_VF${component}}${d}" "itk::CudaImage<${ITKT_VF${component}}, ${d}>") | ||
itk_wrap_template("CI${ITKM_CVF${component}}${d}" "itk::CudaImage<${ITKT_CVF${component}}, ${d}>") | ||
endforeach() | ||
endforeach() | ||
|
||
list(FIND ITK_WRAP_IMAGE_DIMS "4" _index) | ||
if(${_index} EQUAL -1) | ||
itk_wrap_template("CI${ITKM_F}4" "itk::CudaImage<${ITKT_F}, 4>") | ||
endif() | ||
|
||
# Force VECTOR_COMPONENTS to "2;3;4;5" | ||
UNIQUE(vectorComponents "${ITK_WRAP_VECTOR_COMPONENTS};2;3;4;5") | ||
foreach(component ${vectorComponents}) | ||
|
||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_VF${component}}${d}" "itk::CudaImage<${ITKT_VF${component}}, ${d}>") | ||
itk_wrap_template("CI${ITKM_CVF${component}}${d}" "itk::CudaImage<${ITKT_CVF${component}}, ${d}>") | ||
endforeach() | ||
|
||
list(FIND ITK_WRAP_IMAGE_DIMS "4" _index) | ||
if(${_index} EQUAL -1) | ||
itk_wrap_template("CI${ITKM_VF${component}}4" "itk::CudaImage<${ITKT_VF${component}}, 4>") | ||
itk_wrap_template("CI${ITKM_CVF${component}}4" "itk::CudaImage<${ITKT_CVF${component}}, 4>") | ||
endif() | ||
|
||
endforeach() | ||
|
||
itk_end_wrap_class() | ||
|
||
endif() | ||
itk_end_wrap_class() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,15 @@ | ||
if(RTK_USE_CUDA) | ||
itk_wrap_class("itk::CudaImageToImageFilter" POINTER) | ||
|
||
itk_wrap_class("itk::CudaImageToImageFilter" POINTER) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}CI${ITKM_F}${d}" | ||
"itk::CudaImage<${ITKT_F}, ${d}>, itk::CudaImage<${ITKT_F}, ${d}>") | ||
endforeach() | ||
|
||
foreach(component ${ITK_WRAP_VECTOR_COMPONENTS}) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}CI${ITKM_F}${d}" | ||
"itk::CudaImage<${ITKT_F}, ${d}>, itk::CudaImage<${ITKT_F}, ${d}>") | ||
itk_wrap_template("CI${ITKM_VF${component}}${d}CI${ITKM_VF${component}}${d}" | ||
"itk::CudaImage<${ITKT_VF${component}}, ${d}>, itk::CudaImage<${ITKT_VF${component}}, ${d}>") | ||
endforeach() | ||
endforeach() | ||
|
||
# Force VECTOR_COMPONENTS to "2;3;4;5" | ||
UNIQUE(imageDimensions "${ITK_WRAP_IMAGE_DIMS};2;3;4") | ||
UNIQUE(vectorComponents "${ITK_WRAP_VECTOR_COMPONENTS};2;3;4;5") | ||
foreach(component ${vectorComponents}) | ||
foreach(d ${imageDimensions}) | ||
itk_wrap_template("CI${ITKM_VF${component}}${d}CI${ITKM_VF${component}}${d}" | ||
"itk::CudaImage<${ITKT_VF${component}}, ${d}>, itk::CudaImage<${ITKT_VF${component}}, ${d}>") | ||
endforeach() | ||
endforeach() | ||
|
||
itk_end_wrap_class() | ||
|
||
endif() | ||
itk_end_wrap_class() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,31 @@ | ||
if(RTK_USE_CUDA) | ||
itk_wrap_class("itk::CudaInPlaceImageFilter" POINTER) | ||
|
||
itk_wrap_class("itk::CudaInPlaceImageFilter" POINTER) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}CI${ITKM_F}${d}" | ||
"itk::CudaImage<${ITKT_F}, ${d}>, itk::CudaImage<${ITKT_F}, ${d}>") | ||
endforeach() | ||
|
||
#itk_wrap_image_filter_combinations("${WRAP_ITK_REAL}" "${WRAP_ITK_REAL}") | ||
foreach(component ${ITK_WRAP_VECTOR_COMPONENTS}) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}CI${ITKM_F}${d}" | ||
"itk::CudaImage<${ITKT_F}, ${d}>, itk::CudaImage<${ITKT_F}, ${d}>") | ||
itk_wrap_template("CI${ITKM_V${ITKM_F}${component}}${d}CI${ITKM_V${ITKM_F}${component}}${d}" | ||
"itk::CudaImage<itk::Vector<${ITKT_F},${component}>, ${d}>, itk::CudaImage<itk::Vector<${ITKT_F},${component}>, ${d}>") | ||
endforeach() | ||
endforeach() | ||
|
||
# Force VECTOR_COMPONENTS to "2;3;4;5" | ||
UNIQUE(vectorComponents "${ITK_WRAP_VECTOR_COMPONENTS};2;3;4;5") | ||
foreach(component ${vectorComponents}) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_V${ITKM_F}${component}}${d}CI${ITKM_V${ITKM_F}${component}}${d}" | ||
"itk::CudaImage<itk::Vector<${ITKT_F},${component}>, ${d}>, itk::CudaImage<itk::Vector<${ITKT_F},${component}>, ${d}>") | ||
endforeach() | ||
endforeach() | ||
itk_end_wrap_class() | ||
|
||
itk_end_wrap_class() | ||
itk_wrap_class("itk::CudaImageToImageFilter" POINTER) | ||
|
||
itk_wrap_class("itk::CudaImageToImageFilter" POINTER) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}CI${ITKM_F}${d}IPIFCI${ITKM_F}${d}" "itk::CudaImage<${ITKT_F}, ${d}>, itk::CudaImage<${ITKT_F}, ${d}>, itk::InPlaceImageFilter< itk::CudaImage<${ITKT_F}, ${d}> >") | ||
endforeach() | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}CI${ITKM_F}${d}IPIFCI${ITKM_F}${d}" | ||
"itk::CudaImage<${ITKT_F}, ${d}>, itk::CudaImage<${ITKT_F}, ${d}>, itk::InPlaceImageFilter< itk::CudaImage<${ITKT_F}, ${d}> >") | ||
endforeach() | ||
|
||
# Force VECTOR_COMPONENTS to "2;3;4;5" | ||
# Force ITK_WRAP_IMAGE_DIMS to "2;3;4" | ||
UNIQUE(imageDimensions "${ITK_WRAP_IMAGE_DIMS};2;3;4") | ||
UNIQUE(vectorComponents "${ITK_WRAP_VECTOR_COMPONENTS};2;3;4;5") | ||
foreach(component ${vectorComponents}) | ||
foreach(d ${imageDimensions}) | ||
itk_wrap_template("CI${ITKM_VF${component}}${d}CI${ITKM_VF${component}}${d}IPIFCI${ITKM_VF${component}}${d}" | ||
"itk::CudaImage<${ITKT_VF${component}}, ${d}>, itk::CudaImage<${ITKT_VF${component}}, ${d}>, itk::InPlaceImageFilter< itk::CudaImage<${ITKT_VF${component}}, ${d}> >") | ||
endforeach() | ||
foreach(component ${ITK_WRAP_VECTOR_COMPONENTS}) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_VF${component}}${d}CI${ITKM_VF${component}}${d}IPIFCI${ITKM_VF${component}}${d}" | ||
"itk::CudaImage<${ITKT_VF${component}}, ${d}>, itk::CudaImage<${ITKT_VF${component}}, ${d}>, itk::InPlaceImageFilter< itk::CudaImage<${ITKT_VF${component}}, ${d}> >") | ||
endforeach() | ||
endforeach() | ||
|
||
itk_end_wrap_class() | ||
|
||
endif() | ||
itk_end_wrap_class() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
itk_wrap_class("itk::CudaSquareImageFilter" POINTER) | ||
itk_wrap_image_filter("${WRAP_ITK_SCALAR}" 2) | ||
|
||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}CI${ITKM_F}${d}" | ||
"itk::CudaImage<${ITKT_F}, ${d}>") | ||
endforeach() | ||
|
||
itk_end_wrap_class() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
itk_wrap_include(itkCudaImage.h) | ||
|
||
itk_wrap_class("itk::ImageSource" POINTER) | ||
|
||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}" "itk::CudaImage<${ITKT_F}, ${d}>") | ||
endforeach() | ||
|
||
foreach(component ${ITK_WRAP_VECTOR_COMPONENTS}) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_VF${component}}${d}" "itk::CudaImage<${ITKT_VF${component}}, ${d}>") | ||
endforeach() | ||
endforeach() | ||
|
||
itk_end_wrap_class() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
itk_wrap_include(itkCudaImage.h) | ||
|
||
itk_wrap_class("itk::ImageToImageFilter" POINTER) | ||
|
||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}CI${ITKM_F}${d}" | ||
"itk::CudaImage<${ITKT_F}, ${d}>, itk::CudaImage<${ITKT_F}, ${d}>") | ||
endforeach() | ||
|
||
foreach(component ${ITK_WRAP_VECTOR_COMPONENTS}) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_VF${component}}${d}CI${ITKM_VF${component}}${d}" | ||
"itk::CudaImage<${ITKT_VF${component}}, ${d}>, itk::CudaImage<${ITKT_VF${component}}, ${d}>") | ||
endforeach() | ||
endforeach() | ||
|
||
itk_end_wrap_class() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
itk_wrap_include(itkCudaImage.h) | ||
|
||
itk_wrap_class("itk::InPlaceImageFilter" POINTER) | ||
|
||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_F}${d}" "itk::CudaImage<${ITKT_F}, ${d}>") | ||
endforeach() | ||
|
||
foreach(component ${ITK_WRAP_VECTOR_COMPONENTS}) | ||
foreach(d ${ITK_WRAP_IMAGE_DIMS}) | ||
itk_wrap_template("CI${ITKM_VF${component}}${d}" "itk::CudaImage<${ITKT_VF${component}}, ${d}>") | ||
itk_wrap_template("CI${ITKM_VF${component}}${d}CI${ITKM_VF${component}}${d}" | ||
"itk::CudaImage<${ITKT_VF${component}}, ${d}>, itk::CudaImage<${ITKT_VF${component}}, ${d}>") | ||
endforeach() | ||
endforeach() | ||
|
||
itk_end_wrap_class() | ||
|