On 2/5/07, <b class="gmail_sendername">Andre Bongers</b> <<a href="mailto:a.bongers@mediri.com">a.bongers@mediri.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div><font color="#008000">
<p><span><font color="#000000" face="Arial" size="2">Hi,</font></span></p>
<p><span><font color="#000000" face="Arial" size="2">refering
to my last mail: To extract a vector from an 3D image stack I found this filter
in the itk documentation:</font></span></p>
<p><font face="Arial" size="2">itkImageToVectorImageFilter.h</font></p>
<p><span><font face="Arial" size="2">Maybe a good way would
be to convert the 3D image stack to a 2D vector image with this filter and
then access the pixels of the vectorImage and stor them in an
std::vector ?! Could anybody tell me if this idea could work
?</font></span></p></font></div></div></blockquote><div><br>No. The filter is meant to convert k N-Dimensional images to a N-Dimensional itk::VectorImage, where each pixel is an itk::VariableLengthVector of length "k". So it will not serve your purpose.
<br><br>Your best bet is to either write<br>1. Your own filter that does the job for you. It isn't much work. See itk::ExtractImageFilter as an example.<br>2. Or Write your own ImageIterator that acts as a facade, really iterating over a 2D region and returning vector pixels on the stack.
<br><br>I would advise against option (2). Its very tricky. And it would be really slow (since it ends up doing non-contiguous memory access at every pixel)..<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div><font color="#008000"><p><span><font face="Arial" size="2">One problem with the
filter above is: In my folder of ITK version 3.0.1 this header file
does not exist. Where can I find it ?</font></span></p></font></div></div></blockquote><div><br>It was a recent addition. You won't find it in ITK CVS Main branch.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div><font color="#008000"><p><span><font face="Arial" size="2">Would really
appreciate any help!</font></span></p>
<p><span><font face="Arial" size="2">Thanks
</font></span></p>
<p><span><font face="Arial" size="2">Andre</font></span></p></font></div></div>
<br>_______________________________________________<br>Insight-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">
http://www.itk.org/mailman/listinfo/insight-users</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Karthik Krishnan<br>R&D Engineer,<br>Kitware Inc.