[Insight-users] problem in execute example in "Getting Started with ITK + VTK"

knoppix corn knoppixc at yahoo.com
Tue Jul 31 01:04:12 EDT 2007


hai.. i am new with ITK..
i have error in execute the file myProject.exe
(example in "Getting Started with ITK + VTK")

the code is:
CmakeLists.txt is: 
--------------------------
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
)


and myProject.cxx is:
------------------------
#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 use CMake-2.4.6 , ITK-3.2.0 , VTK-5.0.0
i take CMakeLists.txt and myProject.cxx files in direktory
C:\InsightToolkit\Example\ITK - VTK\Kode Sumber.
and i take the binaries in 
C:\InsightToolkit\Example\ITK - VTK\Kode Biner

when i execute the myProject.exe File
there was error that say :

"ERROR: In C:\InsightToolkit\VTK\vtk-5.0.0\Imaging\vtkImageImport.cxx, line 323
vtkImageImport (0x05B5CDC0): Calling UpdateInformationCallback: C:\INSIGH~1\ITK\INSIGH~1.0\Code\IO\itkImageFileReader.txx:99:
FileName must be specified "

what's wrong with this? i copy both code from GettingStarted-II 
(introduction getting started with ITK + VTK)
and where is the picture file BrainSlice.png?
and where directory i must take the pic?




       
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070730/2ca41f57/attachment.html


More information about the Insight-users mailing list