]> Creatis software - creaCLI.git/blobdiff - ModuleCall/GenSrc/bbSlicerResampleDTIVolume.cxx
All Slicer modules succesfully compiled into BBTK boxes :P
[creaCLI.git] / ModuleCall / GenSrc / bbSlicerResampleDTIVolume.cxx
diff --git a/ModuleCall/GenSrc/bbSlicerResampleDTIVolume.cxx b/ModuleCall/GenSrc/bbSlicerResampleDTIVolume.cxx
new file mode 100644 (file)
index 0000000..1584f25
--- /dev/null
@@ -0,0 +1,80 @@
+#include "bbSlicerResampleDTIVolume.h"
+#include "bbSlicerPackage.h"
+
+namespace bbSlicer {
+    BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, ResampleDTIVolume )
+    BBTK_BLACK_BOX_IMPLEMENTATION ( ResampleDTIVolume, bbtk::AtomicBlackBox );
+
+    void ResampleDTIVolume::Process ( ) {
+
+        // GENERATED
+
+int _argc =26;
+std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libResampleDTILib.so";
+char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputVolume( ) ) ) ,"@@@@@","") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputVolume( ) ) ) ,"@@@@@","") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-R"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputreferenceVolume( ) ) ) ,"@@@@@"," -R ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-f"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransformationFile( ) ) ) ,"@@@@@"," -f ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-H"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdeffield( ) ) ) ,"@@@@@"," -H ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--hfieldtype"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtypeOfField( ) ) ) ,"@@@@@"," --hfieldtype ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-i"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinterpolationType( ) ) ) ,"@@@@@"," -i ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--correction"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputcorrection( ) ) ) ,"@@@@@"," --correction ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-T"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputppd( ) ) ) ,"@@@@@"," -T ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--transform_order"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransformsOrder( ) ) ) ,"@@@@@"," --transform_order ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--notbulk"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnotbulk( ) ) ) ,"@@@@@"," --notbulk ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--spaceChange"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputspace( ) ) ) ,"@@@@@"," --spaceChange ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-r"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputrotationPoint( ) ) ) ,"@@@@@"," -r ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-c"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputcenteredTransform( ) ) ) ,"@@@@@"," -c ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--image_center"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputimageCenter( ) ) ) ,"@@@@@"," --image_center ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-b"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinverseITKTransformation( ) ) ) ,"@@@@@"," -b ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-s"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputImageSpacing( ) ) ) ,"@@@@@"," -s ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-z"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputImageSize( ) ) ) ,"@@@@@"," -z ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-O"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputImageOrigin( ) ) ) ,"@@@@@"," -O ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-d"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdirectionMatrix( ) ) ) ,"@@@@@"," -d ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-n"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfThread( ) ) ) ,"@@@@@"," -n ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-p"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdefaultPixelValue( ) ) ) ,"@@@@@"," -p ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-W"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputwindowFunction( ) ) ) ,"@@@@@"," -W ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-o"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsplineOrder( ) ) ) ,"@@@@@"," -o ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-m"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransformMatrix( ) ) ) ,"@@@@@"," -m ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-t"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransformType( ) ) ) ,"@@@@@"," -t ") ) };
+
+        // EO GENERATED
+        this->execute( lib, _argc, _argv );
+
+    }
+
+    void ResampleDTIVolume::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 ResampleDTIVolume::bbUserSetDefaultValues ( ) {
+    }
+
+    void ResampleDTIVolume::bbUserInitializeProcessing ( ) {
+    }
+
+    void ResampleDTIVolume::bbUserFinalizeProcessing ( ) {
+    }
+}
+// EO namespace bbSlicer
+
+