]> Creatis software - creaCLI.git/blob - bbtk_Slicer_PKG/src/bbSlicerDemonRegistrationBRAINS.cxx
All Slicer modules succesfully compiled into BBTK boxes :P
[creaCLI.git] / bbtk_Slicer_PKG / src / bbSlicerDemonRegistrationBRAINS.cxx
1 #include "bbSlicerDemonRegistrationBRAINS.h"
2 #include "bbSlicerPackage.h"
3
4 namespace bbSlicer {
5     BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, DemonRegistrationBRAINS )
6     BBTK_BLACK_BOX_IMPLEMENTATION ( DemonRegistrationBRAINS, bbtk::AtomicBlackBox );
7
8     void DemonRegistrationBRAINS::Process ( ) {
9
10         // GENERATED
11
12 int _argc =40;
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libBRAINSDemonWarpLib.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( "--maskProcessingMode"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmaskProcessingMode( ) ) ) ,"@@@@@"," --maskProcessingMode ") ),
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( "-t"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputgradientType( ) ) ) ,"@@@@@"," -t ") ),
47 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-g"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsmoothingUp( ) ) ) ,"@@@@@"," -g ") ),
48 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-l"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmaxStepLength( ) ) ) ,"@@@@@"," -l ") ),
49 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-a"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputturnOffDiffeomorph( ) ) ) ,"@@@@@"," -a ") ),
50 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-G"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputUseDebugImageViewer( ) ) ) ,"@@@@@"," -G ") ),
51 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-p"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputPromptAfterImageSend( ) ) ) ,"@@@@@"," -p ") ),
52 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfBCHApproximationTerms"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfBCHApproximationTerms( ) ) ) ,"@@@@@"," --numberOfBCHApproximationTerms ") ),
53 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfThreads"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfThreads( ) ) ) ,"@@@@@"," --numberOfThreads ") ) };
54
55         // EO GENERATED
56         this->execute( lib, _argc, _argv );
57
58     }
59
60     void DemonRegistrationBRAINS::execute ( std::string lib, int _argc, char * _argv[] ) {
61         void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
62         if ( ! handle ) {
63             std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
64             return;
65         }
66         typedef int (*method_t )( int argc, char * argv[] );
67         // RESET ERROR
68         dlerror( );
69         // PROTOTYPE
70         method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
71         const char *dlsym_error = dlerror( );
72         if ( dlsym_error ) {
73             std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
74             dlclose( handle );
75             return;
76         }
77         // METHOD CALL
78         myMethod( _argc, _argv );
79         // CLOSING LIB
80         dlclose( handle );
81     }
82
83     void DemonRegistrationBRAINS::bbUserSetDefaultValues ( ) {
84     }
85
86     void DemonRegistrationBRAINS::bbUserInitializeProcessing ( ) {
87     }
88
89     void DemonRegistrationBRAINS::bbUserFinalizeProcessing ( ) {
90     }
91 }
92 // EO namespace bbSlicer
93
94