]> Creatis software - cpPlugins.git/blob - appli/examples/ReadRawFile_00.cxx
Moved to version 1.0
[cpPlugins.git] / appli / examples / ReadRawFile_00.cxx
1 // =========================================================================
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // =========================================================================
4
5 #include <iostream>
6 #include <cpPlugins/DataObject.h>
7 #include <cpPluginsBase/RawFileReader.h>
8
9 int main( int argc, char* argv[] )
10 {
11   typedef cpPluginsBase::RawFileReader TReader;
12
13   if( argc != 2 )
14   {
15     std::cerr << "Usage: " << argv[ 0 ] << " file" << std::endl;
16     return( 1 );
17
18   } // fi
19
20   try
21   {
22     TReader::SharedPtr reader = TReader::New( );
23     reader->SetInValue( "FileName", std::string( argv[ 1 ] ) );
24     reader->Update( );
25
26     std::cout << *( reader->GetOutput( "Output" ) ) << std::endl;
27   }
28   catch( std::exception& err )
29   {
30     std::cerr << "ERROR CAUGHT: " << err.what( ) << std::endl;
31     return( 1 );
32   } // end try
33   return( 0 );
34 }
35
36 // eof - $RCSfile$