]> Creatis software - creaCLI.git/blobdiff - bbtk_Slicer_PKG/src/bbSlicerDemonRegistrationBRAINS.cxx
All Slicer modules succesfully compiled into BBTK boxes :P
[creaCLI.git] / bbtk_Slicer_PKG / src / bbSlicerDemonRegistrationBRAINS.cxx
diff --git a/bbtk_Slicer_PKG/src/bbSlicerDemonRegistrationBRAINS.cxx b/bbtk_Slicer_PKG/src/bbSlicerDemonRegistrationBRAINS.cxx
new file mode 100644 (file)
index 0000000..bef5a5e
--- /dev/null
@@ -0,0 +1,94 @@
+#include "bbSlicerDemonRegistrationBRAINS.h"
+#include "bbSlicerPackage.h"
+
+namespace bbSlicer {
+    BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, DemonRegistrationBRAINS )
+    BBTK_BLACK_BOX_IMPLEMENTATION ( DemonRegistrationBRAINS, bbtk::AtomicBlackBox );
+
+    void DemonRegistrationBRAINS::Process ( ) {
+
+        // GENERATED
+
+int _argc =40;
+std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libBRAINSDemonWarpLib.so";
+char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-m"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmovingVolume( ) ) ) ,"@@@@@"," -m ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-f"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfixedVolume( ) ) ) ,"@@@@@"," -f ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--inputPixelType"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputPixelType( ) ) ) ,"@@@@@"," --inputPixelType ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-o"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputVolume( ) ) ) ,"@@@@@"," -o ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-O"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputDisplacementFieldVolume( ) ) ) ,"@@@@@"," -O ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputPixelType"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputPixelType( ) ) ) ,"@@@@@"," --outputPixelType ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--interpolationMode"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinterpolationMode( ) ) ) ,"@@@@@"," --interpolationMode ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--registrationFilterType"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputregistrationFilterType( ) ) ) ,"@@@@@"," --registrationFilterType ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-s"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsmoothDisplacementFieldSigma( ) ) ) ,"@@@@@"," -s ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-n"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfPyramidLevels( ) ) ) ,"@@@@@"," -n ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--minimumFixedPyramid"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputminimumFixedPyramid( ) ) ) ,"@@@@@"," --minimumFixedPyramid ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--minimumMovingPyramid"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputminimumMovingPyramid( ) ) ) ,"@@@@@"," --minimumMovingPyramid ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-i"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputarrayOfPyramidLevelIterations( ) ) ) ,"@@@@@"," -i ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-e"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputhistogramMatch( ) ) ) ,"@@@@@"," -e ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfHistogramBins"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfHistogramBins( ) ) ) ,"@@@@@"," --numberOfHistogramBins ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfMatchPoints"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfMatchPoints( ) ) ) ,"@@@@@"," --numberOfMatchPoints ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--medianFilterSize"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmedianFilterSize( ) ) ) ,"@@@@@"," --medianFilterSize ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--initializeWithDisplacementField"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinitializeWithDisplacementField( ) ) ) ,"@@@@@"," --initializeWithDisplacementField ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--initializeWithTransform"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinitializeWithTransform( ) ) ) ,"@@@@@"," --initializeWithTransform ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--maskProcessingMode"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmaskProcessingMode( ) ) ) ,"@@@@@"," --maskProcessingMode ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--fixedBinaryVolume"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputfixedBinaryVolume( ) ) ) ,"@@@@@"," --fixedBinaryVolume ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--movingBinaryVolume"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmovingBinaryVolume( ) ) ) ,"@@@@@"," --movingBinaryVolume ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--lowerThresholdForBOBF"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputlowerThresholdForBOBF( ) ) ) ,"@@@@@"," --lowerThresholdForBOBF ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--upperThresholdForBOBF"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputupperThresholdForBOBF( ) ) ) ,"@@@@@"," --upperThresholdForBOBF ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--backgroundFillValue"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputbackgroundFillValue( ) ) ) ,"@@@@@"," --backgroundFillValue ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--seedForBOBF"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputseedForBOBF( ) ) ) ,"@@@@@"," --seedForBOBF ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--neighborhoodForBOBF"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputneighborhoodForBOBF( ) ) ) ,"@@@@@"," --neighborhoodForBOBF ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputDisplacementFieldPrefix"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputDisplacementFieldPrefix( ) ) ) ,"@@@@@"," --outputDisplacementFieldPrefix ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputCheckerboardVolume"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputCheckerboardVolume( ) ) ) ,"@@@@@"," --outputCheckerboardVolume ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--checkerboardPatternSubdivisions"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputcheckerboardPatternSubdivisions( ) ) ) ,"@@@@@"," --checkerboardPatternSubdivisions ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputNormalized"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputNormalized( ) ) ) ,"@@@@@"," --outputNormalized ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-v"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputDebug( ) ) ) ,"@@@@@"," -v ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-t"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputgradientType( ) ) ) ,"@@@@@"," -t ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-g"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsmoothingUp( ) ) ) ,"@@@@@"," -g ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-l"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmaxStepLength( ) ) ) ,"@@@@@"," -l ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-a"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputturnOffDiffeomorph( ) ) ) ,"@@@@@"," -a ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-G"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputUseDebugImageViewer( ) ) ) ,"@@@@@"," -G ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-p"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputPromptAfterImageSend( ) ) ) ,"@@@@@"," -p ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfBCHApproximationTerms"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfBCHApproximationTerms( ) ) ) ,"@@@@@"," --numberOfBCHApproximationTerms ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfThreads"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfThreads( ) ) ) ,"@@@@@"," --numberOfThreads ") ) };
+
+        // EO GENERATED
+        this->execute( lib, _argc, _argv );
+
+    }
+
+    void DemonRegistrationBRAINS::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 DemonRegistrationBRAINS::bbUserSetDefaultValues ( ) {
+    }
+
+    void DemonRegistrationBRAINS::bbUserInitializeProcessing ( ) {
+    }
+
+    void DemonRegistrationBRAINS::bbUserFinalizeProcessing ( ) {
+    }
+}
+// EO namespace bbSlicer
+
+