<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7655.8">
<TITLE>Problem with configuring ITK with VTK</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi<BR>
I have problem with configuring ITK with VTK I used the example in the slide that I take from www.itk.org :<BR>
<BR>
#include "itkImage.h"<BR>
#include "itkImageFileReader.h"<BR>
#include "itkImageToVTKImageFilter.h"<BR>
#include "vtkImageViewer.h"<BR>
#include "vtkRenderWindowInteractor.h"<BR>
<BR>
int main( int argc, char **argv)<BR>
{<BR>
typedef itk::Image<unsigned short,2> ImageType;<BR>
typedef itk::ImageFileReader<ImageType> ReaderType;<BR>
typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;<BR>
ReaderType::Pointerreader= ReaderType::New();<BR>
ConnectorType::Pointerconnector= ConnectorType::New();<BR>
reader->SetFileName( argv[1]);<BR>
connector->SetInput( reader->GetOutput() );<BR>
vtkImageViewer* viewer= vtkImageViewer::New();<BR>
vtkRenderWindowInteractor* renderWindowInteractor=<BR>
vtkRenderWindowInteractor::New();<BR>
viewer->SetupInteractor( renderWindowInteractor);<BR>
viewer->SetInput( connector->GetOutput() );<BR>
viewer->Render();<BR>
viewer->SetColorWindow( 255);<BR>
viewer->SetColorLevel( 128);<BR>
renderWindowInteractor->Start();<BR>
return 0;<BR>
}<BR>
<BR>
<BR>
<BR>
the CMakeLists.txt is:<BR>
<BR>
<BR>
cmake_minimum_required(VERSION 2.8)<BR>
<BR>
PROJECT(myProject)<BR>
FIND_PACKAGE ( ITK)<BR>
IF ( ITK_FOUND)<BR>
INCLUDE( ${USE_ITK_FILE} )<BR>
ENDIF( ITK_FOUND)<BR>
FIND_PACKAGE ( VTK)<BR>
IF ( VTK_FOUND)<BR>
INCLUDE( ${USE_VTK_FILE} )<BR>
ENDIF( VTK_FOUND)<BR>
INCLUDE_DIRECTORIES( ${myProject_SOURCE_DIR} )<BR>
<BR>
ADD_EXECUTABLE( myProject myProject.cxx)<BR>
<BR>
TARGET_LINK_LIBRARIES ( myProject<BR>
ITKBasicFiltersITKCommonITKIO<BR>
vtkRenderingvtkGraphicsvtkHybrid<BR>
vtkImagingvtkIOvtkFilteringvtkCommon<BR>
)<BR>
<BR>
<BR>
<BR>
<BR>
but I don't understand why when I run the make command the output is that:<BR>
<BR>
<BR>
<BR>
<BR>
edoardo@edoardo-laptop:~/VTK/vtk-itk/bin$ make<BR>
-- Configuring done<BR>
-- Generating done<BR>
-- Build files have been written to: /home/edoardo/VTK/vtk-itk/bin<BR>
[100%] Building CXX object CMakeFiles/myProject.dir/myProject.cxx.o<BR>
/home/edoardo/VTK/vtk-itk/src/myProject.cxx:3:38: error: itkImageToVTKImageFilter.h: Nessun file o directory<BR>
/home/edoardo/VTK/vtk-itk/src/myProject.cxx: In function ‘int main(int, char**)’:<BR>
/home/edoardo/VTK/vtk-itk/src/myProject.cxx:11: error: expected initializer before ‘<’ token<BR>
/home/edoardo/VTK/vtk-itk/src/myProject.cxx:12: error: ‘Pointerreader’ is not a member of ‘main(int, char**)::ReaderType’<BR>
/home/edoardo/VTK/vtk-itk/src/myProject.cxx:13: error: ‘ConnectorType’ has not been declared<BR>
/home/edoardo/VTK/vtk-itk/src/myProject.cxx:13: error: ‘ConnectorType’ has not been declared<BR>
/home/edoardo/VTK/vtk-itk/src/myProject.cxx:14: error: ‘reader’ was not declared in this scope<BR>
/home/edoardo/VTK/vtk-itk/src/myProject.cxx:15: error: ‘connector’ was not declared in this scope<BR>
make[2]: *** [CMakeFiles/myProject.dir/myProject.cxx.o] Errore 1<BR>
make[1]: *** [CMakeFiles/myProject.dir/all] Errore 2<BR>
make: *** [all] Errore 2<BR>
<BR>
<BR>
<BR>
<BR>
I have just configuring cmake with set ITK_DIR to the binary directory<BR>
where ITKwas built and set VTK_DIR to the binary directory where VTK was built<BR>
I don't undersand why it doesn't found the itkImageToVTKImageFilter.h library.<BR>
<BR>
Thank you very much<BR>
Edoardo<BR>
</FONT>
</P>
</BODY>
</HTML>