]> Creatis software - gdcm.git/commitdiff
Minor modifications
authorjpr <jpr>
Fri, 23 Mar 2007 14:59:58 +0000 (14:59 +0000)
committerjpr <jpr>
Fri, 23 Mar 2007 14:59:58 +0000 (14:59 +0000)
Example/AnonymizeDicomDir.cxx
Example/MakeDicomDir.cxx
Example/ReWrite.cxx
Example/exMoveImagesToSingleSerieUID.cxx
Example/exOverlaysDCM.cxx

index 747714b538ff476dd775f5c4c4d9f03e06177204..475f3a0287239b49d8786b43e1320f03fe85cba4 100644 (file)
@@ -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 ------   
index c3ea3e2d27a34be73a99fcd5ff666a1613e7b26d..db9f3c8e27a91a1f5c99095530d4495255c25cf1 100644 (file)
@@ -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();
index ac672f06f28e53daebbd247d1d60cc1977404830..8e8836b95a1632b7d340659b9fb12d14f26b24af 100644 (file)
@@ -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;
      
index dadcec914ade4342fed80fa9882588df86e89e91..ff014c9b105bb2278e12656ca97efd30d18e2e2a 100755 (executable)
@@ -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 
index b3371917a1b157c0cee8e2638c2a6ec0b2b7986e..956d9ae031af6b9134697989f4a4a2956abe6702 100755 (executable)
@@ -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() )
    {