<html><head><base href="x-msg://46/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello Alba,<div><br></div><div>I have never used ITK with VTK, so I don't know if there is a different way to convert your ImageData so the three components will end up as a vector automatically, but you should be able to use the vtkArrayCalculator to create a new vector out of the three components. There is one wiki example here:</div><div><br></div><div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ArrayCalculator">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ArrayCalculator</a></div><div><br></div><div>And the documentation page</div><div><br></div><div><a href="http://www.vtk.org/doc/nightly/html/classvtkArrayCalculator.html">http://www.vtk.org/doc/nightly/html/classvtkArrayCalculator.html</a></div><div><br></div><div>has more info about the functions and links to more examples and tests. You'll need to do something like red*iHat + green*jHat + blue*kHat as your equation. Personally, I would first try loading my data into ParaView to play with equations and visualization methods. (You may have to write out your vtkImageData to a vtk or vti file first to load it into ParaView...)</div><div><br></div><div>Sorry I don't have time to give you a more clear example right now, but hopefully this can get you started on a useful path.</div><div><br></div><div>-Eric</div><div><br></div><div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·</div><div>Eric E Monson</div><div>Duke Visualization Technology Group</div><div><br></div></div></span></span></div><div><br class="webkit-block-placeholder"></div><div><div>On Sep 20, 2011, at 10:12 AM, Garin, Alba wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="ES" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 10.5pt; font-family: Consolas; "><span lang="EN-US">Good morning,<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 10.5pt; font-family: Consolas; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 10.5pt; font-family: Consolas; "><span lang="EN-US">i am trying to visualize glyphs with vtk and itk that represent the main diffusion direction of my dicom images. I read the dicoms and i get an oriented image with Vectors of unsigned short as pixel type. I can visualize properly this information in color maps representing the orientation of each voxel with RGB.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 10.5pt; font-family: Consolas; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 10.5pt; font-family: Consolas; "><span lang="EN-US">The problem starts when i want to represent the directionality with lines, glyphs or others. I figured out why i have this problem and i know i need a vector per voxel in the vtkImageData that i use as input in the (for example) vtkStreamLine class. The thing is that i convert itk::OrientedImage to vtkImageData with the itkImageToVTKImageFilter, and i get an vtkImageData as output with scalars in each voxel, 3 scalars per voxel (an array) instead of a vector of 3 component in each voxel.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 10.5pt; font-family: Consolas; "><span lang="EN-US"> <o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 10.5pt; font-family: Consolas; "><span lang="EN-US">Is there any way to set the filter to convert into an image of vector instead of image of arrays?<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 10.5pt; font-family: Consolas; "><span lang="EN-US">Can i convert my vtkImageData of arrays to an vtkImageData of vectors?<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 10.5pt; font-family: Consolas; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 10.5pt; font-family: Consolas; ">Thanks in advance,<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 10.5pt; font-family: Consolas; ">Alba<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="60%" style="width: 291px; border-collapse: collapse; "><tbody><tr><td width="260" valign="top" style="width: 195pt; padding-top: 3.75pt; padding-right: 0cm; padding-bottom: 0cm; padding-left: 3.75pt; "><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width: 59px; "><tbody><tr><td style="padding-top: 0cm; padding-right: 0cm; padding-bottom: 0cm; padding-left: 0cm; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><b><span style="font-size: 8pt; font-family: Tahoma, sans-serif; ">Alba Garin Muga</span></b><span style="font-size: 12pt; "><o:p></o:p></span></div></td></tr><tr><td style="padding-top: 0cm; padding-right: 0cm; padding-bottom: 0cm; padding-left: 0cm; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Tahoma, sans-serif; ">Computer Science PhD Student</span><span style="font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p></o:p></span></div></td></tr><tr><td style="padding-top: 0cm; padding-right: 0cm; padding-bottom: 0cm; padding-left: 0cm; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Tahoma, sans-serif; ">Applied Mechanics Department</span><span style="font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p></o:p></span></div></td></tr><tr><td style="padding-top: 0cm; padding-right: 0cm; padding-bottom: 0cm; padding-left: 0cm; "><p class="MsoNormal" style="margin-top: 6pt; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Tahoma, sans-serif; ">Paseo Manuel Lardizabal, 15<br>20018 Donostia-San Sebastian.</span><span lang="EN-US" style="font-size: 8pt; font-family: Tahoma, sans-serif; ">Spain<br>Tel. +34 943 212 800 (Ext. 2111)<br>Fax: +34 943 213 076<br>Web:</span><span style="font-size: 12pt; font-family: 'Times New Roman', serif; "><a href="http://www.ceit.es/" style="color: blue; text-decoration: underline; "><span lang="EN-US" style="font-size: 8pt; font-family: Tahoma, sans-serif; color: blue; ">www.ceit.es</span></a></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p></o:p></span></p></td></tr></tbody></table></td><td width="659" valign="top" style="width: 494.25pt; padding-top: 0cm; padding-right: 0cm; padding-bottom: 0cm; padding-left: 0cm; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Tahoma, sans-serif; "><span><image001.gif></span></span><span style="font-size: 12pt; "><o:p></o:p></span></div></td></tr><tr><td colspan="2" valign="top" style="padding-top: 3.75pt; padding-right: 0cm; padding-bottom: 0cm; padding-left: 3.75pt; "><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width: 286px; "><tbody><tr><td width="4%" valign="top" style="width: 31px; padding-top: 0cm; padding-right: 0cm; padding-bottom: 0cm; padding-left: 0cm; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span><image002.jpg></span><span style="font-size: 12pt; "><o:p></o:p></span></div></td><td width="96%" style="width: 255px; padding-top: 0cm; padding-right: 0cm; padding-bottom: 0cm; padding-left: 0cm; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Tahoma, sans-serif; color: rgb(0, 153, 0); ">Antes de imprimir este e-mail piense bien si es necesario hacerlo.<span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 8pt; font-family: Tahoma, sans-serif; color: rgb(0, 153, 0); ">El medioambiente es cosa de todos.<br>Before printing this e-mail ask yourself if you really need a hard copy.<span class="Apple-converted-space"> </span></span><span style="font-size: 8pt; font-family: Tahoma, sans-serif; color: rgb(0, 153, 0); ">We are all responsible for the environment.</span><span style="font-size: 12pt; "><o:p></o:p></span></div></td></tr></tbody></table></td></tr></tbody></table><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div>_______________________________________________<br>Powered by<span class="Apple-converted-space"> </span><a href="http://www.kitware.com" style="color: blue; text-decoration: underline; ">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<a href="http://www.kitware.com/opensource/opensource.html" style="color: blue; text-decoration: underline; ">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at:<a href="http://www.vtk.org/Wiki/VTK_FAQ" style="color: blue; text-decoration: underline; ">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" style="color: blue; text-decoration: underline; ">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></div></blockquote></div><br></div></body></html>