[Insight-users] problem with vtkActor2D: Image Upside-Down

Karthik Krishnan karthik.krishnan at kitware.com
Tue Apr 3 11:53:49 EDT 2007


Luca:

Please read the thread:
   http://public.kitware.com/pipermail/insight-users/2005-April/012724.html

ITK's first byte on disk is origin as with medical images. With VTK, the
first byte of the last row on disk is the first byte on memory.
In effect, the y axis is flipped taking images from ITK <--> VTK.
(The difference between the computer graphics and the medical co-ordinate
systems)

There are multiple ways of getting around this. You can use vtkImageFlip to
flip your image, Or use vtkCamera::SetUserTransform with scale values of (1,
-1, 1). I'd recommend actually flipping the image, so that querying pixel
positions with GetScalarPointer(x,y,z) in ITK and VTK return the same
values. Or you might shoot yourself in the foot accidentally.

--
karthik

On 4/3/07, Luca Tersi <lucatersi at gmail.com> wrote:
>
> Hi,
> I'm trying to build an FLTK application to register a 2D fluoroscopic
> DICOM image (.dcm) with a CT 3D cad model of a joint. The image should be in
> the background, and the user should be able to move the CAD with arrows or
> mouse. I'm at the beginning and at the moment I'm just reading the image
> with ITK and showing it using vtkImageMapper, vtkActor2D and
> vtkFlRenderWindowInteractor. Unfortunately the image appears upside-down and
> to dark. Do you know why? I tryed also to use vtkImageActor: the color is
> ok, but the image is still upside down and it rotates with the camera (I
> don't want this!! only the CAD model will have to rotate..).
> Thanks
> Luca
>
> --
> Luca Tersi
> Biomedical Engineer
> --------------------------------------
> Phone: +39 349 8492262
> E-Mail :
> lucatersi at gmail.com
> luca.tersi at studio.unibo.it
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070403/5f855084/attachment.html


More information about the Insight-users mailing list