1 #include "bbSlicerDicomtoNrrdConverter.h"
2 #include "bbSlicerPackage.h"
5 BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, DicomtoNrrdConverter )
6 BBTK_BLACK_BOX_IMPLEMENTATION ( DicomtoNrrdConverter, bbtk::AtomicBlackBox );
8 void DicomtoNrrdConverter::Process ( ) {
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libDicomToNrrdConverterLib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--inputDicomDirectory" ) + Mthd::Aux::toString( bbGetInputinputDicomDirectory( ) ) ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputDirectory" ) + Mthd::Aux::toString( bbGetInputoutputDirectory( ) ) ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--outputVolume" ) + Mthd::Aux::toString( bbGetInputoutputVolume( ) ) ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--smallGradientThreshold" ) + Mthd::Aux::toString( bbGetInputsmallGradientThreshold( ) ) ),
18 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--writeProtocolGradientsFile" ) + Mthd::Aux::toString( bbGetInputwriteProtocolGradientsFile( ) ) ),
19 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--useIdentityMeaseurementFrame" ) + Mthd::Aux::toString( bbGetInputuseIdentityMeaseurementFrame( ) ) ),
20 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--useBMatrixGradientDirections" ) + Mthd::Aux::toString( bbGetInputuseBMatrixGradientDirections( ) ) ) };
23 this->execute( lib, _argc, _argv );
27 void DicomtoNrrdConverter::execute ( std::string lib, int _argc, char * _argv[] ) {
28 void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
30 std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
33 typedef int (*method_t )( int argc, char * argv[] );
37 method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
38 const char *dlsym_error = dlerror( );
40 std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
45 myMethod( _argc, _argv );
50 void DicomtoNrrdConverter::bbUserSetDefaultValues ( ) {
53 void DicomtoNrrdConverter::bbUserInitializeProcessing ( ) {
56 void DicomtoNrrdConverter::bbUserFinalizeProcessing ( ) {
59 // EO namespace bbSlicer