1 #include "bbSlicerOrientImages.h"
2 #include "bbSlicerPackage.h"
5 BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, OrientImages )
6 BBTK_BLACK_BOX_IMPLEMENTATION ( OrientImages, bbtk::AtomicBlackBox );
8 void OrientImages::Process ( ) {
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libOrientImageLib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputVolume1( ) ) ) ,"@@@@@","") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputVolume( ) ) ) ,"@@@@@","") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-o" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputorientation( ) ) ) ,"@@@@@"," -o ") ) };
19 this->execute( lib, _argc, _argv );
23 void OrientImages::execute ( std::string lib, int _argc, char * _argv[] ) {
24 void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
26 std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
29 typedef int (*method_t )( int argc, char * argv[] );
33 method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
34 const char *dlsym_error = dlerror( );
36 std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
41 myMethod( _argc, _argv );
46 void OrientImages::bbUserSetDefaultValues ( ) {
49 void OrientImages::bbUserInitializeProcessing ( ) {
52 void OrientImages::bbUserFinalizeProcessing ( ) {
55 // EO namespace bbSlicer