Skip to content

Commit

Permalink
ENH: Support nearest neighbor interpolator for montaging label maps
Browse files Browse the repository at this point in the history
Co-authored-by: Matt McCormick <[email protected]>
  • Loading branch information
dzenanz and thewtex committed Sep 2, 2024
1 parent 9027e04 commit d71031e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
27 changes: 18 additions & 9 deletions wrapping/itkTileMergeImageFilter.wrap
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
itk_wrap_include("itkLinearInterpolateImageFunction.h")
itk_wrap_include("itkNearestNeighborInterpolateImageFunction.h")
itk_wrap_class("itk::TileMergeImageFilter" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
foreach(t ${WRAP_ITK_SCALAR})
itk_wrap_template("${ITKM_I${t}${d}}" "${ITKT_I${t}${d}}, double")
endforeach()
foreach(t ${WRAP_ITK_RGB})
itk_wrap_template("${ITKM_I${t}${d}}" "${ITKT_I${t}${d}}, itk::RGBPixel<float>")
endforeach()
foreach(t ${WRAP_ITK_RGBA})
itk_wrap_template("${ITKM_I${t}${d}}" "${ITKT_I${t}${d}}, itk::RGBAPixel<float>")
foreach(iif LinearInterpolateImageFunction NearestNeighborInterpolateImageFunction)
if (${iif} STREQUAL "LinearInterpolateImageFunction")
set(abbr "L") # abbreviation to use in Python wrapping type name
else()
set(abbr "NN")
endif()
foreach(d ${ITK_WRAP_IMAGE_DIMS})
foreach(t ${WRAP_ITK_SCALAR})
itk_wrap_template("${ITKM_I${t}${d}}${abbr}" "${ITKT_I${t}${d}}, double, itk::${iif}<${ITKT_I${t}${d}}>")
endforeach()
foreach(t ${WRAP_ITK_RGB})
itk_wrap_template("${ITKM_I${t}${d}}${abbr}" "${ITKT_I${t}${d}}, itk::RGBPixel<float>, itk::${iif}<${ITKT_I${t}${d}}>")
endforeach()
foreach(t ${WRAP_ITK_RGBA})
itk_wrap_template("${ITKM_I${t}${d}}${abbr}" "${ITKT_I${t}${d}}, itk::RGBAPixel<float>, itk::${iif}<${ITKT_I${t}${d}}>")
endforeach()
endforeach()
endforeach()
itk_end_wrap_class()
1 change: 1 addition & 0 deletions wrapping/itkTileMontage.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ itk_wrap_class("itk::TileMontage" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
foreach(t ${WRAP_ITK_SCALAR})
itk_wrap_template("${ITKM_I${t}${d}}${ITKM_F}" "${ITKT_I${t}${d}},${ITKT_F}")
itk_wrap_template("${ITKM_I${t}${d}}${ITKM_D}" "${ITKT_I${t}${d}},${ITKT_D}")
endforeach()
endforeach()
itk_end_wrap_class()

0 comments on commit d71031e

Please sign in to comment.