[vtkusers] Up side down MPR's images

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Oct 6 05:36:42 EDT 2009


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



More information about the vtkusers mailing list