<div dir="ltr">Use vtkImageReslice to rotate vtkImageData<br><br>This should help you going (though messy)<br><br> //convert angle from degree to radian<br>    double angleInRads=vtkMath::RadiansFromDegrees(angle);<br>    double cosAngle=cos(angleInRads);<br>
    double sinAngle =sin(angleInRads);<br>    qDebug()&lt;&lt;&quot;cos &amp; sin:&quot;&lt;&lt;cosAngle&lt;&lt;sinAngle;<br><br>    static double axialElements[16] = {<br>        1, 0, 0, 0,                                         //1,0,0,0<br>
        0,cosAngle,-sinAngle, 0,            //0,-1,0,0<br>        0, sinAngle,cosAngle, 0,            //0,0,-1,0<br>        0, 0, 0, 1 };                                     //0,0,0,1<br><br><br>   // Set the slice orientation<br>
     vtkSmartPointer&lt;vtkMatrix4x4&gt; resliceAxes =<br>       vtkSmartPointer&lt;vtkMatrix4x4&gt;::New();<br>     resliceAxes-&gt;DeepCopy(axialElements);<br>     // Set the point through which to slice<br>     resliceAxes-&gt;SetElement(0, 3,0);<br>
     resliceAxes-&gt;SetElement(1, 3,0);<br>     resliceAxes-&gt;SetElement(2, 3,0);<br><br><br>    vtkSmartPointer&lt;vtkImageReslice&gt; res=<br>            vtkSmartPointer&lt;vtkImageReslice&gt;::New();<br>    res-&gt;SetInput( imgData);<br>
    res-&gt;SetInformationInput( imgData);<br>    res-&gt;SetResliceAxes(resliceAxes);<br>    res-&gt;SetInterpolationModeToLinear();<br>    res-&gt;Update();<br>    this-&gt;rotatedImageData=res-&gt;GetOutput();<br><br><br>
Jothy<br><br><div class="gmail_quote">On Fri, Jun 29, 2012 at 3:48 PM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Fri, Jun 29, 2012 at 10:45 AM, Jonathan Ruiz Peinado<br>
&lt;<a href="mailto:jonathan.ruiz3@gmail.com">jonathan.ruiz3@gmail.com</a>&gt; wrote:<br>
&gt; Hi, I need to apply some transformations to a vtkImageData, I though that I<br>
&gt; could use vtkTransform or vtkTransformFilter to setup  the trasnformation<br>
&gt; put my imageData as input and get the result as the output of<br>
&gt; vtkTransformFilter, but it&#39;s seems not that easy, there&#39;s some example about<br>
&gt; it around or something I&#39;m missing.<br>
&gt;<br>
&gt; Thanks.<br>
<br>
</div></div>Can you tell us what isn&#39;t working? Compiler errors? Incorrect<br>
results? Also please show the code you are using in a very simple<br>
example case.<br>
<br>
David<br>
_______________________________________________<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>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothybasu Selvaraj<br>PhD Student<br>University of Liverpool<br>UK<br></div><br>
</div>