Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Modules/Core/Transform/wrapping/itkBSplineBaseTransform.wrap
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
itk_wrap_class("itk::BSplineBaseTransform" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
itk_wrap_template("${ITKM_D}${d}3" "${ITKT_D},${d},3")
if (NOT ${d} EQUAL 3)
itk_wrap_template("${ITKM_D}${d}${d}" "${ITKT_D},${d},${d}")
endif()
endforeach()
itk_end_wrap_class()
3 changes: 3 additions & 0 deletions Modules/Core/Transform/wrapping/itkBSplineTransform.wrap
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
itk_wrap_class("itk::BSplineTransform" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
itk_wrap_template("${ITKM_D}${d}3" "${ITKT_D},${d},3")
if (NOT ${d} EQUAL 3)
itk_wrap_template("${ITKM_D}${d}${d}" "${ITKT_D},${d},${d}")
endif()
Comment thread
dzenanz marked this conversation as resolved.
endforeach()
itk_end_wrap_class()
13 changes: 13 additions & 0 deletions Modules/Core/Transform/wrapping/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,17 @@ if(ITK_WRAP_PYTHON)
${CMAKE_CURRENT_SOURCE_DIR}/itkTransformSerializationTest.py
DATA{Baseline/BSplineDeformationTransformDisplacements5.txt}
${ITK_EXAMPLE_DATA_ROOT}/DiagonalLines.png)

itk_python_expression_add_test(
NAME PythonInstantiateBSplineTransform2D2D
EXPRESSION "t = itk.BSplineTransform[itk.D, 2, 2].New()"
)
Comment thread
dzenanz marked this conversation as resolved.

list(FIND ITK_WRAP_IMAGE_DIMS 4 wrap_4_index)
Comment thread
dzenanz marked this conversation as resolved.
if(wrap_4_index GREATER -1)
itk_python_expression_add_test(
NAME PythonInstantiateBSplineTransform4D4D
EXPRESSION "t = itk.BSplineTransform[itk.D, 4, 4].New()"
)
endif()
endif()
17 changes: 13 additions & 4 deletions Wrapping/WrapITKTypes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ wrap_type("itk::FixedArray" "FA" "itkFixedArray.h")
set(dims ${ITK_WRAP_IMAGE_DIMS_INCREMENTED})
foreach(d ${ITK_WRAP_IMAGE_DIMS})
math(EXPR d2 "${d} * 2")

# for itk::SymmetricSecondRankTensor
math(EXPR d3 "${d} * (${d} + 1) / 2")

list(
APPEND
dims
Expand All @@ -149,9 +151,9 @@ endforeach()
# needs to have defined sizes for:
# - ITK_WRAP_IMAGE_DIMS_INCREMENTED
# - ITK_WRAP_VECTOR_COMPONENTS_INCREMENTED
# Dimensions 1;2;3;4;6 should always be wrapped.
# Dimensions 1;2;3;4;6;9 should always be wrapped.

unique(array_sizes "${dims};1;2;3;4;6;${ITK_WRAP_VECTOR_COMPONENTS_INCREMENTED}")
unique(array_sizes "${dims};1;2;3;4;6;9;${ITK_WRAP_VECTOR_COMPONENTS_INCREMENTED}")

# 3-D FixedArrays are required as superclass of rgb pixels
# TODO: Do we need fixed arrays for all of these types? For just the selected
Expand All @@ -178,8 +180,15 @@ foreach(d ${ITK_WRAP_IMAGE_DIMS})
foreach(i RANGE 1 ${d})
math(EXPR comp "${comp}*4")
endforeach()
add_template("${ITKM_D}${comp}" "${ITKT_D},${comp}")
add_template("${ITKM_UL}${comp}" "${ITKT_UL},${comp}")

# Check if computed comp dimension has already wrapped above
list(FIND array_sizes ${comp} array_sizes_index)

if(array_sizes_index LESS 0)
# Not already in array_sizes
add_template("${ITKM_D}${comp}" "${ITKT_D},${comp}")
add_template("${ITKM_UL}${comp}" "${ITKT_UL},${comp}")
endif()
endforeach()
end_wrap_type()
set(itk_Wrap_FixedArray ${WRAPPER_TEMPLATES})
Expand Down
Loading