[ITK Community] Bug in DefaultVectorPixelAccessor
Jan Ehrhardt
ehrhardt at imi.uni-luebeck.de
Thu Mar 6 08:23:17 EST 2014
Hi folks,
I want to iterate through a vector image without an iterator. My
approach was:
MultiChannelImageType::AccessorType accessor =
pImage->GetPixelAccessor();
MultiChannelImageType::InternalPixelType* pBuffer =
pImage->GetBufferPointer();
for( OffsetValueType i = from; i < to; ++i )
{
vecPixel = accessor.Get(*pBuffer, i);
}
but the results are not correct (see bug(?) below). If the bug(?) in
DefaultVectorPixelAccessor is corrected ( m_OffsetMultiplier = l ) the
behaviour of standard itk iterators change. I assume, I don't understand
the parameters of DefaultVectorPixelAccessor::Get() correctly.
How can I use the DefaultVectorPixelAccessor correctly?
best,
jan
On 03/06/2014 12:25 PM, Jan Ehrhardt wrote:
> Hi folks,
>
> there is a bug in DefaultVectorPixelAccessor (ITK 4.4.0):
>
> void SetVectorLength(VectorLengthType l)
> {
> m_VectorLength = l;
> m_OffsetMultiplier = ( l - 1 );
> }
>
> DefaultVectorPixelAccessor(VectorLengthType l)
> {
> m_VectorLength = l;
> m_OffsetMultiplier = l - 1;
> }
>
> OffsetMultiplier should be m_OffsetMultiplier = l;
>
> Best regards,
> Jan
>
More information about the Community
mailing list