1 #include "bbSlicerJointRicianLMMSEImageFilter.h"
2 #include "bbSlicerPackage.h"
5 BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, JointRicianLMMSEImageFilter )
6 BBTK_BLACK_BOX_IMPLEMENTATION ( JointRicianLMMSEImageFilter, bbtk::AtomicBlackBox );
8 void JointRicianLMMSEImageFilter::Process ( ) {
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libjointLMMSELib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--re" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputiRadiusEstimation( ) ) ) ,"@@@@@"," --re ") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--rf" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputiRadiusFiltering( ) ) ) ,"@@@@@"," --rf ") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--ng" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputiNumNeighbors( ) ) ) ,"@@@@@"," --ng ") ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputVolume( ) ) ) ,"@@@@@","") ),
18 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputVolume( ) ) ) ,"@@@@@","") ) };
21 this->execute( lib, _argc, _argv );
25 void JointRicianLMMSEImageFilter::execute ( std::string lib, int _argc, char * _argv[] ) {
26 void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
28 std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
31 typedef int (*method_t )( int argc, char * argv[] );
35 method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
36 const char *dlsym_error = dlerror( );
38 std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
43 myMethod( _argc, _argv );
48 void JointRicianLMMSEImageFilter::bbUserSetDefaultValues ( ) {
51 void JointRicianLMMSEImageFilter::bbUserInitializeProcessing ( ) {
54 void JointRicianLMMSEImageFilter::bbUserFinalizeProcessing ( ) {
57 // EO namespace bbSlicer