1 #include "bbSlicerACPCTransform.h"
2 #include "bbSlicerPackage.h"
5 BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, ACPCTransform )
6 BBTK_BLACK_BOX_IMPLEMENTATION ( ACPCTransform, bbtk::AtomicBlackBox );
8 void ACPCTransform::Process ( ) {
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libRealignLib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--acpc" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputACPC( ) ) ) ,"@@@@@"," --acpc ") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--midline" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputMidline( ) ) ) ,"@@@@@"," --midline ") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputTransform" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputOutputTransform( ) ) ) ,"@@@@@"," --outputTransform ") ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-d" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdebugSwitch( ) ) ) ,"@@@@@"," -d ") ) };
20 this->execute( lib, _argc, _argv );
24 void ACPCTransform::execute ( std::string lib, int _argc, char * _argv[] ) {
25 void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
27 std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
30 typedef int (*method_t )( int argc, char * argv[] );
34 method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
35 const char *dlsym_error = dlerror( );
37 std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
42 myMethod( _argc, _argv );
47 void ACPCTransform::bbUserSetDefaultValues ( ) {
50 void ACPCTransform::bbUserInitializeProcessing ( ) {
53 void ACPCTransform::bbUserFinalizeProcessing ( ) {
56 // EO namespace bbSlicer