1 #include "bbSlicerSimpleIOTest.h"
2 #include "bbSlicerPackage.h"
5 BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, SimpleIOTest )
6 BBTK_BLACK_BOX_IMPLEMENTATION ( SimpleIOTest, bbtk::AtomicBlackBox );
8 void SimpleIOTest::Process ( ) {
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libDiffusionTensorTestLib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputVolume( ) ) ) ,"@@@@@","") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputVolume( ) ) ) ,"@@@@@","") ) };
18 this->execute( lib, _argc, _argv );
22 void SimpleIOTest::execute ( std::string lib, int _argc, char * _argv[] ) {
23 void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
25 std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
28 typedef int (*method_t )( int argc, char * argv[] );
32 method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
33 const char *dlsym_error = dlerror( );
35 std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
40 myMethod( _argc, _argv );
45 void SimpleIOTest::bbUserSetDefaultValues ( ) {
48 void SimpleIOTest::bbUserInitializeProcessing ( ) {
51 void SimpleIOTest::bbUserFinalizeProcessing ( ) {
54 // EO namespace bbSlicer