[Insight-users] VTK-ITK Pipeline

RAGHU PRASAD raghuprasad.m.s at gmail.com
Tue Oct 28 05:12:37 EDT 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081028/e3ba23eb/attachment.htm>


More information about the Insight-users mailing list