[Insight-users] Problem in running MyProject.cxx in getting started II?
Nora Nora
nora_droit at yahoo.fr
Mon Dec 29 17:04:59 EST 2008
Hi all ITK users,
I tried to run MyProject.cxx following instructions in getting started II. Here are MyProjct.cxx and CmakeLists.txt files :
PROJECT( myProject )
FIND_PACKAGE ( ITK )
IF ( ITK_FOUND )
INCLUDE( ${USE_ITK_FILE} )
ENDIF( ITK_FOUND )
FIND_PACKAGE ( VTK )
IF ( VTK_FOUND )
INCLUDE( ${USE_VTK_FILE} )
ENDIF( VTK_FOUND )
INCLUDE_DIRECTORIES( ${myProject_SOURCE_DIR})
ADD_EXECUTABLE( myProject myProject.cxx )
TARGET_LINK_LIBRARIES ( myProject
ITKBasicFilters ITKCommon ITKIO
vtkRendering vtkGraphics vtkHybrid
vtkImaging vtkIO vtkFiltering vtkCommon
)
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageToVTKImageFilter.h"
#include "vtkImageViewer.h"
#include "vtkRenderWindowInteractor.h"
int main( int argc, char **argv) {
typedef itk::Image<unsigned short,2> ImageType;
typedef itk::ImageFileReader<Imagetype> ReaderType;
typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;
ReaderType::Pointer reader = readertype::New();
ConnectorType::Pointer connector = ConnectorType::New();
reader->setFilename( argv[1] );
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;
}
I have successively built it, but in running this error message is chown :
Myproject-source\myProject.cxx(3) : fatal error C1083: Impossible d'ouvrir le fichier include : 'itkImageToVTKImageFilter.h' : No such file or directory
I have red the response of Luis in OSdir forum to such problem that is as followed :
The files that you need are in InsightApplications/Auxiliary/vtk :
itkImageToVTKImageFilter.h
itkImageToVTKImageFilter.txx
itkVTKImageToImageFilter.h
itkVTKImageToImageFilter.txx
Copy these files into the directory where you are putting the code of your example.
So I copied these files in the generated binary directory with myProject.dsw.
But I stiil have the same error message??
Can someone help me??
Are there other examples on how connect ITK to VTK?
Thanks,
Nora
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081229/e161d114/attachment.htm>
More information about the Insight-users
mailing list