[Insight-users] VTK-ITK Pipeline

Mario Ceresa mario.ceresa at torrescalla.it
Tue Oct 28 05:28:47 EDT 2008


Hello Raghu,

did you see the faq entry " How to combine ITK and VTK in my
application" in http://www.itk.org/Wiki/index.php/ITK_FAQ ?

Hope this helps

Mario

> Hi,
>
>             I am building an application which needs vtk and itk to be
> connected.My application is of viewing an image in vtk gui and to develop a
> 3d volume rendered image .I tried a sample code from the vtk get start guide
> but when I execute it the error message Cannot open include file:
> 'itkImageToVTKImageFilter.h': No such file or directory Error executing
> cl.exe. flashes.Please provide me a solution .I am attaching the code
> snippet.
>
>
> #include "itkImage.h"
> #include "itkImageFileReader.h"
> #include "itkImageToVTKImageFilter.h"
> #include "itkVTKImageExport.h"
> #include "vtkImageImport.h"
> #include "vtkImageData.h"
> #include "vtkImageViewer.h"
> #include "vtkRenderWindowInteractor.h"
> int main()
> {
> typedef itk::Image<unsigned short,2> ImageType;
> typedef itk::Image<unsigned int ,2>Image Type;
> typedef itk::ImageFileReader<ImageType> ReaderType;
> typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;
> ReaderType::Pointerreader= ReaderType::New();
> ConnectorType::Pointerconnector= ConnectorType::New();
> itkVTKExporter = itkVTKImageExportType::New();
> vtkImporter = vtkImageImport::New();
> itkVTKExporter->SetInput( m_InputImage );
> ConnectPipelines(itkVTKExporter, vtkImporter);
>
> reader->SetFileName( "D:\\test\\in\\in.bmp");
> connector->SetInput( reader->GetOutput() );
> vtkImageViewer* viewer= vtkImageViewer::New();
> vtkRenderWindowInteractor* renderWindowInteractor=
> vtkRenderWindowInteractor::New();
> viewer->SetupInteractor( renderWindowInteractor);
> viewer->SetInput( connector->GetOutput() );
> viewer->Render();
> viewer->SetColorWindow( 255);
> viewer->SetColorLevel( 128);
> renderWindowInteractor->Start();
> return 0;
> }
>
> --
> Warm Regards
>
> Raghu Prasad
>
> _______________________________________________
> 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