<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hi Mathieu,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I don't use vtkGDCMImageReader. </DIV>
<DIV>&nbsp;</DIV>
<DIV>I'm loading Dicom image (data) into a vtkStructuredPoints as that :</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkStructuredPoints *dtVtkStrctrdPnts;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; dtVtkStrctrdPnts= vtkStructuredPoints::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; dtVtkStrctrdPnts-&gt;SetDimensions(WdthVlm,HghtVlm,DpthVlm); </DIV>
<DIV>&nbsp;&nbsp;&nbsp; dtVtkStrctrdPnts-&gt;SetScalarType(VTK_SHORT);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; dtVtkStrctrdPnts-&gt;AllocateScalars();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; DstBffr=(signed short*) dtVtkStrctrdPnts-&gt;GetScalarPointer();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; for (siCptDcm = 0 ; siCptDcm &lt; n ; siCptDcm++)</DIV>
<DIV>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ......<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memcpy(DstBffr, DICOM-&gt;Pixmap, (DICOM-&gt;width * DICOM-&gt;height * DICOM-&gt;BtsAllctd/8));</DIV>
<DIV>&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>Is there&nbsp; a way to detect when I need to load the volume in normal way or inverted (for example from ImagePositionPatient or ImageOrientationPatient)</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thank's<BR>B.wassim<BR><BR>--- En date de&nbsp;: <B>Mar 6.10.09, Mathieu Malaterre <I>&lt;mathieu.malaterre@gmail.com&gt;</I></B> a écrit&nbsp;:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>De: Mathieu Malaterre &lt;mathieu.malaterre@gmail.com&gt;<BR>Objet: Re: [vtkusers] Up side down MPR's images<BR>À: "Fireman Fireman" &lt;vtkusersneedhelp@yahoo.fr&gt;<BR>Cc: vtkusers@vtk.org<BR>Date: Mardi 6 Octobre 2009, 9h36<BR><BR>
<DIV class=plainMail>On Tue, Oct 6, 2009 at 10:30 AM, Fireman Fireman<BR>&lt;<A href="http://fr.mc246.mail.yahoo.com/mc/compose?to=vtkusersneedhelp@yahoo.fr" ymailto="mailto:vtkusersneedhelp@yahoo.fr">vtkusersneedhelp@yahoo.fr</A>&gt; wrote:<BR>&gt;<BR>&gt; Dear vtkusers and developers,<BR>&gt;<BR>&gt; I'm using VTK for Multi-Planar Reformation (MPR).<BR>&gt;<BR>&gt; I'm loading Dicom image (data) into a vtkStructuredPoints (Image1,Image2,Image3,...ImageN)<BR>&gt;<BR>&gt; It works well with some series of images but not always.<BR>&gt;<BR>&gt; In fact, sometimes the images are inverted(up side down == rotation 180°).<BR>&gt;<BR>&gt; I could solve this problem by reversing the loading(ImageN,ImageN-1,...Image1)<BR>&gt;<BR>&gt; I have not found a way to detect when I need to load the volume in normal way or inverted.<BR>&gt;<BR>&gt; For now I use a comparison between SliceLocation that does not work in all cases:<BR>&gt;<BR>&gt;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(SliceLocation_ImageN &gt; SliceLocation_ImageN-1)<BR>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I reverse the loading(ImageN,ImageN-1,...Image1)<BR>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;(Image1,Image2,Image3,...ImageN)<BR><BR><BR>If you use vtkGDCMImageReader, simply get the Direction Cosines<BR>(vtkMatrix4x4). See for example use in Devide:<BR><BR><A href="http://code.google.com/p/devide/source/browse/trunk/devide/modules/readers/DICOMReader.py"
 target=_blank>http://code.google.com/p/devide/source/browse/trunk/devide/modules/readers/DICOMReader.py</A><BR><BR>HTH<BR>--<BR>Mathieu<BR></DIV></BLOCKQUOTE></td></tr></table><br>