<div dir="ltr">Thanks Mark!<br><br>Is this <br><pre> <font size="4">gdcmReader.SetFileNames(sa);<br><br>the vtkGDCMImageReader?<br><br>Jothy<br></font></pre><br><div class="gmail_quote">On Thu, Mar 3, 2011 at 2:46 PM, Mark Roden <span dir="ltr"><<a href="mailto:mmroden@gmail.com">mmroden@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>
I've solved this in the past by using cascading image flips. The<br>
dicom coordinate system will be modified by this approach, so when you<br>
write the results out, you have to reverse all the flips.<br>
<br>
There are two flips.<br>
<br>
The first flips the image into the right space for rtstructs to<br>
overlay the original image. As I've said in the past, DICOM specifies<br>
the upper left coordinate of each image, while VTK will reorder the<br>
image coordinates based on the orientation vectors. You're not<br>
dealing with rtstructs, and I'm not sure how rtdose reacts (if it<br>
needs the same flipping).<br>
<br>
The second flip is for display purposes, as in, making sure that FFS,<br>
HFS, etc images appear in the proper orientation.<br>
<br>
Here is a previous post from November that contains my reading code in java:<br>
<br>
<a href="http://www.vtk.org/pipermail/vtkusers/2010-November/113127.html" target="_blank">http://www.vtk.org/pipermail/vtkusers/2010-November/113127.html</a><br>
<br>
HTH,<br>
Mark<br>
<div><div></div><div class="h5"><br>
<br>
On Tue, Mar 1, 2011 at 8: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>
</div></div>> ------------------------------------------------------------------------------<br>
> Free Software Download: Index, Search & Analyze Logs and other IT data in<br>
> Real-Time with Splunk. Collect, index and harness all the fast moving IT<br>
> data<br>
> generated by your applications, servers and devices whether physical,<br>
> virtual<br>
> or in the cloud. Deliver compliance at lower cost and gain new business<br>
> insights. <a href="http://p.sf.net/sfu/splunk-dev2dev" target="_blank">http://p.sf.net/sfu/splunk-dev2dev</a><br>
> _______________________________________________<br>
> Gdcm-developers mailing list<br>
> <a href="mailto:Gdcm-developers@lists.sourceforge.net">Gdcm-developers@lists.sourceforge.net</a><br>
> <a href="https://lists.sourceforge.net/lists/listinfo/gdcm-developers" target="_blank">https://lists.sourceforge.net/lists/listinfo/gdcm-developers</a><br>
><br>
><br>
</blockquote></div><br></div>