From 209f09716365d35c7cdc5b94684d1d1fb00335c7 Mon Sep 17 00:00:00 2001 From: jpr Date: Fri, 23 Mar 2007 14:59:58 +0000 Subject: [PATCH] Minor modifications --- Example/AnonymizeDicomDir.cxx | 16 ++++++++-------- Example/MakeDicomDir.cxx | 16 ++++++++-------- Example/ReWrite.cxx | 6 +++--- Example/exMoveImagesToSingleSerieUID.cxx | 10 +++++----- Example/exOverlaysDCM.cxx | 24 +++++++++++++++++++++++- 5 files changed, 47 insertions(+), 25 deletions(-) diff --git a/Example/AnonymizeDicomDir.cxx b/Example/AnonymizeDicomDir.cxx index 747714b5..475f3a02 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/10/25 14:52:26 $ - Version: $Revision: 1.9 $ + Date: $Date: 2007/03/23 14:59:58 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -75,12 +75,12 @@ int main(int argc, char *argv[]) { 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' ", + " \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 : developper wants to run the program in 'debug mode' ", FINISH_USAGE // ----- Initialize Arguments Manager ------ diff --git a/Example/MakeDicomDir.cxx b/Example/MakeDicomDir.cxx index c3ea3e2d..db9f3c8e 100644 --- a/Example/MakeDicomDir.cxx +++ b/Example/MakeDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: MakeDicomDir.cxx,v $ Language: C++ - Date: $Date: 2006/07/18 10:12:56 $ - Version: $Revision: 1.22 $ + Date: $Date: 2007/03/23 14:59:58 $ + Version: $Revision: 1.23 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) " noshadowseq: user doesn't want to load Private Sequences ", " 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' ", + " debug : developper wants to run the program in 'debug mode' ", " check : the dicomdir is checked as 'gdcm readable' ", FINISH_USAGE @@ -98,8 +98,6 @@ int main(int argc, char *argv[]) // ----- Begin Processing ----- gdcm::DicomDir *dcmdir; - - // we ask for Directory parsing @@ -110,8 +108,10 @@ int main(int argc, char *argv[]) //dcmdir->SetParseDir(true); // struct tms tms1, tms2; // Time measurements - // times(&tms1); - dcmdir->Load(); + // times(&tms1); + + dcmdir->Load(); // Reads all the files and creates the gdcm::DicomDir + //times(&tms2); //std::cout // << (long) ((tms2.tms_utime) - (tms1.tms_utime)) @@ -130,7 +130,7 @@ int main(int argc, char *argv[]) return 1; } - // ----- Create the corresponding DicomDir + // ----- Writes the corresponding DICOMDIR file (from the gdcm::DicomDir) dcmdir->Write(name); dcmdir->Delete(); diff --git a/Example/ReWrite.cxx b/Example/ReWrite.cxx index ac672f06..8e8836b9 100644 --- a/Example/ReWrite.cxx +++ b/Example/ReWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: ReWrite.cxx,v $ Language: C++ - Date: $Date: 2007/03/06 10:19:00 $ - Version: $Revision: 1.21 $ + Date: $Date: 2007/03/23 14:59:58 $ + 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 @@ -323,7 +323,7 @@ int main(int argc, char *argv[]) if (beg == -1) beg = 0; if (end == -1) - end = nZ; + end = nZ-1; std::ostringstream str; diff --git a/Example/exMoveImagesToSingleSerieUID.cxx b/Example/exMoveImagesToSingleSerieUID.cxx index dadcec91..ff014c9b 100755 --- a/Example/exMoveImagesToSingleSerieUID.cxx +++ b/Example/exMoveImagesToSingleSerieUID.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: exMoveImagesToSingleSerieUID.cxx,v $ Language: C++ - Date: $Date: 2006/07/19 09:04:46 $ - Version: $Revision: 1.2 $ + Date: $Date: 2007/03/23 14:59:58 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -33,9 +33,9 @@ Converts the a Dicom file inside a single-level Directory exMoveImagesToSingleSerieUID dirin=inputDirectoryName dirout=outputDirectoryName - [studyUID = ] [patName = ] [Zspacing = ] - [ { [noshadowseq] | [noshadow][noseq] } ] [debug] - [verbose]", + [studyUID = ] [patName = ] [Zspacing = ] + [ { [noshadowseq] | [noshadow][noseq] } ] [debug] + [verbose]", dirin : single-level Directory containing the images diff --git a/Example/exOverlaysDCM.cxx b/Example/exOverlaysDCM.cxx index b3371917..956d9ae0 100755 --- a/Example/exOverlaysDCM.cxx +++ b/Example/exOverlaysDCM.cxx @@ -43,12 +43,31 @@ int main(int argc, char *argv[]) delete am; return 0; } + +/* char *fileName = am->ArgMgrWantString("filein",usage); if ( fileName == NULL ) { delete am; return 0; } +*/ + + + const char *fileName = am->ArgMgrGetString("filein"); + const char *dirName = am->ArgMgrGetString("dirin"); + + if ( (fileName == 0 && dirName == 0) || + (fileName != 0 && dirName != 0) ) + { + std::cerr << std::endl + << "Either 'filein=' or 'dirin=' must be present;" + << std::endl << "Not both" << std::endl; + am->ArgMgrUsage(usage); // Display 'usage' + delete am; + return 1; + } + char *outputFileName = am->ArgMgrWantString("fileout",usage); if ( outputFileName == NULL ) @@ -58,7 +77,10 @@ int main(int argc, char *argv[]) } if (am->ArgMgrDefined("debug")) gdcm::Debug::DebugOn(); - + + if (am->ArgMgrDefined("warning")) + gdcm::Debug::WarningOn(); + // if unused Param we give up if ( am->ArgMgrPrintUnusedLabels() ) { -- 2.48.1