<div dir="ltr">Yes it doesn't rotate at all!<br><br>My axial elements were<br><br>reslice->DeepCopy<span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span>imageReader<span style=" color:#000000;">-></span>GetDirectionCosines<span style=" color:#000000;">());</span><br>
reslice->SetElement(0,3,IPP[0]);<br>reslice->SetElement(1,3,IPP[1]);<br>reslice->SetElement(2,3,IPP[2]);<br><br>My images have<br><br><span style=" color:#c0c0c0;"> </span>Image position: -275 -524 -122.441<br>Image Dims: 512 512 98<br>
Image Origin: -275 -524 -122.441<br>ImageOrient: 1 0 -1.22465e-16 0 1 0<br><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000000;"><br>
<br><br></span></pre><br>But this is changing only the y axis (some translation in Y). But no rotation.<br><br>Any help is greatly appreciated.<br><br>Thanks again<br><br>Jothy<br><br><div class="gmail_quote">On Tue, Mar 1, 2011 at 4:42 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Jothy,<br>
<br>
When you say "doesn't rotate the image", do you mean that it does<br>
nothing at all? What are the elements of your direction cosines matrix?<br>
<br>
Also, note that direction cosines matrix is a pure rotation matrix.<br>
i.e. it rotates about (0,0,0). You need to create a matrix that<br>
rotates around a particular point in space.<br>
<font color="#888888"><br>
- David<br>
</font><div><div></div><div class="h5"><br>
<br>
On Tue, Mar 1, 2011 at 9:28 AM, Jothy <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
> Thanks!<br>
><br>
> Now my images appeasr like the one shown in figure.<br>
><br>
> I need to rotate the image and dose about the ImagePositionPatient<br>
> upside-down.<br>
><br>
> I tried vtkImageFlip - it invalidates the dicom coordinate system and the<br>
> dose and image doesn't match.<br>
><br>
> I tried this<br>
><br>
> vtkMatrix4x4 *invert = vtkMatrix4x4::New();<br>
><br>
> invert->DeepCopy( imageReader->GetDirectionCosines());<br>
><br>
> invert->Invert();<br>
><br>
> vtkImageReslice *reslice = vtkImageReslice::New();<br>
><br>
> reslice->SetResliceAxes( invert );<br>
><br>
> reslice->SetInput(this->imageData);<br>
><br>
> reslice->Update();<br>
><br>
><br>
> But it doesn't rotate the image.How to rotate the image?<br>
><br>
> Thanks<br>
><br>
> Jothy<br>
><br>
><br>
> On Tue, Mar 1, 2011 at 4:07 PM, Jothy <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
>><br>
>> But in this example FileLowerLeft is switched off.<br>
>><br>
>> Thanks<br>
>><br>
>> Jothy<br>
>><br>
>> On Tue, Mar 1, 2011 at 3:50 PM, Mathieu Malaterre<br>
>> <<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>> wrote:<br>
>>><br>
>>> jothy, I think what you are looking for is already in gdcm, have a look<br>
>>> at:<br>
>>> gdcmreslice.cxx<br>
>>><br>
>>> hth<br>
>>> On Tue, Mar 1, 2011 at 4:31 PM, Jothy <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
>>> > Hi all,<br>
>>> ><br>
>>> > I am trying to rotate vtkImageData using vtkMatrix4x4 about a point. is<br>
>>> > there any example on how to do this?<br>
>>> ><br>
>>> > Thanks<br>
>>> ><br>
>>> > Jothy<br>
>>> ><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<br>
>>> > <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:<br>
>>> > <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>
>>> ><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Mathieu<br>
>><br>
><br>
><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<br>
> <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:<br>
> <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>
><br>
</div></div></blockquote></div><br></div>