[ITK Community] Bug in DefaultVectorPixelAccessor

Matt McCormick matt.mccormick at kitware.com
Tue Mar 11 01:12:45 EDT 2014


Hi Jan,

To iterator through an Image or VectorImage, use the Iterators as described
in the Software Guide [1]

HTH,
Matt

[1] http://itk.org/ItkSoftwareGuide.pdf


On Thu, Mar 6, 2014 at 8:23 AM, Jan Ehrhardt <ehrhardt at imi.uni-luebeck.de>wrote:

> 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
>>
>>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140311/eee89aa6/attachment-0002.html>


More information about the Community mailing list