<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>hai.. i am new with ITK..<br>i have error in execute the file myProject.exe<br>(example in "Getting Started with ITK + VTK")<br><br>the code is:<br>CmakeLists.txt is: <br>--------------------------<br>PROJECT( myProject )<br><br>FIND_PACKAGE ( ITK )<br> IF ( ITK_FOUND )<br> INCLUDE( ${USE_ITK_FILE} )<br> ENDIF( ITK_FOUND )<br><br>FIND_PACKAGE ( VTK )<br> IF ( VTK_FOUND )<br> INCLUDE( ${USE_VTK_FILE} )<br> ENDIF( VTK_FOUND )<br><br>INCLUDE_DIRECTORIES( ${myProject_SOURCE_DIR})<br><br>ADD_EXECUTABLE( myProject myProject.cxx )<br><br>TARGET_LINK_LIBRARIES ( myProject<br>ITKBasicFilters ITKCommon ITKIO <br>vtkRendering vtkGraphics vtkHybrid<br>vtkImaging vtkIO vtkFiltering vtkCommon<br>)<br><br><br>and myProject.cxx
is:<br>------------------------<br>#include "itkImage.h"<br>#include "itkImageFileReader.h"<br>#include "itkImageToVTKImageFilter.h"<br><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><br> ReaderType::Pointer reader = ReaderType::New();<br> ConnectorType::Pointer connector = ConnectorType::New();<br><br> reader->SetFileName( argv[1] );<br> connector->SetInput( reader->GetOutput() );<br><br> vtkImageViewer * viewer = vtkImageViewer::New();<br><br> vtkRenderWindowInteractor * renderWindowInteractor =<br> <br> vtkRenderWindowInteractor::New();<br><br> viewer->SetupInteractor( renderWindowInteractor
);<br> viewer->SetInput( connector->GetOutput() );<br><br> viewer->Render();<br> viewer->SetColorWindow( 255 );<br> viewer->SetColorLevel( 128 );<br><br> renderWindowInteractor->Start();<br><br> return 0;<br>}<br><br><br>i use CMake-2.4.6 , ITK-3.2.0 , VTK-5.0.0<br>i take CMakeLists.txt and myProject.cxx files in direktory<br>C:\InsightToolkit\Example\ITK - VTK\Kode Sumber.<br>and i take the binaries in <br>C:\InsightToolkit\Example\ITK - VTK\Kode Biner<br><br>when i execute the myProject.exe File<br>there was error that say :<br><br>"ERROR: In C:\InsightToolkit\VTK\vtk-5.0.0\Imaging\vtkImageImport.cxx, line 323<br>vtkImageImport (0x05B5CDC0): Calling UpdateInformationCallback: C:\INSIGH~1\ITK\INSIGH~1.0\Code\IO\itkImageFileReader.txx:99:<br>FileName must be specified "<br><br>what's wrong with this? i copy both code from GettingStarted-II <br>(introduction getting started with ITK + VTK)<br>and where is
the picture file BrainSlice.png?<br>and where directory i must take the pic?<br></div></div><br>
<hr size=1>Get the Yahoo! toolbar and <a href="http://us.rd.yahoo.com/evt=48225/*http://new.toolbar.yahoo.com/toolbar/features/mail/index.php">be alerted to new email </a>wherever you're surfing. </body></html>