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

Luis Ibanez luis.ibanez at kitware.com
Tue Jul 31 07:52:38 EDT 2007


HI Knoppix,

Thanks for the detailed description of your problem.

Please note that the error message that you get is also very clear:

             "FileName must be specified ""

It seems that your program is expecting the filename of the input
image as the first command line argument:

              reader->SetFileName( argv[1] );


and you probably are not passing any filename in the command
line, or you may be trying to execute the program by just double
clicking on its icon from a file browser.


You should execute your program from the command line
with an expression like:

       myprogram.exe   BrainProtonDensitySlice.png


The BrainSlice images are in the ITK directory:

            Insight/Examples/Data



  Regards,


       Luis


----------------------------------------
On 7/31/07, knoppix corn <knoppixc at yahoo.com> wrote:
>
> 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?
>
> ------------------------------
> Get the Yahoo! toolbar and be alerted to new email
> <http://us.rd.yahoo.com/evt=48225/*http://new.toolbar.yahoo.com/toolbar/features/mail/index.php>wherever
> you're surfing.
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070731/39f210c4/attachment.html


More information about the Insight-users mailing list