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