1 #include "bbSlicerSimpleregiongrowing.h"
2 #include "bbSlicerPackage.h"
5 BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, Simpleregiongrowing )
6 BBTK_BLACK_BOX_IMPLEMENTATION ( Simpleregiongrowing, bbtk::AtomicBlackBox );
8 void Simpleregiongrowing::Process ( ) {
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( ) ) ) ,"@@@@@","") ) };
25 this->execute( lib, _argc, _argv );
29 void Simpleregiongrowing::execute ( std::string lib, int _argc, char * _argv[] ) {
30 void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
32 std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
35 typedef int (*method_t )( int argc, char * argv[] );
39 method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
40 const char *dlsym_error = dlerror( );
42 std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
47 myMethod( _argc, _argv );
52 void Simpleregiongrowing::bbUserSetDefaultValues ( ) {
55 void Simpleregiongrowing::bbUserInitializeProcessing ( ) {
58 void Simpleregiongrowing::bbUserFinalizeProcessing ( ) {
61 // EO namespace bbSlicer