#include <iostream>
+#include <cpPlugins/Utility.h>
#include <cpPlugins/Interface/Plugins.h>
#include <cpPlugins/Interface/Workspace.h>
return( 1 );
} // yrt
+
+ // Read parameters
+ for( int i = 2; i < argc; ++i )
+ {
+ std::vector< std::string > tokens;
+ cpPlugins::Tokenize( tokens, argv[ i ], "@=" );
+ if( tokens.size( ) == 3 )
+ {
+ auto filter = workspace->GetFilter( tokens[ 1 ] );
+ if( filter != NULL )
+ {
+ auto params = filter->GetParameters( );
+ params->SetString( tokens[ 0 ], tokens[ 2 ], true );
+
+ } // fi
+
+ } // fi
+
+ } // rof
// Execute filter
workspace->PrintExecutionOn( );
- workspace->Execute( );
+ try
+ {
+ workspace->Execute( );
+ }
+ catch( itk::ExceptionObject& err2 )
+ {
+ std::cerr << std::endl << "********************************" << std::endl;
+ std::cerr << "Error caught: " << err2 << std::endl;
+ std::cerr << "********************************" << std::endl;
+ return( 1 );
+ }
+ catch( std::exception& err1 )
+ {
+ std::cerr << std::endl << "********************************" << std::endl;
+ std::cerr << "Error caught: " << err1.what( ) << std::endl;
+ std::cerr << "********************************" << std::endl;
+ return( 1 );
+ }
+ catch( ... )
+ {
+ std::cerr << std::endl << "********************************" << std::endl;
+ std::cerr << "Unknown error caught." << std::endl;
+ std::cerr << "********************************" << std::endl;
+ return( 1 );
+ } // yrt
return( 0 );
}