1 #include "bbSlicerLabelMapSmoothing.h"
2 #include "bbSlicerPackage.h"
5 BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, LabelMapSmoothing )
6 BBTK_BLACK_BOX_IMPLEMENTATION ( LabelMapSmoothing, bbtk::AtomicBlackBox );
8 void LabelMapSmoothing::Process ( ) {
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libLabelMapSmoothingLib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--labelToSmooth" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputlabelToSmooth( ) ) ) ,"@@@@@"," --labelToSmooth ") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfIterations" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfIterations( ) ) ) ,"@@@@@"," --numberOfIterations ") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--maxRMSError" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmaxRMSError( ) ) ) ,"@@@@@"," --maxRMSError ") ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--gaussianSigma" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputgaussianSigma( ) ) ) ,"@@@@@"," --gaussianSigma ") ),
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 LabelMapSmoothing::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 LabelMapSmoothing::bbUserSetDefaultValues ( ) {
52 void LabelMapSmoothing::bbUserInitializeProcessing ( ) {
55 void LabelMapSmoothing::bbUserFinalizeProcessing ( ) {
58 // EO namespace bbSlicer