Wes,<br><br>The problem is that I need the overall velocity as a single vector, not the components. I think I still need the calculator to sum the three components to give the velocity. How would I do that?<br><br>Thanks,<br>
<br>Adam<br><br><div class="gmail_quote">On Fri, Jul 31, 2009 at 3:58 PM, Wes Turner <span dir="ltr">&lt;<a href="mailto:wes.turner@kitware.com">wes.turner@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If you are just trying to get an image with three components corresponding to the x, y, and z, then that is what you should have as the output of the append filter.  The data at that point is not stored in separate x, y, and z vectors, but is instead a single multicomponent image.  You should have no need of the image calculator at that point.<div>

<br></div><div><font color="#888888">- Wes</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Fri, Jul 31, 2009 at 3:24 PM, Adam Wiktor <span dir="ltr">&lt;<a href="mailto:awiktor@emory.edu" target="_blank">awiktor@emory.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yes, I tried both that and AppendFilter, but I&#39;m still having problems. I may not be using the append correctly, but the calculator is only recognizing one of the three components, and I get this error message (it&#39;s the same for both ImageAppendComponents and AppendFilter):<br>


<br>ERROR: In /home/awiktor/Desktop/VTK/Graphics/vtkArrayCalculator.cxx, line 338<br>vtkArrayCalculator (0x763d70): Invalid array name: y<br><br>I get the same message except with &quot;Invalid array name: z&quot; if I remove all references to y, so I think this means that the calculator isn&#39;t seeing the &#39;y&#39; and &#39;z&#39; variables. <br>


<br>Here&#39;s the part of the code that isn&#39;t working:<br><br>append=vtk.vtkImageAppendComponents()<br>append.AddInput(xcalc.GetOutput())<br>append.AddInput(ycalc.GetOutput())<br>append.AddInput(zcalc.GetOutput())<br>


append.Update()<br><br>velcalc = vtk.vtkArrayCalculator()<br>velcalc.SetInput(append.GetOutput())<br>velcalc.AddVectorArrayName(&quot;x&quot;, 0, 1, 2)<br>velcalc.AddVectorArrayName(&quot;y&quot;, 0, 1, 2)<br>velcalc.AddVectorArrayName(&quot;z&quot;, 0, 1, 2)<br>


velcalc.SetResultArrayName(&quot;Velocity&quot;)<br>velcalc.SetFunction(&quot;x+y+z&quot;)<br>velcalc.Update()<br><br>Any idea what the problem is?<br><br>Thanks,<br><font color="#888888"><br>Adam</font><div><div></div><div>

<br><br><div class="gmail_quote">On Fri, Jul 31, 2009 at 12:54 PM, Wes Turner <span dir="ltr">&lt;<a href="mailto:wes.turner@kitware.com" target="_blank">wes.turner@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Did you try ImageAppendComponents?<div><br></div><div><a href="http://www.vtk.org/doc/nightly/html/classvtkImageAppendComponents.html" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkImageAppendComponents.html</a></div>


<div><br>
</div><div><a href="http://www.vtk.org/doc/nightly/html/classvtkImageAppendComponents.html" target="_blank"></a>- Wes<br><br><div class="gmail_quote"><div><div></div><div>On Fri, Jul 31, 2009 at 12:16 PM, Adam Wiktor <span dir="ltr">&lt;<a href="mailto:awiktor@emory.edu" target="_blank">awiktor@emory.edu</a>&gt;</span> wrote:<br>



</div></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></div><div>Hi All,<br><br>I am fairly new to VTK, so please bear with me. I&#39;m
trying to visualize blood flow in the aorta from MRI scans. The
velocity data is stored in three separate vti images, for the x-, y-
and z- components. Each image has a scalar variable &#39;DICOMImage&#39; which
is the speed in that direction. I need to combine the components into
the overall velocity, which I will then import into paraview to add
streamlines and other things. <br>
<br>My original thought was to use the vtkArrayCalculator to multiply
each image by the unit vector (for the x component, for example, it
would be DICOMImage*iHat). I would then need to combine these vectors
into the velocity with another calculator, just doing x+y+z. I might be
able to simplify this by just using one calculator that did x*iHat
+ y*jHat + z*kHat, but I don&#39;t know how to change the variable names
from DICOMImage to x, y, and z so that the calculator can distinguish
between them.<br>
<br>First of all, I&#39;d like to know if there&#39;s an easier way of doing this.<br><br>If
there isn&#39;t a more straight-forward way, then the main thing I need to
figure out is how to get the final calculator to use the three
different inputs. What would be the best way to do that? <br>
<br>Thanks for any help you can give!<br><font color="#888888"><font color="#888888"><br>- Adam</font>
</font><br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
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><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">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" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>R&amp;D Engineer<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-371-3971 x120<br>
</div>
</blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>R&amp;D Engineer<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-371-3971 x120<br>
</div></div></div>
</blockquote></div><br>