Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Support casting unsigned long pixel types in Python #1911

Merged
merged 1 commit into from
Jul 10, 2020
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
2 changes: 1 addition & 1 deletion Modules/Core/Common/wrapping/itkImageToImageFilterA.wrap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
itk_wrap_class("itk::ImageToImageFilter" POINTER)
# Wrap from each scalar type to each other, and also to uchar (for 8-bit saving)
# and to ulong (for watershed).
UNIQUE(from_types "UC;${ITKM_IT};ULL;${WRAP_ITK_SCALAR}")
UNIQUE(from_types "UC;UL;${ITKM_IT};ULL;${WRAP_ITK_SCALAR}")
UNIQUE(to_types "UC;UL;${ITKM_IT};${WRAP_ITK_SCALAR}")
itk_wrap_image_filter_combinations("${from_types}" "${to_types}")

Expand Down
11 changes: 3 additions & 8 deletions Modules/Core/Common/wrapping/itkInPlaceImageFilterA.wrap
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
itk_wrap_class("itk::InPlaceImageFilter" POINTER)
# Wrap from each scalar type to each other, and also to uchar (for 8-bit
# saving), UL for label images
UNIQUE(types "UC;UL;${WRAP_ITK_SCALAR}")
itk_wrap_image_filter_combinations("${types}" "${types}")

# Wrap from ulong to other integral types, even if ulong isn't wrapped. This
# is needed for the relabel components image filter.
if(NOT ITK_WRAP_unsigned_long)
itk_wrap_image_filter_combinations("${ITKM_IT}" "${WRAP_ITK_INT}")
endif()
UNIQUE(from_types "UC;UL;${ITKM_IT};ULL;${WRAP_ITK_SCALAR}")
UNIQUE(to_types "UC;UL;${ITKM_IT};${WRAP_ITK_SCALAR}")
itk_wrap_image_filter_combinations("${from_types}" "${to_types}")

# Vector types
itk_wrap_image_filter_combinations("${WRAP_ITK_VECTOR}" "${WRAP_ITK_VECTOR}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
itk_wrap_class("itk::CastImageFilter" POINTER_WITH_SUPERCLASS)
# Create cast filters between all scalar types. Also force that cast-to-uchar
# filters are created for all scalar types.
UNIQUE(types "${WRAP_ITK_SCALAR};UC")
# filters are created for all scalar types, and unsigned long for
# segmentation output casting.
UNIQUE(types "${WRAP_ITK_SCALAR};UC;UL")
itk_wrap_image_filter_combinations("${types}" "${types}")

# vector <-> vector
Expand All @@ -15,12 +16,6 @@ itk_wrap_class("itk::CastImageFilter" POINTER_WITH_SUPERCLASS)
# itk_wrap_image_filter_combinations("${WRAP_ITK_VECTOR}" "${WRAP_ITK_RGB}" 3)
# itk_wrap_image_filter_combinations("${WRAP_ITK_RGB}" "${WRAP_ITK_VECTOR}" 3)

# Wrap from ulong to other integral types, even if ulong isn't wrapped. This
# is needed for the relabel components image filter output.
if(NOT ITK_WRAP_unsigned_long)
itk_wrap_image_filter_combinations("${ITKM_IT}" "${WRAP_ITK_INT}")
endif()

# Enable casting 64 bit unsigned int to smaller integer types
if(ITK_WRAP_unsigned_long OR NOT ${ITKM_IT} STREQUAL "ULL")
itk_wrap_image_filter_combinations("ULL" "${WRAP_ITK_INT}")
Expand Down