+#include "bbSlicerBSplinetodeformationfield.h"
+#include "bbSlicerPackage.h"
+
+namespace bbSlicer {
+ BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, BSplinetodeformationfield )
+ BBTK_BLACK_BOX_IMPLEMENTATION ( BSplinetodeformationfield, bbtk::AtomicBlackBox );
+
+ void BSplinetodeformationfield::Process ( ) {
+
+ // GENERATED
+
+int _argc =3;
+std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libBSplineToDeformationFieldLib.so";
+char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--tfm" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputTransformName( ) ) ) ,"@@@@@"," --tfm ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--refImage" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputreferenceImageName( ) ) ) ,"@@@@@"," --refImage ") ),
+Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--defImage" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdeformationFieldName( ) ) ) ,"@@@@@"," --defImage ") ) };
+
+ // EO GENERATED
+ this->execute( lib, _argc, _argv );
+
+ }
+
+ void BSplinetodeformationfield::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 BSplinetodeformationfield::bbUserSetDefaultValues ( ) {
+ }
+
+ void BSplinetodeformationfield::bbUserInitializeProcessing ( ) {
+ }
+
+ void BSplinetodeformationfield::bbUserFinalizeProcessing ( ) {
+ }
+}
+// EO namespace bbSlicer
+
+