]> Creatis software - cpPlugins.git/blob - appli/examples/ReadRawFile_02.cxx
Moved to version 1.0
[cpPlugins.git] / appli / examples / ReadRawFile_02.cxx
1 // =========================================================================
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // =========================================================================
4
5 #include <iostream>
6 #include <cpPlugins/Pipeline.h>
7
8 int main( int argc, char* argv[] )
9 {
10   typedef cpPlugins::Pipeline TPipeline;
11   typedef cpPlugins::Filter   TFilter;
12
13   if( argc != 2 )
14   {
15     std::cerr << "Usage: " << argv[ 0 ] << " file" << std::endl;
16     return( 1 );
17   } // end if
18
19   try
20   {
21     TPipeline::SharedPtr pipeline = TPipeline::New( );
22     pipeline->CreateNode( "cpPluginsBase::RawFileReader", "reader" );
23     pipeline->SetInValue( "FileName@reader", std::string( argv[ 1 ] ) );
24     pipeline->Update( );
25
26     std::cout << *( pipeline->GetOutput( "Output@reader" ) ) << 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$