]> Creatis software - creaCLI.git/blob - ModuleCall/GenSrc/bbSlicerExecutionModelTour.cxx
All Slicer modules succesfully compiled into BBTK boxes :P
[creaCLI.git] / ModuleCall / GenSrc / bbSlicerExecutionModelTour.cxx
1 #include "bbSlicerExecutionModelTour.h"
2 #include "bbSlicerPackage.h"
3
4 namespace bbSlicer {
5     BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, ExecutionModelTour )
6     BBTK_BLACK_BOX_IMPLEMENTATION ( ExecutionModelTour, bbtk::AtomicBlackBox );
7
8     void ExecutionModelTour::Process ( ) {
9
10         // GENERATED
11
12 int _argc =28;
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libExecutionModelTourLib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-i"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputintegerVariable( ) ) ) ,"@@@@@"," -i ") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-d"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdoubleVariable( ) ) ) ,"@@@@@"," -d ") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-f"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfloatVector( ) ) ) ,"@@@@@"," -f ") ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--string_vector"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputstringVector( ) ) ) ,"@@@@@"," --string_vector ") ),
18 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-e"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputstringChoice( ) ) ) ,"@@@@@"," -e ") ),
19 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--boolean1"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputboolean1( ) ) ) ,"@@@@@"," --boolean1 ") ),
20 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--boolean2"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputboolean2( ) ) ) ,"@@@@@"," --boolean2 ") ),
21 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--boolean3"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputboolean3( ) ) ) ,"@@@@@"," --boolean3 ") ),
22 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--file1"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfile1( ) ) ) ,"@@@@@"," --file1 ") ),
23 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--files"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfiles( ) ) ) ,"@@@@@"," --files ") ),
24 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--directory1"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdirectory1( ) ) ) ,"@@@@@"," --directory1 ") ),
25 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--image1"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputimage1( ) ) ) ,"@@@@@"," --image1 ") ),
26 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--image2"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputimage2( ) ) ) ,"@@@@@"," --image2 ") ),
27 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--transform1"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransform1( ) ) ) ,"@@@@@"," --transform1 ") ),
28 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--transform2"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransform2( ) ) ) ,"@@@@@"," --transform2 ") ),
29 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--seed"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputseed( ) ) ) ,"@@@@@"," --seed ") ),
30 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputarg0( ) ) ) ,"@@@@@","") ),
31 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputarg1( ) ) ) ,"@@@@@","") ),
32 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--region"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputregions( ) ) ) ,"@@@@@"," --region ") ),
33 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--inputFA"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputFA( ) ) ) ,"@@@@@"," --inputFA ") ),
34 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputFA"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputFA( ) ) ) ,"@@@@@"," --outputFA ") ),
35 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputanintegerreturn( ) ) ) ,"@@@@@","") ),
36 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputabooleanreturn( ) ) ) ,"@@@@@","") ),
37 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputafloatreturn( ) ) ) ,"@@@@@","") ),
38 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputadoublereturn( ) ) ) ,"@@@@@","") ),
39 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputastringreturn( ) ) ) ,"@@@@@","") ),
40 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputanintegervectorreturn( ) ) ) ,"@@@@@","") ),
41 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputastringchoicereturn( ) ) ) ,"@@@@@","") ) };
42
43         // EO GENERATED
44         this->execute( lib, _argc, _argv );
45
46     }
47
48     void ExecutionModelTour::execute ( std::string lib, int _argc, char * _argv[] ) {
49         void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
50         if ( ! handle ) {
51             std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
52             return;
53         }
54         typedef int (*method_t )( int argc, char * argv[] );
55         // RESET ERROR
56         dlerror( );
57         // PROTOTYPE
58         method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
59         const char *dlsym_error = dlerror( );
60         if ( dlsym_error ) {
61             std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
62             dlclose( handle );
63             return;
64         }
65         // METHOD CALL
66         myMethod( _argc, _argv );
67         // CLOSING LIB
68         dlclose( handle );
69     }
70
71     void ExecutionModelTour::bbUserSetDefaultValues ( ) {
72     }
73
74     void ExecutionModelTour::bbUserInitializeProcessing ( ) {
75     }
76
77     void ExecutionModelTour::bbUserFinalizeProcessing ( ) {
78     }
79 }
80 // EO namespace bbSlicer
81
82