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