]> Creatis software - creaCLI.git/blob - ModuleCall/GenSrc/bbSlicerResampleDTIVolume.cxx
All Slicer modules succesfully compiled into BBTK boxes :P
[creaCLI.git] / ModuleCall / GenSrc / bbSlicerResampleDTIVolume.cxx
1 #include "bbSlicerResampleDTIVolume.h"
2 #include "bbSlicerPackage.h"
3
4 namespace bbSlicer {
5     BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, ResampleDTIVolume )
6     BBTK_BLACK_BOX_IMPLEMENTATION ( ResampleDTIVolume, bbtk::AtomicBlackBox );
7
8     void ResampleDTIVolume::Process ( ) {
9
10         // GENERATED
11
12 int _argc =26;
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libResampleDTILib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputVolume( ) ) ) ,"@@@@@","") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputVolume( ) ) ) ,"@@@@@","") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-R"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputreferenceVolume( ) ) ) ,"@@@@@"," -R ") ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-f"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransformationFile( ) ) ) ,"@@@@@"," -f ") ),
18 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-H"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdeffield( ) ) ) ,"@@@@@"," -H ") ),
19 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--hfieldtype"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtypeOfField( ) ) ) ,"@@@@@"," --hfieldtype ") ),
20 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-i"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinterpolationType( ) ) ) ,"@@@@@"," -i ") ),
21 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--correction"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputcorrection( ) ) ) ,"@@@@@"," --correction ") ),
22 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-T"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputppd( ) ) ) ,"@@@@@"," -T ") ),
23 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--transform_order"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransformsOrder( ) ) ) ,"@@@@@"," --transform_order ") ),
24 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--notbulk"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnotbulk( ) ) ) ,"@@@@@"," --notbulk ") ),
25 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--spaceChange"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputspace( ) ) ) ,"@@@@@"," --spaceChange ") ),
26 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-r"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputrotationPoint( ) ) ) ,"@@@@@"," -r ") ),
27 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-c"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputcenteredTransform( ) ) ) ,"@@@@@"," -c ") ),
28 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--image_center"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputimageCenter( ) ) ) ,"@@@@@"," --image_center ") ),
29 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-b"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinverseITKTransformation( ) ) ) ,"@@@@@"," -b ") ),
30 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-s"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputImageSpacing( ) ) ) ,"@@@@@"," -s ") ),
31 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-z"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputImageSize( ) ) ) ,"@@@@@"," -z ") ),
32 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-O"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputoutputImageOrigin( ) ) ) ,"@@@@@"," -O ") ),
33 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-d"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdirectionMatrix( ) ) ) ,"@@@@@"," -d ") ),
34 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-n"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputnumberOfThread( ) ) ) ,"@@@@@"," -n ") ),
35 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-p"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdefaultPixelValue( ) ) ) ,"@@@@@"," -p ") ),
36 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-W"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputwindowFunction( ) ) ) ,"@@@@@"," -W ") ),
37 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-o"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputsplineOrder( ) ) ) ,"@@@@@"," -o ") ),
38 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-m"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransformMatrix( ) ) ) ,"@@@@@"," -m ") ),
39 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "-t"  ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputtransformType( ) ) ) ,"@@@@@"," -t ") ) };
40
41         // EO GENERATED
42         this->execute( lib, _argc, _argv );
43
44     }
45
46     void ResampleDTIVolume::execute ( std::string lib, int _argc, char * _argv[] ) {
47         void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
48         if ( ! handle ) {
49             std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
50             return;
51         }
52         typedef int (*method_t )( int argc, char * argv[] );
53         // RESET ERROR
54         dlerror( );
55         // PROTOTYPE
56         method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
57         const char *dlsym_error = dlerror( );
58         if ( dlsym_error ) {
59             std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
60             dlclose( handle );
61             return;
62         }
63         // METHOD CALL
64         myMethod( _argc, _argv );
65         // CLOSING LIB
66         dlclose( handle );
67     }
68
69     void ResampleDTIVolume::bbUserSetDefaultValues ( ) {
70     }
71
72     void ResampleDTIVolume::bbUserInitializeProcessing ( ) {
73     }
74
75     void ResampleDTIVolume::bbUserFinalizeProcessing ( ) {
76     }
77 }
78 // EO namespace bbSlicer
79
80