<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">&lt;<a href="mailto:mmroden@gmail.com">mmroden@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;">Hi Jothy,<br>
<br>
I&#39;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&#39;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&#39;re not<br>
dealing with rtstructs, and I&#39;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 &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt; Thanks!<br>
&gt;<br>
&gt; Now my images appeasr like the one shown in figure.<br>
&gt;<br>
&gt; I need to rotate the image and dose about the ImagePositionPatient<br>
&gt; upside-down.<br>
&gt;<br>
&gt; I tried vtkImageFlip - it invalidates the dicom coordinate system and the<br>
&gt; dose and image doesn&#39;t match.<br>
&gt;<br>
&gt; I tried this<br>
&gt;<br>
&gt;       vtkMatrix4x4 *invert = vtkMatrix4x4::New();<br>
&gt;<br>
&gt;         invert-&gt;DeepCopy( imageReader-&gt;GetDirectionCosines());<br>
&gt;<br>
&gt;         invert-&gt;Invert();<br>
&gt;<br>
&gt;         vtkImageReslice *reslice = vtkImageReslice::New();<br>
&gt;<br>
&gt;         reslice-&gt;SetResliceAxes( invert );<br>
&gt;<br>
&gt;         reslice-&gt;SetInput(this-&gt;imageData);<br>
&gt;<br>
&gt;         reslice-&gt;Update();<br>
&gt;<br>
&gt;<br>
&gt; But it doesn&#39;t rotate the image.How to rotate the image?<br>
&gt;<br>
&gt; Thanks<br>
&gt;<br>
&gt; Jothy<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Mar 1, 2011 at 4:07 PM, Jothy &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; But in this example FileLowerLeft is switched off.<br>
&gt;&gt;<br>
&gt;&gt; Thanks<br>
&gt;&gt;<br>
&gt;&gt; Jothy<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Mar 1, 2011 at 3:50 PM, Mathieu Malaterre<br>
&gt;&gt; &lt;<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; jothy, I think what you are looking for is already in gdcm, have a look<br>
&gt;&gt;&gt; at:<br>
&gt;&gt;&gt; gdcmreslice.cxx<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; hth<br>
&gt;&gt;&gt; On Tue, Mar 1, 2011 at 4:31 PM, Jothy &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; &gt; Hi all,<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; I am trying to rotate vtkImageData using vtkMatrix4x4 about a point. is<br>
&gt;&gt;&gt; &gt; there any example on how to do this?<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Thanks<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Jothy<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt;&gt; &gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt;&gt; &gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Mathieu<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; ------------------------------------------------------------------------------<br>
&gt; Free Software Download: Index, Search &amp; Analyze Logs and other IT data in<br>
&gt; Real-Time with Splunk. Collect, index and harness all the fast moving IT<br>
&gt; data<br>
&gt; generated by your applications, servers and devices whether physical,<br>
&gt; virtual<br>
&gt; or in the cloud. Deliver compliance at lower cost and gain new business<br>
&gt; insights. <a href="http://p.sf.net/sfu/splunk-dev2dev" target="_blank">http://p.sf.net/sfu/splunk-dev2dev</a><br>
&gt; _______________________________________________<br>
&gt; Gdcm-developers mailing list<br>
&gt; <a href="mailto:Gdcm-developers@lists.sourceforge.net">Gdcm-developers@lists.sourceforge.net</a><br>
&gt; <a href="https://lists.sourceforge.net/lists/listinfo/gdcm-developers" target="_blank">https://lists.sourceforge.net/lists/listinfo/gdcm-developers</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br></div>