[vtkusers] vtkImageFlip ?

Sean McInerney seanm at nmr.mgh.harvard.edu
Tue Sep 28 16:31:02 EDT 2004


Pallavi,

  If you use vtkImageReader, you can use the SetTransform method to
permute the incoming data (i.e. swap and/or invert axes). In your
particular case, the following matrix should reverse the Z ordering:

  1  0  0  0
  0  1  0  0
  0  0 -1  0
  0  0  0  1

-Sean

ALIZIER Julien AUSY wrote:
> Hi Pallavi,
> 
> I saw somewhere (but I can't remember exactly) that you could specify a
> negative Z size or spacing for your 3D image before loading it. 
> It will then be flipped.
> 
> I think it is vtkImageReader2::SetDataSpacing(...) or maybe
> vtkImageReader2::SetDataExtent(...).
> 
> 
> HTH
> 
> -- Julien
> 
> 
> 
> 
> -----Message d'origine-----
> De : Pallavi Joshi [mailto:pallavi.joshi at vanderbilt.edu]
> Envoyé : lundi 27 septembre 2004 22:50
> à : vtkusers at vtk.org
> Objet : [vtkusers] vtkImageFlip ?
> 
> 
> Hi,
> My 3D image volume has its Z slice numbers increasing in one direction while
> VTK has it in the other direction. i.e. the slice number in my viewer =
> 255-slice no. in VTK. I wish to flip this image. How can I do that so that
> the image is displayed exactly the same way in the window but just the Z
> slice numbers are flipped ? Is vtkImageFlip the right function for it ?
> 
> Please reply,
> --Pallavi
> 
> ------------------------------------------------------------------
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 




More information about the vtkusers mailing list