Hi alba,<br>What&#39;s the error?<br><br>Seth<br><br><div class="gmail_quote">On Mon, Feb 14, 2011 at 3:09 AM, alba garin <span dir="ltr">&lt;<a href="mailto:albagarin1986@hotmail.com">albagarin1986@hotmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



<div>
Hi again,<div><br></div><div>the problem is that i got an error at doing itRGB.Set(rgbPixel).</div><div>why is that happening?</div><div>Thanks,</div><div><br><div>
<p align="center"><font color="#000000"><img src="" height="2" vspace="9" width="100%"></font></p></div><br><br><br><br><hr>From: <a href="mailto:albagarin1986@hotmail.com" target="_blank">albagarin1986@hotmail.com</a><br>

To: <a href="mailto:seth@mech.ubc.ca" target="_blank">seth@mech.ubc.ca</a>; <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>Date: Mon, 14 Feb 2011 07:52:29 +0000<br>Subject: Re: [Insight-users] map the colours from the eigenvector<div class="im">

<br><br>






<br><div>Thanks, I needed to save each component in RGB pixels so your pseudo code is useful. </div><div><br>
<p align="center"><font color="#000000"><img src="" height="2" vspace="9" width="100%"></font></p></div><br><br><br><br><hr>From: <a href="mailto:seth@mech.ubc.ca" target="_blank">seth@mech.ubc.ca</a><br>Date: Fri, 11 Feb 2011 13:25:25 -0800<br>

Subject: [Insight-users] map the colours from the eigenvector<br>To: <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>; <a href="mailto:albagarin1986@hotmail.com" target="_blank">albagarin1986@hotmail.com</a><br>

<br></div><div><div></div><div class="h5">Hi Alba,<br>I&#39;m not sure if I understand, is it the magnitude that you want mapped or the direction?  You can use ParaView to create visualizations of both from an image of vectors, and that my be the best way to go.  ParaView makes some very pretty pictures!<br>



<br>If you want to save each component of the vector to the components of an RGB pixel, you could use iterators to move through the image and save each component of the eigenvector to an RGB pixel as in the following pseudo code (more details in the Software Guide, page 738 on).<br>



<br>RBGIteratorType itRGB(rbgImage, vectorImage-&gt;GetLargestPossibleRegion());<br>ConstVectorIteratorType constItVec(vectorImage, vectorImage-&gt;GetLargestPossibleRegion());<br><br>for ([the whole region])<br>{<br>   VectorImageType::PixelType currentVectorPixel = constItVec.Get();<br>



   <br>   RGBImageType::PixelType currentRGBPixel;<br>   currentRGBPixel-&gt;SetBlue(currentVectorPixel[0]); // make sure your vector component type and pixel type match<br>   currentRGBPixel-&gt;SetGreen(currentVectorPixel[1]);  // you will also want to normalize your vector components by the largest in the image. <br>



   currentRGBPixel-&gt;SetRed(currentVectorPixel[2]);<br>   <br>   itRGB.Set(currentRGBPixel);<br>}<br><br><br>                                               
<br></div></div>_____________________________________
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>

Visit other Kitware open-source projects at
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a>

Kitware offers ITK Training Courses, for more information visit:
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a>

Please keep messages on-topic and check the ITK FAQ at:
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a></div>                                               </div>

</blockquote></div><br>