<div dir="ltr">Hi Jan,<div><br></div><div>To iterator through an Image or VectorImage, use the Iterators as described in the Software Guide [1]</div><div><br></div><div>HTH,</div><div>Matt</div><div><br></div><div>[1] <a href="http://itk.org/ItkSoftwareGuide.pdf">http://itk.org/ItkSoftwareGuide.pdf</a></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 8:23 AM, Jan Ehrhardt <span dir="ltr"><<a href="mailto:ehrhardt@imi.uni-luebeck.de" target="_blank">ehrhardt@imi.uni-luebeck.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi folks,<br>
<br>
I want to iterate through a vector image without an iterator. My approach was:<br>
<br>
MultiChannelImageType::<u></u>AccessorType accessor = pImage->GetPixelAccessor();<br>
MultiChannelImageType::<u></u>InternalPixelType* pBuffer = pImage->GetBufferPointer();<br>
<br>
for( OffsetValueType i = from; i < to; ++i )<br>
{<br>
vecPixel = accessor.Get(*pBuffer, i);<br>
}<br>
<br>
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::<u></u>Get() correctly.<br>
How can I use the DefaultVectorPixelAccessor correctly?<br>
<br>
best,<br>
jan<div class="HOEnZb"><div class="h5"><br>
<br>
On 03/06/2014 12:25 PM, Jan Ehrhardt wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi folks,<br>
<br>
there is a bug in DefaultVectorPixelAccessor (ITK 4.4.0):<br>
<br>
void SetVectorLength(<u></u>VectorLengthType l)<br>
{<br>
m_VectorLength = l;<br>
m_OffsetMultiplier = ( l - 1 );<br>
}<br>
<br>
DefaultVectorPixelAccessor(<u></u>VectorLengthType l)<br>
{<br>
m_VectorLength = l;<br>
m_OffsetMultiplier = l - 1;<br>
}<br>
<br>
OffsetMultiplier should be m_OffsetMultiplier = l;<br>
<br>
Best regards,<br>
Jan<br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org" target="_blank">Community@itk.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/community" target="_blank">http://public.kitware.com/cgi-<u></u>bin/mailman/listinfo/community</a><br>
</div></div></blockquote></div><br></div>