[Insight-users] flipped VTK

Luis Ibanez luis.ibanez at kitware.com
Tue Sep 2 09:13:44 EDT 2008


Hi Shady,

This is a known issue.

It is not really an "ITK problem", nor a "VTK problem".

You simmply have to put your vtkCamera in the right location.

E.g. make the UP vector of the vtkCamera point parallel to (0,1,0).


You are correct in that the itkImageToVTKImageFilter doesn't
make any attempt to flip the images.


     Regards,


         Luis


--------------------
Shady Shidfar wrote:
> Hi Everyone,
>  
> I have a weird problem. I'm using itk to read an image, then convert it 
> to VTK and display it. The problem is that the result displayed image is 
> filpped vertically. I know itk's image origin is at top left and VTK's 
> at bottom right (That's correct, right?), But I thought this would be 
> corrected by itkImageToVTKImageFilter , but it seems it's not. I'm 
> attaching the code. Am I doing anything wrong? or do I have to flip the 
> image every time I want to display the image in VTK???
>  
> I'm not sure if the problem is with ITK or VTK?
>  
> Thanks for your help
>  
> Shaadi
>  
> 
> try
> 
> {
> 
> itkImage_UC3 input = itkImage_UC3.New();
> 
> input.Read("C:/brainCut.tif");
> 
> // Import ITK image to VTK
> 
> itkImageToVTKImageFilter_IUC3 itk2vtk =
> 
> itkImageToVTKImageFilter_IUC3.New();
> 
> itk2vtk.SetInput(input);
> 
> itk2vtk.Update();
> 
> vtkImageData data = itk2vtk.GetOutput();
> 
> vtk.vtkImageActor imageActor= new vtkImageActor();
> 
> imageActor.SetInput(data);
> 
> vtkRenderer renderer = new vtkRenderer();
> 
> renderer.AddActor(imageActor);
> 
> vtkFormsWindowControl1.GetRenderWindow().AddRenderer(renderer);
> 
> vtkFormsWindowControl1.Update();
> 
> }
> 
> catch (Exception ex)
> 
> {
> 
> Console.WriteLine(ex);
> 
> }
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list