]> Creatis software - creaCLI.git/blob - ModuleCall/GenSrc/bbSlicerVectorDemonRegistrationBRAINS.cxx
All Slicer modules succesfully compiled into BBTK boxes :P
[creaCLI.git] / ModuleCall / GenSrc / bbSlicerVectorDemonRegistrationBRAINS.cxx
1 #include "bbSlicerVectorDemonRegistrationBRAINS.h"
2 #include "bbSlicerPackage.h"
3
4 namespace bbSlicer {
5     BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, VectorDemonRegistrationBRAINS )
6     BBTK_BLACK_BOX_IMPLEMENTATION ( VectorDemonRegistrationBRAINS, bbtk::AtomicBlackBox );
7
8     void VectorDemonRegistrationBRAINS::Process ( ) {
9
10         // GENERATED
11
12 int _argc =41;
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libVBRAINSDemonWarpLib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-m"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmovingVolume( ) ) ) ,"@@@@@"," -m ") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-f"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfixedVolume( ) ) ) ,"@@@@@"," -f ") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--inputPixelType"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputPixelType( ) ) ) ,"@@@@@"," --inputPixelType ") ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-o"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputVolume( ) ) ) ,"@@@@@"," -o ") ),
18 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-O"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputDisplacementFieldVolume( ) ) ) ,"@@@@@"," -O ") ),
19 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputPixelType"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputPixelType( ) ) ) ,"@@@@@"," --outputPixelType ") ),
20 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--interpolationMode"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinterpolationMode( ) ) ) ,"@@@@@"," --interpolationMode ") ),
21 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--registrationFilterType"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputregistrationFilterType( ) ) ) ,"@@@@@"," --registrationFilterType ") ),
22 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-s"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsmoothDisplacementFieldSigma( ) ) ) ,"@@@@@"," -s ") ),
23 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-n"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfPyramidLevels( ) ) ) ,"@@@@@"," -n ") ),
24 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--minimumFixedPyramid"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputminimumFixedPyramid( ) ) ) ,"@@@@@"," --minimumFixedPyramid ") ),
25 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--minimumMovingPyramid"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputminimumMovingPyramid( ) ) ) ,"@@@@@"," --minimumMovingPyramid ") ),
26 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-i"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputarrayOfPyramidLevelIterations( ) ) ) ,"@@@@@"," -i ") ),
27 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-e"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputhistogramMatch( ) ) ) ,"@@@@@"," -e ") ),
28 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfHistogramBins"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfHistogramBins( ) ) ) ,"@@@@@"," --numberOfHistogramBins ") ),
29 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfMatchPoints"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfMatchPoints( ) ) ) ,"@@@@@"," --numberOfMatchPoints ") ),
30 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--medianFilterSize"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmedianFilterSize( ) ) ) ,"@@@@@"," --medianFilterSize ") ),
31 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--initializeWithDisplacementField"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinitializeWithDisplacementField( ) ) ) ,"@@@@@"," --initializeWithDisplacementField ") ),
32 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--initializeWithTransform"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinitializeWithTransform( ) ) ) ,"@@@@@"," --initializeWithTransform ") ),
33 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--makeBOBF"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmakeBOBF( ) ) ) ,"@@@@@"," --makeBOBF ") ),
34 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--fixedBinaryVolume"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfixedBinaryVolume( ) ) ) ,"@@@@@"," --fixedBinaryVolume ") ),
35 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--movingBinaryVolume"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmovingBinaryVolume( ) ) ) ,"@@@@@"," --movingBinaryVolume ") ),
36 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--lowerThresholdForBOBF"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputlowerThresholdForBOBF( ) ) ) ,"@@@@@"," --lowerThresholdForBOBF ") ),
37 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--upperThresholdForBOBF"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputupperThresholdForBOBF( ) ) ) ,"@@@@@"," --upperThresholdForBOBF ") ),
38 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--backgroundFillValue"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputbackgroundFillValue( ) ) ) ,"@@@@@"," --backgroundFillValue ") ),
39 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--seedForBOBF"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputseedForBOBF( ) ) ) ,"@@@@@"," --seedForBOBF ") ),
40 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--neighborhoodForBOBF"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputneighborhoodForBOBF( ) ) ) ,"@@@@@"," --neighborhoodForBOBF ") ),
41 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputDisplacementFieldPrefix"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputDisplacementFieldPrefix( ) ) ) ,"@@@@@"," --outputDisplacementFieldPrefix ") ),
42 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputCheckerboardVolume"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputCheckerboardVolume( ) ) ) ,"@@@@@"," --outputCheckerboardVolume ") ),
43 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--checkerboardPatternSubdivisions"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputcheckerboardPatternSubdivisions( ) ) ) ,"@@@@@"," --checkerboardPatternSubdivisions ") ),
44 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputNormalized"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputNormalized( ) ) ) ,"@@@@@"," --outputNormalized ") ),
45 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-v"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputDebug( ) ) ) ,"@@@@@"," -v ") ),
46 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-w"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputweightFactors( ) ) ) ,"@@@@@"," -w ") ),
47 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-t"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputgradientType( ) ) ) ,"@@@@@"," -t ") ),
48 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-g"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsmoothingUp( ) ) ) ,"@@@@@"," -g ") ),
49 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-l"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmaxStepLength( ) ) ) ,"@@@@@"," -l ") ),
50 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-a"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputturnOffDiffeomorph( ) ) ) ,"@@@@@"," -a ") ),
51 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-G"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputUseDebugImageViewer( ) ) ) ,"@@@@@"," -G ") ),
52 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-p"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputPromptAfterImageSend( ) ) ) ,"@@@@@"," -p ") ),
53 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfBCHApproximationTerms"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfBCHApproximationTerms( ) ) ) ,"@@@@@"," --numberOfBCHApproximationTerms ") ),
54 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfThreads"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfThreads( ) ) ) ,"@@@@@"," --numberOfThreads ") ) };
55
56         // EO GENERATED
57         this->execute( lib, _argc, _argv );
58
59     }
60
61     void VectorDemonRegistrationBRAINS::execute ( std::string lib, int _argc, char * _argv[] ) {
62         void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
63         if ( ! handle ) {
64             std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
65             return;
66         }
67         typedef int (*method_t )( int argc, char * argv[] );
68         // RESET ERROR
69         dlerror( );
70         // PROTOTYPE
71         method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
72         const char *dlsym_error = dlerror( );
73         if ( dlsym_error ) {
74             std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
75             dlclose( handle );
76             return;
77         }
78         // METHOD CALL
79         myMethod( _argc, _argv );
80         // CLOSING LIB
81         dlclose( handle );
82     }
83
84     void VectorDemonRegistrationBRAINS::bbUserSetDefaultValues ( ) {
85     }
86
87     void VectorDemonRegistrationBRAINS::bbUserInitializeProcessing ( ) {
88     }
89
90     void VectorDemonRegistrationBRAINS::bbUserFinalizeProcessing ( ) {
91     }
92 }
93 // EO namespace bbSlicer
94
95