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