diff --git a/Modules/Core/Common/wrapping/itkImageSource.wrap b/Modules/Core/Common/wrapping/itkImageSource.wrap index c7524604157..effcfb676ff 100644 --- a/Modules/Core/Common/wrapping/itkImageSource.wrap +++ b/Modules/Core/Common/wrapping/itkImageSource.wrap @@ -1,6 +1,6 @@ itk_wrap_class("itk::ImageSource" POINTER) # Force uchar and ulong image sources for saving in 8 bits and watershed filter - UNIQUE(image_types "UC;RGBUC;RGBAUC;UL;${ITKM_IT};${WRAP_ITK_ALL_TYPES}") + UNIQUE(image_types "UC;RGBUC;RGBAUC;UL;ULL;${ITKM_IT};${WRAP_ITK_ALL_TYPES}") itk_wrap_image_filter("${image_types}" 1) UNIQUE(to_types "${WRAP_ITK_SCALAR};UC") diff --git a/Modules/Core/Common/wrapping/itkImageToImageFilterA.wrap b/Modules/Core/Common/wrapping/itkImageToImageFilterA.wrap index 9964a5769c7..466215bdb38 100644 --- a/Modules/Core/Common/wrapping/itkImageToImageFilterA.wrap +++ b/Modules/Core/Common/wrapping/itkImageToImageFilterA.wrap @@ -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;${WRAP_ITK_SCALAR}") + UNIQUE(from_types "UC;ULL;${WRAP_ITK_SCALAR}") UNIQUE(to_types "UC;UL;${ITKM_IT};${WRAP_ITK_SCALAR}") itk_wrap_image_filter_combinations("${from_types}" "${to_types}") diff --git a/Modules/Core/Common/wrapping/itkNumericTraits.wrap b/Modules/Core/Common/wrapping/itkNumericTraits.wrap index f8b1ac88c1b..9e758c85bfc 100644 --- a/Modules/Core/Common/wrapping/itkNumericTraits.wrap +++ b/Modules/Core/Common/wrapping/itkNumericTraits.wrap @@ -18,7 +18,7 @@ endif() # the superclass itk_wrap_class(std::numeric_limits EXPLICIT_SPECIALIZATION) # the basic types - foreach(t UC US UI UL SC SS SI SL F D LD B) + foreach(t UC US UI UL ULL SC SS SI SL F D LD B) itk_wrap_template("${ITKM_${t}}" "${ITKT_${t}}") endforeach() itk_end_wrap_class() @@ -26,7 +26,7 @@ itk_end_wrap_class() itk_wrap_class("itk::NumericTraits" EXPLICIT_SPECIALIZATION) # the basic types - foreach(t UC US UI UL SC SS SI SL F D LD B) + foreach(t UC US UI UL ULL SC SS SI SL F D LD B) itk_wrap_template("${ITKM_${t}}" "${ITKT_${t}}") endforeach() diff --git a/Modules/Filtering/ImageFilterBase/wrapping/itkCastImageFilter.wrap b/Modules/Filtering/ImageFilterBase/wrapping/itkCastImageFilter.wrap index 753edfa0528..6641c8c98cd 100644 --- a/Modules/Filtering/ImageFilterBase/wrapping/itkCastImageFilter.wrap +++ b/Modules/Filtering/ImageFilterBase/wrapping/itkCastImageFilter.wrap @@ -20,4 +20,9 @@ itk_wrap_class("itk::CastImageFilter" POINTER_WITH_SUPERCLASS) 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}") + endif() itk_end_wrap_class() diff --git a/Modules/IO/ImageBase/wrapping/itkImageFileReader.wrap b/Modules/IO/ImageBase/wrapping/itkImageFileReader.wrap index af27ffe16a6..70acd464046 100644 --- a/Modules/IO/ImageBase/wrapping/itkImageFileReader.wrap +++ b/Modules/IO/ImageBase/wrapping/itkImageFileReader.wrap @@ -1,6 +1,6 @@ itk_wrap_class("itk::ImageFileReader" POINTER) # Force uchar image IO - UNIQUE(image_types "UC;${WRAP_ITK_ALL_TYPES}") + UNIQUE(image_types "ULL;UC;${WRAP_ITK_ALL_TYPES}") itk_wrap_image_filter("${image_types}" 1) UNIQUE(to_types "${WRAP_ITK_SCALAR};UC") diff --git a/Modules/IO/ImageBase/wrapping/itkImageFileWriter.wrap b/Modules/IO/ImageBase/wrapping/itkImageFileWriter.wrap index 26f83a4e4ee..1e5776f6fae 100644 --- a/Modules/IO/ImageBase/wrapping/itkImageFileWriter.wrap +++ b/Modules/IO/ImageBase/wrapping/itkImageFileWriter.wrap @@ -1,6 +1,6 @@ itk_wrap_class("itk::ImageFileWriter" POINTER) # Force uchar image IO - UNIQUE(image_types "UC;RGBUC;${WRAP_ITK_ALL_TYPES}") + UNIQUE(image_types "ULL;UC;RGBUC;${WRAP_ITK_ALL_TYPES}") itk_wrap_image_filter("${image_types}" 1) UNIQUE(to_types "${WRAP_ITK_SCALAR};UC") diff --git a/Wrapping/Generators/Python/Tests/PythonTemplateTest.py b/Wrapping/Generators/Python/Tests/PythonTemplateTest.py index 4fc1857222b..616ee17e68c 100644 --- a/Wrapping/Generators/Python/Tests/PythonTemplateTest.py +++ b/Wrapping/Generators/Python/Tests/PythonTemplateTest.py @@ -212,7 +212,7 @@ def pixel_type_from_IO(pixel, component, dimension): dimensions = [2, 3] component_type_dic= {"float":itk.F, "double":itk.D, "unsigned_char":itk.UC, "unsigned_short":itk.US, "unsigned_int":itk.UI, - "unsigned_long":itk.UL, "char":itk.SC, "short":itk.SS, + "unsigned_long":itk.UL, "unsigned_long_long":itk.ULL, "char":itk.SC, "short":itk.SS, "int":itk.SI, "long":itk.SL, "bool":itk.B} pixel_types = ['scalar', 'rgb', 'rgba', 'offset', 'vector', 'point', 'covariant_vector', 'symmetric_second_rank_tensor',