X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=ModuleCall%2FGenSrc%2FbbSlicerForegroundmaskingBRAINS.cxx;fp=ModuleCall%2FGenSrc%2FbbSlicerForegroundmaskingBRAINS.cxx;h=5ba6b7798aa9cb2d989b24ee7b8e55d7d948e734;hb=e7b4e2c9254e9e431f74acc92e3f0d40fc5e7ef6;hp=0000000000000000000000000000000000000000;hpb=cd590ce5fff20d69c7060340235a35e9c2a9ef86;p=creaCLI.git diff --git a/ModuleCall/GenSrc/bbSlicerForegroundmaskingBRAINS.cxx b/ModuleCall/GenSrc/bbSlicerForegroundmaskingBRAINS.cxx new file mode 100644 index 0000000..5ba6b77 --- /dev/null +++ b/ModuleCall/GenSrc/bbSlicerForegroundmaskingBRAINS.cxx @@ -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 + +