]> Creatis software - creaCLI.git/blob - ModuleCall/GenSrc/bbSlicerExpertAutomatedRegistration.cxx
All Slicer modules succesfully compiled into BBTK boxes :P
[creaCLI.git] / ModuleCall / GenSrc / bbSlicerExpertAutomatedRegistration.cxx
1 #include "bbSlicerExpertAutomatedRegistration.h"
2 #include "bbSlicerPackage.h"
3
4 namespace bbSlicer {
5     BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, ExpertAutomatedRegistration )
6     BBTK_BLACK_BOX_IMPLEMENTATION ( ExpertAutomatedRegistration, bbtk::AtomicBlackBox );
7
8     void ExpertAutomatedRegistration::Process ( ) {
9
10         // GENERATED
11
12 int _argc =28;
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libRegisterImagesModule.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfixedImage( ) ) ) ,"@@@@@","") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmovingImage( ) ) ) ,"@@@@@","") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--resampledImage"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputresampledImage( ) ) ) ,"@@@@@"," --resampledImage ") ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--loadTransform"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputloadTransform( ) ) ) ,"@@@@@"," --loadTransform ") ),
18 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--saveTransform"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsaveTransform( ) ) ) ,"@@@@@"," --saveTransform ") ),
19 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--initialization"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinitialization( ) ) ) ,"@@@@@"," --initialization ") ),
20 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--registration"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputregistration( ) ) ) ,"@@@@@"," --registration ") ),
21 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--metric"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmetric( ) ) ) ,"@@@@@"," --metric ") ),
22 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--expectedOffset"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputexpectedOffset( ) ) ) ,"@@@@@"," --expectedOffset ") ),
23 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--expectedRotation"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputexpectedRotation( ) ) ) ,"@@@@@"," --expectedRotation ") ),
24 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--expectedScale"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputexpectedScale( ) ) ) ,"@@@@@"," --expectedScale ") ),
25 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--expectedSkew"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputexpectedSkew( ) ) ) ,"@@@@@"," --expectedSkew ") ),
26 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--verbosityLevel"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputverbosityLevel( ) ) ) ,"@@@@@"," --verbosityLevel ") ),
27 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--sampleFromOverlap"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsampleFromOverlap( ) ) ) ,"@@@@@"," --sampleFromOverlap ") ),
28 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--fixedImageMask"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfixedImageMask( ) ) ) ,"@@@@@"," --fixedImageMask ") ),
29 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--randomNumberSeed"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputrandomNumberSeed( ) ) ) ,"@@@@@"," --randomNumberSeed ") ),
30 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfThreads"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfThreads( ) ) ) ,"@@@@@"," --numberOfThreads ") ),
31 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--minimizeMemory"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputminimizeMemory( ) ) ) ,"@@@@@"," --minimizeMemory ") ),
32 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--interpolation"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinterpolation( ) ) ) ,"@@@@@"," --interpolation ") ),
33 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--fixedLandmarks"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfixedLandmarks( ) ) ) ,"@@@@@"," --fixedLandmarks ") ),
34 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--movingLandmarks"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmovingLandmarks( ) ) ) ,"@@@@@"," --movingLandmarks ") ),
35 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--rigidMaxIterations"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputrigidMaxIterations( ) ) ) ,"@@@@@"," --rigidMaxIterations ") ),
36 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--rigidSamplingRatio"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputrigidSamplingRatio( ) ) ) ,"@@@@@"," --rigidSamplingRatio ") ),
37 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--affineMaxIterations"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputaffineMaxIterations( ) ) ) ,"@@@@@"," --affineMaxIterations ") ),
38 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--affineSamplingRatio"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputaffineSamplingRatio( ) ) ) ,"@@@@@"," --affineSamplingRatio ") ),
39 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--bsplineMaxIterations"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputbsplineMaxIterations( ) ) ) ,"@@@@@"," --bsplineMaxIterations ") ),
40 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--bsplineSamplingRatio"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputbsplineSamplingRatio( ) ) ) ,"@@@@@"," --bsplineSamplingRatio ") ),
41 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--controlPointSpacing"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputcontrolPointSpacing( ) ) ) ,"@@@@@"," --controlPointSpacing ") ) };
42
43         // EO GENERATED
44         this->execute( lib, _argc, _argv );
45
46     }
47
48     void ExpertAutomatedRegistration::execute ( std::string lib, int _argc, char * _argv[] ) {
49         void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
50         if ( ! handle ) {
51             std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
52             return;
53         }
54         typedef int (*method_t )( int argc, char * argv[] );
55         // RESET ERROR
56         dlerror( );
57         // PROTOTYPE
58         method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
59         const char *dlsym_error = dlerror( );
60         if ( dlsym_error ) {
61             std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
62             dlclose( handle );
63             return;
64         }
65         // METHOD CALL
66         myMethod( _argc, _argv );
67         // CLOSING LIB
68         dlclose( handle );
69     }
70
71     void ExpertAutomatedRegistration::bbUserSetDefaultValues ( ) {
72     }
73
74     void ExpertAutomatedRegistration::bbUserInitializeProcessing ( ) {
75     }
76
77     void ExpertAutomatedRegistration::bbUserFinalizeProcessing ( ) {
78     }
79 }
80 // EO namespace bbSlicer
81
82