Skip to content

Commit

Permalink
BUG: Fix 32-bit truncation on VectorImage Accessors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
blowekamp committed Dec 15, 2024
1 parent 9d4f1ab commit ee63f5e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class NthElementPixelAccessor<TOutputPixelType, itk::VariableLengthVector<TPixel
}

inline void
Set(InternalType & output, const ExternalType & input, const unsigned long offset) const
Set(InternalType & output, const ExternalType & input, const SizeValueType offset) const
{
// note: v is a reference to the internal buffer, this method of
// access relies on return value optimization to work
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class VectorImageToImagePixelAccessor : private DefaultVectorPixelAccessor<TType
}

inline void
Set(InternalType & output, const ExternalType & input, const unsigned long offset) const
Set(InternalType & output, const ExternalType & input, const SizeValueType offset) const
{
return Set(Superclass::Get(output, offset), input);
}
Expand Down

0 comments on commit ee63f5e

Please sign in to comment.