1 #include "bbSlicerVotingBinaryHoleFilling.h"
2 #include "bbSlicerPackage.h"
5 BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, VotingBinaryHoleFilling )
6 BBTK_BLACK_BOX_IMPLEMENTATION ( VotingBinaryHoleFilling, bbtk::AtomicBlackBox );
8 void VotingBinaryHoleFilling::Process ( ) {
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libVotingBinaryHoleFillingImageFilterLib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--radius" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputradius( ) ) ) ,"@@@@@"," --radius ") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--majorityThreshold" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmajorityThreshold( ) ) ) ,"@@@@@"," --majorityThreshold ") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--background" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputbackground( ) ) ) ,"@@@@@"," --background ") ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--foreground" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputforeground( ) ) ) ,"@@@@@"," --foreground ") ),
18 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputVolume( ) ) ) ,"@@@@@","") ),
19 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputVolume( ) ) ) ,"@@@@@","") ) };
22 this->execute( lib, _argc, _argv );
26 void VotingBinaryHoleFilling::execute ( std::string lib, int _argc, char * _argv[] ) {
27 void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
29 std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
32 typedef int (*method_t )( int argc, char * argv[] );
36 method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
37 const char *dlsym_error = dlerror( );
39 std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
44 myMethod( _argc, _argv );
49 void VotingBinaryHoleFilling::bbUserSetDefaultValues ( ) {
52 void VotingBinaryHoleFilling::bbUserInitializeProcessing ( ) {
55 void VotingBinaryHoleFilling::bbUserFinalizeProcessing ( ) {
58 // EO namespace bbSlicer