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