[vtkusers] Up side down MPR's images

Fireman Fireman vtkusersneedhelp at yahoo.fr
Tue Oct 6 06:38:28 EDT 2009


Hi Mathieu,
 
I don't use vtkGDCMImageReader. 
 
I'm loading Dicom image (data) into a vtkStructuredPoints as that :
 
    vtkStructuredPoints *dtVtkStrctrdPnts;
    dtVtkStrctrdPnts= vtkStructuredPoints::New();
    dtVtkStrctrdPnts->SetDimensions(WdthVlm,HghtVlm,DpthVlm); 
    dtVtkStrctrdPnts->SetScalarType(VTK_SHORT);
    dtVtkStrctrdPnts->AllocateScalars();
    DstBffr=(signed short*) dtVtkStrctrdPnts->GetScalarPointer();
    for (siCptDcm = 0 ; siCptDcm < n ; siCptDcm++)
    {
      ......
      
      memcpy(DstBffr, DICOM->Pixmap, (DICOM->width * DICOM->height * DICOM->BtsAllctd/8));
    }
Is there  a way to detect when I need to load the volume in normal way or inverted (for example from ImagePositionPatient or ImageOrientationPatient)
 
Thank's
B.wassim

--- En date de : Mar 6.10.09, Mathieu Malaterre <mathieu.malaterre at gmail.com> a écrit :


De: Mathieu Malaterre <mathieu.malaterre at gmail.com>
Objet: Re: [vtkusers] Up side down MPR's images
À: "Fireman Fireman" <vtkusersneedhelp at yahoo.fr>
Cc: vtkusers at vtk.org
Date: Mardi 6 Octobre 2009, 9h36


On Tue, Oct 6, 2009 at 10:30 AM, Fireman Fireman
<vtkusersneedhelp at yahoo.fr> wrote:
>
> Dear vtkusers and developers,
>
> I'm using VTK for Multi-Planar Reformation (MPR).
>
> I'm loading Dicom image (data) into a vtkStructuredPoints (Image1,Image2,Image3,...ImageN)
>
> It works well with some series of images but not always.
>
> In fact, sometimes the images are inverted(up side down == rotation 180°).
>
> I could solve this problem by reversing the loading(ImageN,ImageN-1,...Image1)
>
> I have not found a way to detect when I need to load the volume in normal way or inverted.
>
> For now I use a comparison between SliceLocation that does not work in all cases:
>
>             if(SliceLocation_ImageN > SliceLocation_ImageN-1)
>                            I reverse the loading(ImageN,ImageN-1,...Image1)
>            else
>                          (Image1,Image2,Image3,...ImageN)


If you use vtkGDCMImageReader, simply get the Direction Cosines
(vtkMatrix4x4). See for example use in Devide:

http://code.google.com/p/devide/source/browse/trunk/devide/modules/readers/DICOMReader.py

HTH
--
Mathieu



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091006/528dab02/attachment.htm>


More information about the vtkusers mailing list