1 #include "bbSlicerMeshContourSegmentation.h"
2 #include "bbSlicerPackage.h"
5 BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, MeshContourSegmentation )
6 BBTK_BLACK_BOX_IMPLEMENTATION ( MeshContourSegmentation, bbtk::AtomicBlackBox );
8 void MeshContourSegmentation::Process ( ) {
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 ") ) };
26 this->execute( lib, _argc, _argv );
30 void MeshContourSegmentation::execute ( std::string lib, int _argc, char * _argv[] ) {
31 void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
33 std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
36 typedef int (*method_t )( int argc, char * argv[] );
40 method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
41 const char *dlsym_error = dlerror( );
43 std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
48 myMethod( _argc, _argv );
53 void MeshContourSegmentation::bbUserSetDefaultValues ( ) {
56 void MeshContourSegmentation::bbUserInitializeProcessing ( ) {
59 void MeshContourSegmentation::bbUserFinalizeProcessing ( ) {
62 // EO namespace bbSlicer