1 #include "bbSlicerCreateaDICOMSeries.h"
2 #include "bbSlicerPackage.h"
5 BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, CreateaDICOMSeries )
6 BBTK_BLACK_BOX_IMPLEMENTATION ( CreateaDICOMSeries, bbtk::AtomicBlackBox );
8 void CreateaDICOMSeries::Process ( ) {
13 std::string lib = "/home/riveros/.slicer/Slicer4-bin/Slicer-build/lib/Slicer-4.0/cli-modules/libImageReadDicomWriteLib.so";
14 char * _argv[ ] = { Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--patientName" ) + Mthd::Aux::toString( bbGetInputpatientName( ) ) ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--patientID" ) + Mthd::Aux::toString( bbGetInputpatientID( ) ) ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--patientComments" ) + Mthd::Aux::toString( bbGetInputpatientComments( ) ) ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--studyID" ) + Mthd::Aux::toString( bbGetInputstudyID( ) ) ),
18 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--studyDate" ) + Mthd::Aux::toString( bbGetInputstudyDate( ) ) ),
19 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--studyComments" ) + Mthd::Aux::toString( bbGetInputstudyComments( ) ) ),
20 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--studyDescription" ) + Mthd::Aux::toString( bbGetInputstudyDescription( ) ) ),
21 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--modality" ) + Mthd::Aux::toString( bbGetInputmodality( ) ) ),
22 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--manufacturer" ) + Mthd::Aux::toString( bbGetInputmanufacturer( ) ) ),
23 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--model" ) + Mthd::Aux::toString( bbGetInputmodel( ) ) ),
24 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--seriesNumber" ) + Mthd::Aux::toString( bbGetInputseriesNumber( ) ) ),
25 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--seriesDescription" ) + Mthd::Aux::toString( bbGetInputseriesDescription( ) ) ),
26 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--rescaleIntercept" ) + Mthd::Aux::toString( bbGetInputrescaleIntercept( ) ) ),
27 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--rescaleSlope" ) + Mthd::Aux::toString( bbGetInputrescaleSlope( ) ) ),
28 Mthd::Aux::toCharArrray( Mthd::Aux::toString( bbGetInputinputVolume( ) ) ),
29 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--dicomDirectory" ) + Mthd::Aux::toString( bbGetInputdicomDirectory( ) ) ),
30 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--dicomPrefix" ) + Mthd::Aux::toString( bbGetInputdicomPrefix( ) ) ),
31 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--dicomNumberFormat" ) + Mthd::Aux::toString( bbGetInputdicomNumberFormat( ) ) ),
32 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--reverseImages" ) + Mthd::Aux::toString( bbGetInputreverseImages( ) ) ),
33 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--useCompression" ) + Mthd::Aux::toString( bbGetInputuseCompression( ) ) ) };
36 this->execute( lib, _argc, _argv );
40 void CreateaDICOMSeries::execute ( std::string lib, int _argc, char * _argv[] ) {
41 void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
43 std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
46 typedef int (*method_t )( int argc, char * argv[] );
50 method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
51 const char *dlsym_error = dlerror( );
53 std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
58 myMethod( _argc, _argv );
63 void CreateaDICOMSeries::bbUserSetDefaultValues ( ) {
66 void CreateaDICOMSeries::bbUserInitializeProcessing ( ) {
69 void CreateaDICOMSeries::bbUserFinalizeProcessing ( ) {
72 // EO namespace bbSlicer