1 #include "bbSlicerRobustStatisticsSegmentation.h"
2 #include "bbSlicerPackage.h"
5 BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, RobustStatisticsSegmentation )
6 BBTK_BLACK_BOX_IMPLEMENTATION ( RobustStatisticsSegmentation, bbtk::AtomicBlackBox );
8 void RobustStatisticsSegmentation::Process ( ) {
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libRobustStatSegmenterLib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-v" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputexpectedVolume( ) ) ) ,"@@@@@"," -v ") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--intensityHomogeneity" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputintensityHomogeneity( ) ) ) ,"@@@@@"," --intensityHomogeneity ") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-c" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputcurvatureWeight( ) ) ) ,"@@@@@"," -c ") ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--labelValue" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputlabelValue( ) ) ) ,"@@@@@"," --labelValue ") ),
18 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--maxRunningTime" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmaxRunningTime( ) ) ) ,"@@@@@"," --maxRunningTime ") ),
19 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoriginalImageFileName( ) ) ) ,"@@@@@","") ),
20 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputlabelImageFileName( ) ) ) ,"@@@@@","") ),
21 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsegmentedImageFileName( ) ) ) ,"@@@@@","") ) };
24 this->execute( lib, _argc, _argv );
28 void RobustStatisticsSegmentation::execute ( std::string lib, int _argc, char * _argv[] ) {
29 void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
31 std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
34 typedef int (*method_t )( int argc, char * argv[] );
38 method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
39 const char *dlsym_error = dlerror( );
41 std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
46 myMethod( _argc, _argv );
51 void RobustStatisticsSegmentation::bbUserSetDefaultValues ( ) {
54 void RobustStatisticsSegmentation::bbUserInitializeProcessing ( ) {
57 void RobustStatisticsSegmentation::bbUserFinalizeProcessing ( ) {
60 // EO namespace bbSlicer