]> Creatis software - creaCLI.git/blobdiff - ModuleCall/GenSrc/bbSlicerForegroundmaskingBRAINS.cxx
All Slicer modules succesfully compiled into BBTK boxes :P
[creaCLI.git] / ModuleCall / GenSrc / bbSlicerForegroundmaskingBRAINS.cxx
diff --git a/ModuleCall/GenSrc/bbSlicerForegroundmaskingBRAINS.cxx b/ModuleCall/GenSrc/bbSlicerForegroundmaskingBRAINS.cxx
new file mode 100644 (file)
index 0000000..5ba6b77
--- /dev/null
@@ -0,0 +1,63 @@
+#include "bbSlicerForegroundmaskingBRAINS.h"
+#include "bbSlicerPackage.h"
+
+namespace bbSlicer {
+    BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, ForegroundmaskingBRAINS )
+    BBTK_BLACK_BOX_IMPLEMENTATION ( ForegroundmaskingBRAINS, bbtk::AtomicBlackBox );
+
+    void ForegroundmaskingBRAINS::Process ( ) {
+
+        // GENERATED
+
+int _argc =9;
+std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libBRAINSROIAutoLib.so";
+char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--inputVolume"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputVolume( ) ) ) ,"@@@@@"," --inputVolume ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputROIMaskVolume"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputROIMaskVolume( ) ) ) ,"@@@@@"," --outputROIMaskVolume ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputClippedVolumeROI"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputClippedVolumeROI( ) ) ) ,"@@@@@"," --outputClippedVolumeROI ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--otsuPercentileThreshold"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputotsuPercentileThreshold( ) ) ) ,"@@@@@"," --otsuPercentileThreshold ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--thresholdCorrectionFactor"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputthresholdCorrectionFactor( ) ) ) ,"@@@@@"," --thresholdCorrectionFactor ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--closingSize"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputclosingSize( ) ) ) ,"@@@@@"," --closingSize ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--ROIAutoDilateSize"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputROIAutoDilateSize( ) ) ) ,"@@@@@"," --ROIAutoDilateSize ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputVolumePixelType"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputVolumePixelType( ) ) ) ,"@@@@@"," --outputVolumePixelType ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--numberOfThreads"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfThreads( ) ) ) ,"@@@@@"," --numberOfThreads ") ) };
+
+        // EO GENERATED
+        this->execute( lib, _argc, _argv );
+
+    }
+
+    void ForegroundmaskingBRAINS::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 ForegroundmaskingBRAINS::bbUserSetDefaultValues ( ) {
+    }
+
+    void ForegroundmaskingBRAINS::bbUserInitializeProcessing ( ) {
+    }
+
+    void ForegroundmaskingBRAINS::bbUserFinalizeProcessing ( ) {
+    }
+}
+// EO namespace bbSlicer
+
+