<br>HI Knoppix,<br><br>Thanks for the detailed description of your problem.<br><br>Please note that the error message that you get is also very clear:<br><br> "FileName must be specified ""<br><br>
It seems that your program is expecting the filename of the input <br>image as the first command line argument:<br><br> reader->SetFileName( argv[1] );<br><br><br>and you probably are not passing any filename in the command
<br>line, or you may be trying to execute the program by just double<br>clicking on its icon from a file browser.<br><br><br>You should execute your program from the command line<br>with an expression like:<br><br>
myprogram.exe BrainProtonDensitySlice.png<br><br><br>The BrainSlice images are in the ITK directory:<br>
<br>
Insight/Examples/Data<br>
<br>
<br><br> Regards,<br><br><br> Luis<br><br><br>----------------------------------------<br><div><span class="gmail_quote">On 7/31/07, <b class="gmail_sendername">knoppix corn</b> <<a href="mailto:knoppixc@yahoo.com">
knoppixc@yahoo.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><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><span class="ad"><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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
be alerted to new email </a>wherever you're surfing. </span></div><br>_______________________________________________<br>Insight-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Insight-users@itk.org">
Insight-users@itk.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br><br>
</blockquote></div><br>