From 4e91acd4c7ffc1eb58f3762419398d8e1d214956 Mon Sep 17 00:00:00 2001 From: jpr Date: Tue, 5 Apr 2005 10:28:59 +0000 Subject: [PATCH] User may now choose whether he wants to load Shadow Groups and Sequences or not --- Example/PrintDocument.cxx | 32 +++++++++++++++++++++++--------- Example/PrintFile.cxx | 29 ++++++++++++++++------------- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/Example/PrintDocument.cxx b/Example/PrintDocument.cxx index c2a6ceec..4d3a2e38 100644 --- a/Example/PrintDocument.cxx +++ b/Example/PrintDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintDocument.cxx,v $ Language: C++ - Date: $Date: 2005/02/02 10:06:31 $ - Version: $Revision: 1.11 $ + Date: $Date: 2005/04/05 10:28:59 $ + Version: $Revision: 1.12 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,20 +16,24 @@ =========================================================================*/ #include "gdcmFile.h" +#include "gdcmDebug.h" #include int main(int argc, char *argv[]) { - gdcm::File *e1; + gdcm::File *e1= new gdcm::File();; std::string fileName; - if (argc != 2) { + if (argc == 1) { std::cout << " Usage : " << argv[0] - << " filename." + << " filename" + << " printLevel debug " + << "short (=NOSEQ + NOSHADOW)" << std::endl; + return 0; } if (argc > 1) { @@ -38,11 +42,21 @@ int main(int argc, char *argv[]) fileName += GDCM_DATA_ROOT; fileName += "/test.acr"; } - - e1= new gdcm::File( fileName.c_str() ); - e1->SetPrintLevel(2); - + if (argc > 2) + { + int level = atoi(argv[2]); + e1->SetPrintLevel(level); + } + + if (argc > 3) + gdcm::Debug::DebugOn(); + + if (argc > 4) + e1->SetLoadMode(NO_SEQ | NO_SHADOW); + + e1->Load( fileName.c_str() ); + e1->Print(); std::cout << "\n\n" << std::endl; diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index 604bd799..6135c783 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/03/02 17:23:32 $ - Version: $Revision: 1.30 $ + Date: $Date: 2005/04/05 10:28:59 $ + Version: $Revision: 1.31 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -25,31 +25,34 @@ int main(int argc, char *argv[]) { gdcm::File *e1; gdcm::FileHelper *f1; - std::string fileName; - if (argc != 2) + std::string fileName; + + if (argc == 1) { - std::cout << " usage : PrintDocument fileName printLevel debug" + std::cout << " usage : PrintFile fileName printLevel debug " + << "short (=NOSEQ + NOSHADOW)" << std::endl; + return 0; } + e1 = new gdcm::File(); + if (argc > 1) { fileName=argv[1]; } - else - { - fileName += GDCM_DATA_ROOT; - fileName += "/test.acr"; - } - if (argc > 3) gdcm::Debug::DebugOn(); + + if (argc > 4) + e1->SetLoadMode(NO_SEQ | NO_SHADOW); - e1 = new gdcm::File( fileName.c_str() ); + e1->Load( fileName.c_str() ); + f1 = new gdcm::FileHelper(e1); - if (argc > 2) + if (argc > 2) // keep it here (f1 needs to be constructed !) { int level = atoi(argv[2]); f1->SetPrintLevel(level); -- 2.45.1