X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk_Slicer_PKG%2Fsrc%2FbbSlicerExecutionModelTour.cxx;fp=bbtk_Slicer_PKG%2Fsrc%2FbbSlicerExecutionModelTour.cxx;h=659a3983add1b431cea840b80a9caca55150d49b;hb=e7b4e2c9254e9e431f74acc92e3f0d40fc5e7ef6;hp=0000000000000000000000000000000000000000;hpb=cd590ce5fff20d69c7060340235a35e9c2a9ef86;p=creaCLI.git diff --git a/bbtk_Slicer_PKG/src/bbSlicerExecutionModelTour.cxx b/bbtk_Slicer_PKG/src/bbSlicerExecutionModelTour.cxx new file mode 100644 index 0000000..659a398 --- /dev/null +++ b/bbtk_Slicer_PKG/src/bbSlicerExecutionModelTour.cxx @@ -0,0 +1,82 @@ +#include "bbSlicerExecutionModelTour.h" +#include "bbSlicerPackage.h" + +namespace bbSlicer { + BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, ExecutionModelTour ) + BBTK_BLACK_BOX_IMPLEMENTATION ( ExecutionModelTour, bbtk::AtomicBlackBox ); + + void ExecutionModelTour::Process ( ) { + + // GENERATED + +int _argc =28; +std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libExecutionModelTourLib.so"; +char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-i" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputintegerVariable( ) ) ) ,"@@@@@"," -i ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-d" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdoubleVariable( ) ) ) ,"@@@@@"," -d ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-f" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfloatVector( ) ) ) ,"@@@@@"," -f ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--string_vector" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputstringVector( ) ) ) ,"@@@@@"," --string_vector ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-e" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputstringChoice( ) ) ) ,"@@@@@"," -e ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--boolean1" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputboolean1( ) ) ) ,"@@@@@"," --boolean1 ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--boolean2" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputboolean2( ) ) ) ,"@@@@@"," --boolean2 ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--boolean3" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputboolean3( ) ) ) ,"@@@@@"," --boolean3 ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--file1" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfile1( ) ) ) ,"@@@@@"," --file1 ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--files" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfiles( ) ) ) ,"@@@@@"," --files ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--directory1" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdirectory1( ) ) ) ,"@@@@@"," --directory1 ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--image1" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputimage1( ) ) ) ,"@@@@@"," --image1 ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--image2" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputimage2( ) ) ) ,"@@@@@"," --image2 ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--transform1" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransform1( ) ) ) ,"@@@@@"," --transform1 ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--transform2" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransform2( ) ) ) ,"@@@@@"," --transform2 ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--seed" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputseed( ) ) ) ,"@@@@@"," --seed ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputarg0( ) ) ) ,"@@@@@","") ), +Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputarg1( ) ) ) ,"@@@@@","") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--region" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputregions( ) ) ) ,"@@@@@"," --region ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--inputFA" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputFA( ) ) ) ,"@@@@@"," --inputFA ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputFA" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputFA( ) ) ) ,"@@@@@"," --outputFA ") ), +Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputanintegerreturn( ) ) ) ,"@@@@@","") ), +Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputabooleanreturn( ) ) ) ,"@@@@@","") ), +Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputafloatreturn( ) ) ) ,"@@@@@","") ), +Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputadoublereturn( ) ) ) ,"@@@@@","") ), +Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputastringreturn( ) ) ) ,"@@@@@","") ), +Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputanintegervectorreturn( ) ) ) ,"@@@@@","") ), +Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputastringchoicereturn( ) ) ) ,"@@@@@","") ) }; + + // EO GENERATED + this->execute( lib, _argc, _argv ); + + } + + void ExecutionModelTour::execute ( std::string lib, int _argc, char * _argv[] ) { + void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL ); + if ( ! handle ) { + std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n'; + return; + } + typedef int (*method_t )( int argc, char * argv[] ); + // RESET ERROR + dlerror( ); + // PROTOTYPE + method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" ); + const char *dlsym_error = dlerror( ); + if ( dlsym_error ) { + std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n'; + dlclose( handle ); + return; + } + // METHOD CALL + myMethod( _argc, _argv ); + // CLOSING LIB + dlclose( handle ); + } + + void ExecutionModelTour::bbUserSetDefaultValues ( ) { + } + + void ExecutionModelTour::bbUserInitializeProcessing ( ) { + } + + void ExecutionModelTour::bbUserFinalizeProcessing ( ) { + } +} +// EO namespace bbSlicer + +