<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hi Mathieu,</DIV>
<DIV> </DIV>
<DIV>I don't use vtkGDCMImageReader. </DIV>
<DIV> </DIV>
<DIV>I'm loading Dicom image (data) into a vtkStructuredPoints as that :</DIV>
<DIV> </DIV>
<DIV> vtkStructuredPoints *dtVtkStrctrdPnts;</DIV>
<DIV> dtVtkStrctrdPnts= vtkStructuredPoints::New();</DIV>
<DIV> dtVtkStrctrdPnts->SetDimensions(WdthVlm,HghtVlm,DpthVlm); </DIV>
<DIV> dtVtkStrctrdPnts->SetScalarType(VTK_SHORT);</DIV>
<DIV> dtVtkStrctrdPnts->AllocateScalars();</DIV>
<DIV> DstBffr=(signed short*) dtVtkStrctrdPnts->GetScalarPointer();</DIV>
<DIV> for (siCptDcm = 0 ; siCptDcm < n ; siCptDcm++)</DIV>
<DIV> {<BR> ......<BR> <BR> memcpy(DstBffr, DICOM->Pixmap, (DICOM->width * DICOM->height * DICOM->BtsAllctd/8));</DIV>
<DIV> }</DIV>
<DIV>Is there a way to detect when I need to load the volume in normal way or inverted (for example from ImagePositionPatient or ImageOrientationPatient)</DIV>
<DIV> </DIV>
<DIV>Thank's<BR>B.wassim<BR><BR>--- En date de : <B>Mar 6.10.09, Mathieu Malaterre <I><mathieu.malaterre@gmail.com></I></B> a écrit :<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>De: Mathieu Malaterre <mathieu.malaterre@gmail.com><BR>Objet: Re: [vtkusers] Up side down MPR's images<BR>À: "Fireman Fireman" <vtkusersneedhelp@yahoo.fr><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><<A href="http://fr.mc246.mail.yahoo.com/mc/compose?to=vtkusersneedhelp@yahoo.fr" ymailto="mailto:vtkusersneedhelp@yahoo.fr">vtkusersneedhelp@yahoo.fr</A>> wrote:<BR>><BR>> Dear vtkusers and developers,<BR>><BR>> I'm using VTK for Multi-Planar Reformation (MPR).<BR>><BR>> I'm loading Dicom image (data) into a vtkStructuredPoints (Image1,Image2,Image3,...ImageN)<BR>><BR>> It works well with some series of images but not always.<BR>><BR>> In fact, sometimes the images are inverted(up side down == rotation 180°).<BR>><BR>> I could solve this problem by reversing the loading(ImageN,ImageN-1,...Image1)<BR>><BR>> I have not found a way to detect when I need to load the volume in normal way or inverted.<BR>><BR>> For now I use a comparison between SliceLocation that does not work in all cases:<BR>><BR>>
if(SliceLocation_ImageN > SliceLocation_ImageN-1)<BR>> I reverse the loading(ImageN,ImageN-1,...Image1)<BR>> else<BR>> (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>