<div dir="ltr">Some sort of padding befor rotation should help.<br><br>Jothy<br><br><div class="gmail_quote">On Fri, Jul 9, 2010 at 12:32 PM, Srinivasa Rao <span dir="ltr"><<a href="mailto:srinivas@rsageventures.com">srinivas@rsageventures.com</a>></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;">Hi All,<div><br></div><div> I am trying to rotate vtkImageData using vtkTransform and vtkImageReslice, i used following code to do the job.</div>
<div><br></div><div><br></div><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<div>vtkImageData * rotateImage(vtkImageData *data, QPointF center, int angle)</div><div>{</div><div><div> vtkTransform *imageTransform = vtkTransform::New();</div></div><div><div> imageTransform->PostMultiply();</div>
</div><div><div><br></div></div><div><div> imageTransform->Translate(center.x(), center.y(), 0.0);</div></div><div><div> imageTransform->RotateZ(angle);</div></div><div><div> imageTransform->Translate(-center.x(), -center.y(), 0.0);</div>
</div><div><div><br></div></div><div><div> // Now create filter and set previously created transformation</div></div><div><div> vtkImageReslice *algo = vtkImageReslice::New();</div></div><div><div> algo->SetInput(data);</div>
</div><div><div> algo->SetInformationInput(data);</div></div><div><div> algo->SetResliceTransform(imageTransform);</div></div><div><div> algo->SetInterpolationModeToLinear();</div></div><div>
<div> algo->Update();</div></div><div><br></div><div> return algo->GetOutput();</div><div>}</div></blockquote><div><br></div><div>When i try to rotate image data, after rotation the data which is outside the image is getting lost.</div>
<div>Is there a way around to rotate image data without data loss..</div><div><br></div><div>thanks in advance.</div><div><br></div><div>regards,</div><div>srinivas.</div>
<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>
<br></blockquote></div><br></div>