#include "bbSlicerExpertAutomatedRegistration.h" #include "bbSlicerPackage.h" namespace bbSlicer { BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, ExpertAutomatedRegistration ) BBTK_BLACK_BOX_IMPLEMENTATION ( ExpertAutomatedRegistration, bbtk::AtomicBlackBox ); void ExpertAutomatedRegistration::Process ( ) { // GENERATED int _argc =28; std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libRegisterImagesModule.so"; char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfixedImage( ) ) ) ,"@@@@@","") ), Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmovingImage( ) ) ) ,"@@@@@","") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--resampledImage" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputresampledImage( ) ) ) ,"@@@@@"," --resampledImage ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--loadTransform" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputloadTransform( ) ) ) ,"@@@@@"," --loadTransform ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--saveTransform" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsaveTransform( ) ) ) ,"@@@@@"," --saveTransform ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--initialization" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinitialization( ) ) ) ,"@@@@@"," --initialization ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--registration" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputregistration( ) ) ) ,"@@@@@"," --registration ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--metric" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmetric( ) ) ) ,"@@@@@"," --metric ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--expectedOffset" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputexpectedOffset( ) ) ) ,"@@@@@"," --expectedOffset ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--expectedRotation" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputexpectedRotation( ) ) ) ,"@@@@@"," --expectedRotation ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--expectedScale" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputexpectedScale( ) ) ) ,"@@@@@"," --expectedScale ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--expectedSkew" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputexpectedSkew( ) ) ) ,"@@@@@"," --expectedSkew ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--verbosityLevel" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputverbosityLevel( ) ) ) ,"@@@@@"," --verbosityLevel ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--sampleFromOverlap" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsampleFromOverlap( ) ) ) ,"@@@@@"," --sampleFromOverlap ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--fixedImageMask" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfixedImageMask( ) ) ) ,"@@@@@"," --fixedImageMask ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--randomNumberSeed" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputrandomNumberSeed( ) ) ) ,"@@@@@"," --randomNumberSeed ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfThreads" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfThreads( ) ) ) ,"@@@@@"," --numberOfThreads ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--minimizeMemory" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputminimizeMemory( ) ) ) ,"@@@@@"," --minimizeMemory ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--interpolation" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinterpolation( ) ) ) ,"@@@@@"," --interpolation ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--fixedLandmarks" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfixedLandmarks( ) ) ) ,"@@@@@"," --fixedLandmarks ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--movingLandmarks" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmovingLandmarks( ) ) ) ,"@@@@@"," --movingLandmarks ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--rigidMaxIterations" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputrigidMaxIterations( ) ) ) ,"@@@@@"," --rigidMaxIterations ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--rigidSamplingRatio" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputrigidSamplingRatio( ) ) ) ,"@@@@@"," --rigidSamplingRatio ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--affineMaxIterations" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputaffineMaxIterations( ) ) ) ,"@@@@@"," --affineMaxIterations ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--affineSamplingRatio" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputaffineSamplingRatio( ) ) ) ,"@@@@@"," --affineSamplingRatio ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--bsplineMaxIterations" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputbsplineMaxIterations( ) ) ) ,"@@@@@"," --bsplineMaxIterations ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--bsplineSamplingRatio" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputbsplineSamplingRatio( ) ) ) ,"@@@@@"," --bsplineSamplingRatio ") ), Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--controlPointSpacing" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputcontrolPointSpacing( ) ) ) ,"@@@@@"," --controlPointSpacing ") ) }; // EO GENERATED this->execute( lib, _argc, _argv ); } void ExpertAutomatedRegistration::execute ( std::string lib, int _argc, char * _argv[] ) { void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL ); if ( ! handle ) { std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n'; return; } typedef int (*method_t )( int argc, char * argv[] ); // RESET ERROR dlerror( ); // PROTOTYPE method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" ); const char *dlsym_error = dlerror( ); if ( dlsym_error ) { std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n'; dlclose( handle ); return; } // METHOD CALL myMethod( _argc, _argv ); // CLOSING LIB dlclose( handle ); } void ExpertAutomatedRegistration::bbUserSetDefaultValues ( ) { } void ExpertAutomatedRegistration::bbUserInitializeProcessing ( ) { } void ExpertAutomatedRegistration::bbUserFinalizeProcessing ( ) { } } // EO namespace bbSlicer