]> Creatis software - creaCLI.git/blobdiff - ModuleCall/GenSrc/bbSlicerMRIBiasFieldCorrection.cxx
All Slicer modules succesfully compiled into BBTK boxes :P
[creaCLI.git] / ModuleCall / GenSrc / bbSlicerMRIBiasFieldCorrection.cxx
diff --git a/ModuleCall/GenSrc/bbSlicerMRIBiasFieldCorrection.cxx b/ModuleCall/GenSrc/bbSlicerMRIBiasFieldCorrection.cxx
new file mode 100644 (file)
index 0000000..61d0ffe
--- /dev/null
@@ -0,0 +1,64 @@
+#include "bbSlicerMRIBiasFieldCorrection.h"
+#include "bbSlicerPackage.h"
+
+namespace bbSlicer {
+    BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, MRIBiasFieldCorrection )
+    BBTK_BLACK_BOX_IMPLEMENTATION ( MRIBiasFieldCorrection, bbtk::AtomicBlackBox );
+
+    void MRIBiasFieldCorrection::Process ( ) {
+
+        // GENERATED
+
+int _argc =10;
+std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libMRIBiasFieldCorrectionLib.so";
+char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--inputImage"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputInputImage( ) ) ) ,"@@@@@"," --inputImage ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--inputMask"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputInputMask( ) ) ) ,"@@@@@"," --inputMask ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputImage"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputOutputImage( ) ) ) ,"@@@@@"," --outputImage ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--algorithmType"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputAlgorithmType( ) ) ) ,"@@@@@"," --algorithmType ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--shrinkFactor"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputShrinkFactor( ) ) ) ,"@@@@@"," --shrinkFactor ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--maximumNumberOfIterations"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputMaximumNumberOfIterations( ) ) ) ,"@@@@@"," --maximumNumberOfIterations ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfFittingLevels"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputNumberOfFittingLevels( ) ) ) ,"@@@@@"," --numberOfFittingLevels ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--wienerFilterNoise"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputWienerFilterNoise( ) ) ) ,"@@@@@"," --wienerFilterNoise ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--fullWidthAtHalfMaximum"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputFullWidthAtHalfMaximum( ) ) ) ,"@@@@@"," --fullWidthAtHalfMaximum ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--convergenceThreshold"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputConvergenceThreshold( ) ) ) ,"@@@@@"," --convergenceThreshold ") ) };
+
+        // EO GENERATED
+        this->execute( lib, _argc, _argv );
+
+    }
+
+    void MRIBiasFieldCorrection::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 MRIBiasFieldCorrection::bbUserSetDefaultValues ( ) {
+    }
+
+    void MRIBiasFieldCorrection::bbUserInitializeProcessing ( ) {
+    }
+
+    void MRIBiasFieldCorrection::bbUserFinalizeProcessing ( ) {
+    }
+}
+// EO namespace bbSlicer
+
+