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::replace_str ( ( Mthd::Aux::toString( bbGetInputpatientName( ) ) ) ,"@@@@@"," --patientName ") ),
15 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--patientID" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputpatientID( ) ) ) ,"@@@@@"," --patientID ") ),
16 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--patientComments" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputpatientComments( ) ) ) ,"@@@@@"," --patientComments ") ),
17 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--studyID" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputstudyID( ) ) ) ,"@@@@@"," --studyID ") ),
18 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--studyDate" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputstudyDate( ) ) ) ,"@@@@@"," --studyDate ") ),
19 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--studyComments" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputstudyComments( ) ) ) ,"@@@@@"," --studyComments ") ),
20 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--studyDescription" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputstudyDescription( ) ) ) ,"@@@@@"," --studyDescription ") ),
21 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--modality" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmodality( ) ) ) ,"@@@@@"," --modality ") ),
22 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--manufacturer" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmanufacturer( ) ) ) ,"@@@@@"," --manufacturer ") ),
23 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--model" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputmodel( ) ) ) ,"@@@@@"," --model ") ),
24 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--seriesNumber" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputseriesNumber( ) ) ) ,"@@@@@"," --seriesNumber ") ),
25 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--seriesDescription" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputseriesDescription( ) ) ) ,"@@@@@"," --seriesDescription ") ),
26 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--rescaleIntercept" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputrescaleIntercept( ) ) ) ,"@@@@@"," --rescaleIntercept ") ),
27 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--rescaleSlope" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputrescaleSlope( ) ) ) ,"@@@@@"," --rescaleSlope ") ),
28 Mthd::Aux::toCharArrray( Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputinputVolume( ) ) ) ,"@@@@@","") ),
29 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--dicomDirectory" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdicomDirectory( ) ) ) ,"@@@@@"," --dicomDirectory ") ),
30 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--dicomPrefix" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdicomPrefix( ) ) ) ,"@@@@@"," --dicomPrefix ") ),
31 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--dicomNumberFormat" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputdicomNumberFormat( ) ) ) ,"@@@@@"," --dicomNumberFormat ") ),
32 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--reverseImages" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputreverseImages( ) ) ) ,"@@@@@"," --reverseImages ") ),
33 Mthd::Aux::toCharArrray( Mthd::Aux::toString( "--useCompression" ) + Mthd::Aux::replace_str ( ( Mthd::Aux::toString( bbGetInputuseCompression( ) ) ) ,"@@@@@"," --useCompression ") ) };
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