Hi Alba,<br>I'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->GetLargestPossibleRegion());<br>ConstVectorIteratorType constItVec(vectorImage, vectorImage->GetLargestPossibleRegion());<br><br>for ([the whole region])<br>{<br> VectorImageType::PixelType currentVectorPixel = constItVec.Get();<br>
<br> RGBImageType::PixelType currentRGBPixel;<br> currentRGBPixel->SetBlue(currentVectorPixel[0]); // make sure your vector component type and pixel type match<br> currentRGBPixel->SetGreen(currentVectorPixel[1]); // you will also want to normalize your vector components by the largest in the image. <br>
currentRGBPixel->SetRed(currentVectorPixel[2]);<br> <br> itRGB.Set(currentRGBPixel);<br>}<br><br><br>