]> Creatis software - creaCLI.git/blob - ModuleCall/GenSrc/bbSlicerSimpleregiongrowing.cxx
All Slicer modules succesfully compiled into BBTK boxes :P
[creaCLI.git] / ModuleCall / GenSrc / bbSlicerSimpleregiongrowing.cxx
1 #include "bbSlicerSimpleregiongrowing.h"
2 #include "bbSlicerPackage.h"
3
4 namespace bbSlicer {
5     BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, Simpleregiongrowing )
6     BBTK_BLACK_BOX_IMPLEMENTATION ( Simpleregiongrowing, bbtk::AtomicBlackBox );
7
8     void Simpleregiongrowing::Process ( ) {
9
10         // GENERATED
11
12 int _argc =9;
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libConfidenceConnectedLib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--smoothingIterations"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsmoothingIterations( ) ) ) ,"@@@@@"," --smoothingIterations ") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--timestep"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtimestep( ) ) ) ,"@@@@@"," --timestep ") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--iterations"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputiterations( ) ) ) ,"@@@@@"," --iterations ") ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--multiplier"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmultiplier( ) ) ) ,"@@@@@"," --multiplier ") ),
18 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--neighborhood"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputneighborhood( ) ) ) ,"@@@@@"," --neighborhood ") ),
19 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--labelvalue"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputlabelvalue( ) ) ) ,"@@@@@"," --labelvalue ") ),
20 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--seed"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputseed( ) ) ) ,"@@@@@"," --seed ") ),
21 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputVolume( ) ) ) ,"@@@@@","") ),
22 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputVolume( ) ) ) ,"@@@@@","") ) };
23
24         // EO GENERATED
25         this->execute( lib, _argc, _argv );
26
27     }
28
29     void Simpleregiongrowing::execute ( std::string lib, int _argc, char * _argv[] ) {
30         void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
31         if ( ! handle ) {
32             std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
33             return;
34         }
35         typedef int (*method_t )( int argc, char * argv[] );
36         // RESET ERROR
37         dlerror( );
38         // PROTOTYPE
39         method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
40         const char *dlsym_error = dlerror( );
41         if ( dlsym_error ) {
42             std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
43             dlclose( handle );
44             return;
45         }
46         // METHOD CALL
47         myMethod( _argc, _argv );
48         // CLOSING LIB
49         dlclose( handle );
50     }
51
52     void Simpleregiongrowing::bbUserSetDefaultValues ( ) {
53     }
54
55     void Simpleregiongrowing::bbUserInitializeProcessing ( ) {
56     }
57
58     void Simpleregiongrowing::bbUserFinalizeProcessing ( ) {
59     }
60 }
61 // EO namespace bbSlicer
62
63