[Insight-users] how to change the coordinate origin of itk image

Luis Ibanez luis.ibanez at kitware.com
Sun Nov 11 17:21:54 EST 2007


Hi Orientation f,

You may want to look at the code of IGSTK,
the Image Guided Surgery Toolkit.

                 www.igstk.org

IGSTK is built on top of ITK and VTK.



In particular,
you should look at the code of the classes:

         igstkView
         igstkImageSpatialObjectRepresentation


You will see there how to manage the vtkCamera position
in order to get the appropriate view of the image.





    Regards,


        Luis


---------------------
orientation f wrote:
> Hello,
> The images that I want to segment is 2-D CT slices. Will you please give 
> me some simple codes to set VTK camera corresponding ITK coordinate with 
> VTK coordinate?
> My program is as following format:
> ....
> ITK code
> ....
> typedef itk::ImageToVTKImageFilter<InternalImageType> ConnectorType
> ConnectorType::Pointer connector = ConnectorType::New();
> connector->SetInput(reader->GetOutput());
>  
> vtkImageViewer  *viewer = vtkImageViewer::New();
>  viewer->SetInput(connector->GetOutput());
>  viewer->SetColorWindow(100);
>  viewer->SetColorLevel(50);
>  viewer->SetPosition(100,100);
>  viewer->Render();
> ....
>  
>   Regards
>  
> 2007/10/24, Luis Ibanez <luis.ibanez at kitware.com 
> <mailto:luis.ibanez at kitware.com>>:
> 
> 
>     Hi orientation f.
> 
>     What you should do when combining ITK and VTK is to set the VTK camera
>     properly. The orientation of the images is not the problem. The problem
>     is that the default position of the VTK camera is not the one that you
>     usually assume when visualizing mathematical coordinate system.
> 
>     Are you managing 2D images ? or 3D images ?
> 
> 
>       Regards,
> 
> 
>          Luis
> 
> 
> 
>     ---------------------
>     orientation f wrote:
>      > Hello,
>      >
>      > I read an image with ITK and display it with VTK. But the image
>     rotates
>      > 180 degree around horizontal direction relative to the image
>     which is
>      > read and displayed by VTK. Maybe the ITK and VTK coordinates are
>     defined
>      > in different origin, well then which function can be used to
>     accord ITK
>      > with VTK coordinate origin?
>      > thanks
>      >
>      >
>      >
>     ------------------------------------------------------------------------
>      >
>      > _______________________________________________
>      > Insight-users mailing list
>      > Insight-users at itk.org <mailto:Insight-users at itk.org>
>      > http://www.itk.org/mailman/listinfo/insight-users
> 
> 


More information about the Insight-users mailing list