From ee63f5eba386ff94ff39578b65fda04e025b28c8 Mon Sep 17 00:00:00 2001 From: Bradley Lowekamp Date: Sat, 14 Dec 2024 19:26:34 -0500 Subject: [PATCH] BUG: Fix 32-bit truncation on VectorImage Accessors Initial bug reported in SimpleITK/SimpleITK#2220. On 64-bit windows system, truncation to 32-bit (unsigned long) was occouring when setting VectorImages with over 4GB buffers. --- Modules/Core/Common/include/itkDefaultVectorPixelAccessor.h | 2 +- Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h | 2 +- .../Core/ImageAdaptors/include/itkVectorImageToImageAdaptor.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Core/Common/include/itkDefaultVectorPixelAccessor.h b/Modules/Core/Common/include/itkDefaultVectorPixelAccessor.h index a255665e92b..a63bb448e70 100644 --- a/Modules/Core/Common/include/itkDefaultVectorPixelAccessor.h +++ b/Modules/Core/Common/include/itkDefaultVectorPixelAccessor.h @@ -63,7 +63,7 @@ class ITK_TEMPLATE_EXPORT DefaultVectorPixelAccessor /** Set output using the value in input */ inline void - Set(InternalType & output, const ExternalType & input, const unsigned long offset) const + Set(InternalType & output, const ExternalType & input, const SizeValueType offset) const { InternalType * truePixel = (&output) + offset * m_OffsetMultiplier; diff --git a/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h b/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h index 9ef242e27f6..1ac2e54224a 100644 --- a/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h +++ b/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h @@ -144,7 +144,7 @@ class NthElementPixelAccessor