From 94d13393e488310ea378c26380566596ef208bfd Mon Sep 17 00:00:00 2001 From: jpr Date: Tue, 7 Jun 2005 11:12:10 +0000 Subject: [PATCH] Use Argument Manager in 'utilities' --- Example/Anonymize.cxx | 146 +++++++++++++++++++++++++++ Example/AnonymizeDicomDir.cxx | 59 ++++++----- Example/CMakeLists.txt | 6 +- Example/MakeDicomDir.cxx | 81 ++++++++++----- Example/PrintDicomDir.cxx | 75 +++++++++----- Example/PrintFile.cxx | 40 ++++---- Example/ReWrite.cxx | 181 ++++++++++++++++++++++++++++++++++ 7 files changed, 494 insertions(+), 94 deletions(-) create mode 100644 Example/Anonymize.cxx create mode 100644 Example/ReWrite.cxx diff --git a/Example/Anonymize.cxx b/Example/Anonymize.cxx new file mode 100644 index 00000000..5af051c0 --- /dev/null +++ b/Example/Anonymize.cxx @@ -0,0 +1,146 @@ +/*========================================================================= + + Program: gdcm + Module: $RCSfile: Anonymize.cxx,v $ + Language: C++ + Date: $Date: 2005/06/07 11:12:10 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "gdcmFile.h" +#include "gdcmFileHelper.h" +#include "gdcmCommon.h" +#include "gdcmDebug.h" + +#include "gdcmArgMgr.h" + +#include + +int main(int argc, char *argv[]) +{ + START_USAGE(usage) + " \n Anonymize :\n", + " Anonymize a full gdcm-readable Dicom image", + " Warning : probably segfaults if pixels are not gdcm readable.", + " Use exAnonymizeNoLoad instead.", + " usage: Anonymize filein=inputFileName fileout=anonymizedFileName[debug] ", + " debug : user wants to run the program in 'debug mode' ", + FINISH_USAGE + + // ----- Initialize Arguments Manager ------ + gdcm::ArgMgr *am = new gdcm::ArgMgr(argc, argv); + + if (am->ArgMgrDefined("usage")) + { + am->ArgMgrUsage(usage); // Display 'usage' + delete am; + return 0; + } + char *fileName = am->ArgMgrWantString("filein",usage); + if ( fileName == NULL ) + { + delete am; + return 0; + } + + char *outputFileName = am->ArgMgrWantString("fileout",usage); + if ( outputFileName == NULL ) + { + delete am; + return 0; + } + if (am->ArgMgrDefined("debug")) + gdcm::Debug::DebugOn(); + + // if unused Param we give up + if ( am->ArgMgrPrintUnusedLabels() ) + { + am->ArgMgrUsage(usage); + delete am; + return 0; + } + + delete am; // we don't need Argument Manager any longer + + // ============================================================ + // Read the input file. + // ============================================================ + + gdcm::File *f1; + + f1 = new gdcm::File( fileName ); + if (!f1->IsReadable()) + { + std::cerr << "Sorry, " << fileName <<" not a gdcm-readable " + << "DICOM / ACR File" <GetImageData(); + + if ( imageData == 0 ) + { + std::cerr << "Sorry, Pixels of" << fileName <<" are not " + << " gdcm-readable." << std::endl + << "Use exAnonymizeNoLoad" << std::endl; + delete f1; + delete fh1; + return 0; + } + + // ============================================================ + // Choose the fields to anonymize. + // ============================================================ + // Institution name + f1->AddAnonymizeElement(0x0008, 0x0080, "Xanadoo"); + // Patient's name + f1->AddAnonymizeElement(0x0010, 0x0010, "Fantomas"); + // Patient's ID + f1->AddAnonymizeElement( 0x0010, 0x0020,"1515" ); + // Study Instance UID + f1->AddAnonymizeElement(0x0020, 0x000d, "9.99.999.9999" ); + // Telephone + f1->AddAnonymizeElement(0x0010, 0x2154, "3615" ); + + // Aware user will add more fields to anonymize here + + // The gdcm::File is modified in memory + + f1->AnonymizeFile(); + + // ============================================================ + // Write a new file + // ============================================================ + + fh1->WriteDcmExplVR(outputFileName); + std::cout <<"End Anonymize" << std::cout; + + // ============================================================ + // Remove the Anonymize list + // ============================================================ + f1->ClearAnonymizeList(); + + delete f1; + delete fh1; + return 0; +} + diff --git a/Example/AnonymizeDicomDir.cxx b/Example/AnonymizeDicomDir.cxx index 1c86608c..424390b5 100644 --- a/Example/AnonymizeDicomDir.cxx +++ b/Example/AnonymizeDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: AnonymizeDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/03/09 19:15:04 $ - Version: $Revision: 1.1 $ + Date: $Date: 2005/06/07 11:12:10 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,6 +27,8 @@ #include "gdcmDocument.h" #include "gdcmFile.h" +#include "gdcmArgMgr.h" + #include void AnoNoLoad(gdcm::SQItem *s, std::fstream *fp, @@ -65,45 +67,49 @@ void AnoNoLoad(gdcm::SQItem *s, std::fstream *fp, } int main(int argc, char *argv[]) -{ - gdcm::File *f1; - - gdcm::Debug::DebugOn(); - std::cout << "------------------------------------------------" << std::endl; - std::cout << "Anonymize a gdcm-readable DICOMDIR " << std::endl; - std::cout << "even some Objects are not yet taken into account" << std::endl; - std::cout << "Warning : the DICOMDIR is overwritten" << std::endl; - std::cout << " : to preserve file integrity " - << " think unto using a copy .. " << std::endl; +{ + + START_USAGE(usage) + " \n AnonymizeDicomDir :\n", + " Anonymize a gdcm-readable DICOMDIR ", + " even when some 'Objects' are not yet taken into account", + " Warning : the DICOMDIR is overwritten", + " usage: AnonymizeDicomDir filein=dicomDirName [debug] ", + " debug : user wants to run the program in 'debug mode' ", + FINISH_USAGE + + // ----- Initialize Arguments Manager ------ + gdcm::ArgMgr *am = new gdcm::ArgMgr(argc, argv); + + if (am->ArgMgrDefined("usage")) + { + am->ArgMgrUsage(usage); // Display 'usage' + delete am; + return 0; + } - if( argc < 3 ) - { - std::cerr << "Usage " << argv[0] << " DICOMDIR to anonymize " - << std::endl; - return 1; - } + char *fileName = am->ArgMgrWantString("filein",usage); - std::string fileName = argv[1]; + delete am; // we don't need Argument Manager any longer // ============================================================ // Read the input DICOMDIR // ============================================================ - std::cout << argv[1] << std::endl; - - f1 = new gdcm::File( fileName ); + gdcm::File *f1 = new gdcm::File( fileName ); if (!f1->IsReadable()) { std::cerr << "Sorry, " << fileName <<" not a gdcm-readable " << "file" <GetDocEntry(0x0004, 0x1220); if ( !e ) { std::cout << "No Directory Record Sequence (0004,1220) found" <close(); + delete fp; - + delete e; delete f1; return 0; } diff --git a/Example/CMakeLists.txt b/Example/CMakeLists.txt index 58ec6c0a..b03bbe76 100644 --- a/Example/CMakeLists.txt +++ b/Example/CMakeLists.txt @@ -23,13 +23,15 @@ SET(EXAMPLE_SOURCES FindTags MakeDicomDir AnonymizeDicomDir # without loading it as a gdcm::DicomDir - + Anonymize # for full gdcm readable files + AnonymizeNoLoad # without loading the Pixel Data + ReWrite + #the following will be transformed into 'examples', or 'utilities' # or will be removed # # Better you don't use them (not fully checked ...) - #test FlatHashTablePrint TestCopyDicom TestChangeHeader diff --git a/Example/MakeDicomDir.cxx b/Example/MakeDicomDir.cxx index 0be2432f..72ff4ffa 100644 --- a/Example/MakeDicomDir.cxx +++ b/Example/MakeDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: MakeDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/06/03 15:40:53 $ - Version: $Revision: 1.3 $ + Date: $Date: 2005/06/07 11:12:10 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -21,6 +21,8 @@ #include "gdcmDirList.h" #include "gdcmDebug.h" +#include "gdcmArgMgr.h" + #include // --- @@ -37,7 +39,7 @@ void EndMethod(void *toto) { /** * \ingroup Test - * \brief Explores recursively the given directory (or GDCM_DATA_ROOT by default) + * \brief Explores recursively the given directory * orders the gdcm-readable found Files * according their Patient/Study/Serie/Image characteristics * makes the gdcmDicomDir @@ -46,46 +48,79 @@ void EndMethod(void *toto) { int main(int argc, char *argv[]) { - // gdcm::Debug::DebugOn(); - std::string dirName; - - if (argc > 1) + START_USAGE(usage) + " \n MakeDicomDir :\n", + " Explores recursively the given directory, makes the relevant DICOMDIR", + " and writes it as 'NewDICOMDIR'", + " usage: MakeDicomDir dirname=rootDirectoryName [noshadow] [noseq] [debug] ", + " noshadow : user doesn't want to load Private groups (odd number)", + " noseq : user doesn't want to load Sequences ", + " debug : user wants to run the program in 'debug mode' ", + FINISH_USAGE + + // ----- Initialize Arguments Manager ------ + gdcm::ArgMgr *am = new gdcm::ArgMgr(argc, argv); + + if (am->ArgMgrDefined("usage")) { - dirName = argv[1]; + am->ArgMgrUsage(usage); // Display 'usage' + delete am; + return 0; } + + char *dirName; + dirName = am->ArgMgrGetString("dirName","."); + + int loadMode; + if ( am->ArgMgrDefined("noshadow") && am->ArgMgrDefined("noseq") ) + loadMode = NO_SEQ | NO_SHADOW; + else if ( am->ArgMgrDefined("noshadow") ) + loadMode = NO_SHADOW; + else if ( am->ArgMgrDefined("noseq") ) + loadMode = NO_SEQ; else - { - dirName = GDCM_DATA_ROOT; + loadMode = 0; + + if (am->ArgMgrDefined("debug")) + gdcm::Debug::DebugOn(); + + // if unused Param we give up + if ( am->ArgMgrPrintUnusedLabels() ) + { + am->ArgMgrUsage(usage); + delete am; + return 0; } + delete am; // we don't need Argument Manager any longer + + // ----- Begin Processing ----- + gdcm::DicomDir *dcmdir; - // we ask for Directory parsing - - // Old style (still available) : - // dcmdir = new gdcm::DicomDir(dirName, true); - // new style (user is allowed no to load Sequences an/or Shadow Groups) + // we ask for Directory parsing + dcmdir = new gdcm::DicomDir( ); dcmdir->SetParseDir(true); -// some images have a wrong length for element 0x0000 of private groups -// dcmdir->SetLoadMode(NO_SEQ | NO_SHADOW); - - dcmdir->SetLoadMode(NO_SEQ); - dcmdir->Load(dirName); dcmdir->SetStartMethod(StartMethod, (void *) NULL); dcmdir->SetEndMethod(EndMethod); - + + dcmdir->SetLoadMode(loadMode); + dcmdir->Load(dirName); + + // ----- Check the result + if ( !dcmdir->GetFirstPatient() ) { std::cout << "makeDicomDir: no patient found. Exiting." << std::endl; - delete dcmdir; return 1; } - // Create the corresponding DicomDir + // ----- Create the corresponding DicomDir + dcmdir->WriteDicomDir("NewDICOMDIR"); delete dcmdir; diff --git a/Example/PrintDicomDir.cxx b/Example/PrintDicomDir.cxx index 8d3f714e..e448c2a3 100644 --- a/Example/PrintDicomDir.cxx +++ b/Example/PrintDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/04/26 16:21:54 $ - Version: $Revision: 1.21 $ + Date: $Date: 2005/06/07 11:12:10 $ + Version: $Revision: 1.22 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -25,11 +25,33 @@ #include "gdcmTS.h" #include "gdcmDebug.h" +#include "gdcmArgMgr.h" + #include #include int main(int argc, char* argv[]) -{ +{ + START_USAGE(usage) + " \n PrintDicomDir :\n", + " Display the tree-like structure of a DICOMDIR File", + " usage: PrintDicomDir filein=fileName [level=n] [debug] ", + " detail = 1 : Patients, 2 : Studies, 3 : Series, 4 : Images ", + " 5 : Full Content ", + " level = 0,1,2 : depending on user (what he wants to see)", + " debug : user wants to run the program in 'debug mode' ", + FINISH_USAGE + + // Initialize Arguments Manager + gdcm::ArgMgr *am= new gdcm::ArgMgr(argc, argv); + + if (argc == 1) + { + am->ArgMgrUsage(usage); // Display 'usage' + delete am; + return 0; + } + gdcm::DicomDir *e1; gdcm::TSKey v; @@ -38,19 +60,26 @@ int main(int argc, char* argv[]) gdcm::DicomDirSerie *se; gdcm::DicomDirImage *im; - std::string fileName; - if (argc > 1) - fileName = argv[1]; - else - { - fileName = GDCM_DATA_ROOT; - fileName += "/DICOMDIR"; - } + char *fileName; + fileName = am->ArgMgrWantString("filein",usage); + + int level = am->ArgMgrGetInt("level", 2); + + int detailLevel = am->ArgMgrGetInt("detail", 2); - if (argc > 3) + if (am->ArgMgrDefined("debug")) gdcm::Debug::DebugOn(); - // new style is useless, since it has no effect fore *reading* a DICOMDIR + /* if unused Param we give up */ + if ( am->ArgMgrPrintUnusedLabels() ) + { + am->ArgMgrUsage(usage); + delete e1; + delete am; + return 0; + } + + // new style is useless, since it has no effect for *reading* a DICOMDIR // (only meaningfull when *creating* a DICOMDIR) e1 = new gdcm::DicomDir( fileName ); @@ -70,12 +99,7 @@ int main(int argc, char* argv[]) return 1; } - e1->SetPrintLevel(2); - int detailLevel; - if (argc > 2) - detailLevel = atoi(argv[2]); - else - detailLevel = 3; + e1->SetPrintLevel(level); // Test if the DicomDir contains any Patient pa = e1->GetFirstPatient(); @@ -165,18 +189,23 @@ int main(int argc, char* argv[]) pa = e1->GetFirstPatient(); while ( pa ) { // les PATIENT de ce DICOMDIR - std::cout << pa->GetEntryValue(0x0010, 0x0010) << std::endl; // Patient's Name + // Patient's Name, Patient ID + std::cout << "Pat.Name:[" << pa->GetEntryValue(0x0010, 0x0010) <<"]"; // Patient's Name + std::cout << " Pat.ID:["; + std::cout << pa->GetEntryValue(0x0010, 0x0020) << "]" << std::endl; // Patient ID st = pa->GetFirstStudy(); while ( st ) { // on degouline les STUDY de ce patient - std::cout << "--- "<< st->GetEntryValue(0x0008, 0x1030) << std::endl; // Study Description - std::cout << " Stud.ID:[" << st->GetEntryValue(0x0020, 0x0010); // Study ID + std::cout << "--- Stud.descr:[" << st->GetEntryValue(0x0008, 0x1030) << "]";// Study Description + std::cout << " Stud.ID:[" << st->GetEntryValue(0x0020, 0x0010); // Study ID + std::cout << "]" << std::endl; se = st->GetFirstSerie(); while ( se ) { // on degouline les SERIES de cette study - std::cout << "--- --- "<< se->GetEntryValue(0x0008, 0x103e) << std::endl; // Serie Description + std::cout << "--- --- Ser.Descr:["<< se->GetEntryValue(0x0008, 0x103e)<< "]"; // Series Description std::cout << " Ser.nb:[" << se->GetEntryValue(0x0020, 0x0011); // Series number std::cout << "] Mod.:[" << se->GetEntryValue(0x0008, 0x0060) << "]"; // Modality + std::cout << std::endl; im = se->GetFirstImage(); while ( im ) { // on degouline les Images de cette serie diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index 5e01af3c..0bf9ff33 100644 --- a/Example/PrintFile.cxx +++ b/Example/PrintFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintFile.cxx,v $ Language: C++ - Date: $Date: 2005/06/06 12:41:04 $ - Version: $Revision: 1.37 $ + Date: $Date: 2005/06/07 11:12:10 $ + Version: $Revision: 1.38 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,8 +16,8 @@ =========================================================================*/ #include "gdcmFile.h" -#include "gdcmDebug.h" #include "gdcmFileHelper.h" +#include "gdcmDebug.h" #include "gdcmArgMgr.h" @@ -36,51 +36,49 @@ int main(int argc, char *argv[]) " debug : user wants to run the program in 'debug mode' ", FINISH_USAGE - gdcm::File *e1; - gdcm::FileHelper *f1; - char *fileName; - // Initialize Arguments Manager gdcm::ArgMgr *am= new gdcm::ArgMgr(argc, argv); - if (argc == 1) + if (argc == 1) { am->ArgMgrUsage(usage); // Display 'usage' delete am; return 0; } - fileName = am->ArgMgrWantString("filein",usage); - - if (am->ArgMgrDefined("debug")) - gdcm::Debug::DebugOn(); - - e1 = new gdcm::File(); + char *fileName = am->ArgMgrWantString("filein",usage); + int loadMode; if ( am->ArgMgrDefined("noshadow") && am->ArgMgrDefined("noseq") ) - e1->SetLoadMode(NO_SEQ | NO_SHADOW); + loadMode = NO_SEQ | NO_SHADOW; else if ( am->ArgMgrDefined("noshadow") ) - e1->SetLoadMode(NO_SHADOW); + loadMode = NO_SHADOW; else if ( am->ArgMgrDefined("noseq") ) - e1->SetLoadMode(NO_SEQ); + loadMode = NO_SEQ; + else + loadMode = 0; int level = am->ArgMgrGetInt("level", 2); + if (am->ArgMgrDefined("debug")) + gdcm::Debug::DebugOn(); + /* if unused Param we give up */ if ( am->ArgMgrPrintUnusedLabels() ) { am->ArgMgrUsage(usage); - delete e1; delete am; return 0; } - bool res; // gdcm::File::IsReadable() is no usable here, because we deal with // any kind of gdcm-Parsable *document* // not only gdcm::File (as opposed to gdcm::DicomDir) - res = e1->Load( fileName ); + gdcm::File *e1 = new gdcm::File(); + e1->SetLoadMode(loadMode); + + bool res = e1->Load( fileName ); if ( !res ) { delete e1; @@ -88,7 +86,7 @@ int main(int argc, char *argv[]) return 0; } - f1 = new gdcm::FileHelper(e1); + gdcm::FileHelper *f1 = new gdcm::FileHelper(e1); f1->SetPrintLevel( level ); f1->Print(); diff --git a/Example/ReWrite.cxx b/Example/ReWrite.cxx new file mode 100644 index 00000000..ee5583c2 --- /dev/null +++ b/Example/ReWrite.cxx @@ -0,0 +1,181 @@ +/*========================================================================= + + Program: gdcm + Module: $RCSfile: ReWrite.cxx,v $ + Language: C++ + Date: $Date: 2005/06/07 11:12:10 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "gdcmFile.h" +#include "gdcmFileHelper.h" +#include "gdcmDebug.h" + +#include "gdcmArgMgr.h" + +#include + +int main(int argc, char *argv[]) +{ + START_USAGE(usage) + " \n ReWrite :\n", + " Re write a full gdcm-readable Dicom image", + " (usefull when the file header is not very straight).", + " ", + " usage: ReWrite filein=inputFileName fileout=anonymizedFileName ", + " [mode=write mode] [noshadow] [noseq][debug] ", + " mode = a (ACR), x (Explicit VR Dicom), r (RAW : only pixels)", + " noshadow : user doesn't want to load Private groups (odd number)", + " noseq : user doesn't want to load Sequences ", + " debug : user wants to run the program in 'debug mode' ", + FINISH_USAGE + + // ----- Initialize Arguments Manager ------ + gdcm::ArgMgr *am = new gdcm::ArgMgr(argc, argv); + + if (am->ArgMgrDefined("usage")) + { + am->ArgMgrUsage(usage); // Display 'usage' + delete am; + return 0; + } + char *fileName = am->ArgMgrWantString("filein",usage); + if ( fileName == NULL ) + { + delete am; + return 0; + } + + char *outputFileName = am->ArgMgrWantString("fileout",usage); + if ( outputFileName == NULL ) + { + delete am; + return 0; + } + + char *mode = am->ArgMgrGetString("filein","X"); + + int loadMode; + if ( am->ArgMgrDefined("noshadow") && am->ArgMgrDefined("noseq") ) + loadMode = NO_SEQ | NO_SHADOW; + else if ( am->ArgMgrDefined("noshadow") ) + loadMode = NO_SHADOW; + else if ( am->ArgMgrDefined("noseq") ) + loadMode = NO_SEQ; + else + loadMode = 0; + + if (am->ArgMgrDefined("debug")) + gdcm::Debug::DebugOn(); + + // if unused Param we give up + if ( am->ArgMgrPrintUnusedLabels() ) + { + am->ArgMgrUsage(usage); + delete am; + return 0; + } + + delete am; // we don't need Argument Manager any longer + + void *imageData; + int dataSize; + + gdcm::File *e1 = new gdcm::File(); + e1->SetLoadMode(loadMode); + + bool res = e1->Load( fileName ); + if ( !res ) + { + delete e1; + delete am; + return 0; + } + if (!e1->IsReadable()) + { + std::cerr << "Sorry, not a Readable DICOM / ACR File" <GetImageDataSize(); + std::cout <GetXSize(); + nY=e1->GetYSize(); + nZ=e1->GetZSize(); + std::cout << " DIMX=" << nX << " DIMY=" << nY << " DIMZ=" << nZ << std::endl; + + pixelType = e1->GetPixelType(); + sPP = e1->GetSamplesPerPixel(); + planarConfig = e1->GetPlanarConfiguration(); + + std::cout << " pixelType=" << pixelType + << " SampleserPixel=" << sPP + << " PlanarConfiguration=" << planarConfig + << " PhotometricInterpretation=" + << e1->GetEntryValue(0x0028,0x0004) + << std::endl; + + int numberOfScalarComponents=e1->GetNumberOfScalarComponents(); + std::cout << "NumberOfScalarComponents " << numberOfScalarComponents <GetTransferSyntaxName(); + std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl; + + imageData= f1->GetImageData(); + + switch (mode[0]) + { + case 'A' : + // Writting an ACR file + // from a full gdcm readable File + + std::cout << "WriteACR" << std::endl; + f1->WriteAcr(outputFileName); + break; + + case 'D' : // Not documented in the 'usage', because the method is known to be bugged. + + // Writting a DICOM Implicit VR file + // from a full gdcm readable File + + std::cout << "WriteDCM Implicit VR" << std::endl; + f1->WriteDcmImplVR(outputFileName); + break; + + case 'X' : + // writting a DICOM Explicit VR + // from a full gdcm readable File + + std::cout << "WriteDCM Explicit VR" << std::endl; + f1->WriteDcmExplVR(outputFileName); + break; + + case 'R' : + // Writting a Raw File, + + std::cout << "WriteRaw" << std::endl; + f1->WriteRawData(outputFileName); + break; + + } + delete e1; + delete f1; + delete am; + return 0; +} + -- 2.45.1