]> Creatis software - gdcm.git/commitdiff
Strange name gdcm::SerieHeader turned to gdcm::SerieHelper
authorjpr <jpr>
Wed, 2 Feb 2005 14:26:30 +0000 (14:26 +0000)
committerjpr <jpr>
Wed, 2 Feb 2005 14:26:30 +0000 (14:26 +0000)
Example/CMakeLists.txt
Example/MakeDicomDir.cxx [moved from Example/makeDicomDir.cxx with 94% similarity]
Example/TestChangeHeader.cxx
Example/TestCopyDicom.cxx
Testing/CMakeLists.txt
Testing/TestSerieHelper.cxx [new file with mode: 0644]
src/CMakeLists.txt
src/gdcmDocEntrySet.h

index 45160677e89470f62b538ea88c1807c748a5ccf4..99404d4b808054d4415156568b5b89715401abb2 100644 (file)
@@ -8,7 +8,7 @@ SET(EXAMPLE_SOURCES
   BuildUpDicomDir
   FindTags
   FlatHashTablePrint
-  makeDicomDir
+  MakeDicomDir
   PrintDocument
   PrintFile
   PrintHeader
similarity index 94%
rename from Example/makeDicomDir.cxx
rename to Example/MakeDicomDir.cxx
index 81e3b9cfd3ed8df12ccc57366a59eea9f08ed8c7..9f9ac06b58da7e0deef42d9ae36af37d731b4a70 100644 (file)
@@ -1,10 +1,10 @@
 /*=========================================================================
                                                                                 
   Program:   gdcm
-  Module:    $RCSfile: makeDicomDir.cxx,v $
+  Module:    $RCSfile: MakeDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/02 10:06:32 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2005/02/02 14:26:30 $
+  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
index 4e8b7503f82d68fd620d974f30fbff94085b8f1d..1d74abe2453b4070b471985b0712eb15a57f54b5 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestChangeHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/02 10:06:31 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2005/02/02 14:26:30 $
+  Version:   $Revision: 1.14 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -26,7 +26,7 @@ int main(int argc, char *argv[])
     if (argc < 3)
     {
        std::cerr << "usage :" << std::endl <<
-         argv[0] << " nomFichierPourEntete nomFichierPourDonnées" << 
+         argv[0] << " fileNameForHeader fileNameForData" << 
          std::endl;
        return 1;
     }
@@ -55,5 +55,3 @@ int main(int argc, char *argv[])
 
     return 0;
 }
-
-
index 423a3ded8ce7d0adfa6148b0b3ae75b64848aa49..554f3a5c72a1d87b7b3526ef14369379315a40c1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestCopyDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/02 10:06:31 $
-  Version:   $Revision: 1.23 $
+  Date:      $Date: 2005/02/02 14:26:30 $
+  Version:   $Revision: 1.24 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -57,7 +57,7 @@ bool RemoveFile(const char *source)
 // Here we load a gdcmFile and then try to create from scratch a copy of it,
 // copying field by field the dicom image
 
-int main(int argc, charargv[])
+int main(int argc, char *argv[])
 {
    if (argc < 3)
    {
@@ -112,10 +112,10 @@ int main(int argc, char* argv[])
          else
          {
           // We skip pb of SQ recursive exploration
-          //std::cout << "Skipped Sequence " 
-          //          << "------------- " << d->GetVR() << " "<< std::hex
-          //          << d->GetGroup() << " " << d->GetElement()
-          //  << std::endl;    
+          std::cout << "Skipped Sequence " 
+                    << "------------- " << d->GetVR() << " "<< std::hex
+                    << d->GetGroup() << "," << d->GetElement()
+                    << std::endl;    
          }
 
          d=original->GetFile()->GetNextEntry();
index b3519641382c122ab679e5b4329f6f8c325ed306..a24755439c6e9279429c5b206ef4016f58fe1945 100644 (file)
@@ -22,7 +22,6 @@ SET(TEST_SOURCES
 # add tests that require data
 IF (GDCM_DATA_ROOT)
   SET(TEST_SOURCES ${TEST_SOURCES}
-    TestSerieHeader                  # uses gdcmData as a default root directory    
     TestReadWriteReadCompare.cxx     # includes generated gdcmDataImages.h 
     TestPrintAllDocument.cxx         # includes generated gdcmDataImages.h
     TestAllReadCompareDicom.cxx      # includes generated gdcmDataImages.h
@@ -34,6 +33,7 @@ IF (GDCM_DATA_ROOT)
     TestBuildUpDicomDir.cxx          # writes a file named "NewDICOMDIR"
     TestMakeDicomDir.cxx             # writes a file named "NewDICOMDIR"
     TestDirList.cxx
+    TestSerieHelper                  # uses gdcmData as a default root directory    
   )
   # add test that require VTK:
   IF(GDCM_VTK)
diff --git a/Testing/TestSerieHelper.cxx b/Testing/TestSerieHelper.cxx
new file mode 100644 (file)
index 0000000..a36cfde
--- /dev/null
@@ -0,0 +1,73 @@
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: TestSerieHelper.cxx,v $
+  Language:  C++
+  Date:      $Date: 2005/02/02 14:26:34 $
+  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 "gdcmSerieHelper.h"
+#include "gdcmFile.h"
+#include "gdcmDebug.h"
+#include <iostream>
+
+typedef std::list<gdcm::File* > GdcmFileList;
+
+int TestSerieHelper(int argc, char* argv[])
+{  
+   gdcm::SerieHelper *s;
+  
+   std::string dirName; 
+   if (argc > 1) 
+      dirName = argv[1];    
+   else 
+   {
+      dirName = GDCM_DATA_ROOT;
+   }
+
+   //if (argc > 2)
+   //   gdcm::Debug::SetDebugOn();
+
+   std::cout << "Dir Name :[" << dirName << "]" << std::endl;
+
+   s = new gdcm::SerieHelper();
+   s->SetDirectory(dirName, true); // true : recursive exploration 
+   std::cout << " -------------------------------------------Finish parsing :["
+             << dirName << "]" << std::endl;
+
+   s->Print();
+   std::cout << " -----------------------------------------Finish printing (1)"
+             << std::endl;
+
+   int nbFiles;
+   // For all the Coherent Files lists of the gdcm::Serie
+   GdcmFileList *l = s->GetFirstCoherentFileList();
+   while (l)
+   { 
+      nbFiles = l->size() ;
+      if ( l->size() > 3 ) // Why not ? Just an example, for testing
+      {
+         std::cout << "Sort list : " << nbFiles << " long" << std::endl;
+         s->OrderGdcmFileList(l);  // sort the list
+      }
+      l = s->GetNextCoherentFileList();
+   } 
+   std::cout << " ----------------------------------------------Finish sorting"
+             << std::endl;
+   s->Print(); // Prints all the Coherent Files lists (sorted or not)
+   std::cout << " ---------------------------------------------Finish printing"
+             << std::endl;
+
+   delete s;
+
+   return 0;
+}
index 29b710f9e4d32eff8cb8e79e554a5dd3f61144be..69c3e2f8ded8410dbc615ffba8f9a1b3ef291a7d 100644 (file)
@@ -49,7 +49,7 @@ SET(libgdcm_la_SOURCES
    gdcmRLEFrame.cxx
    gdcmRLEFramesInfo.cxx
    gdcmSeqEntry.cxx
-   gdcmSerieHeader.cxx
+   gdcmSerieHelper.cxx
    gdcmSQItem.cxx
    gdcmTS.cxx
    gdcmUtil.cxx
index 9eaa474bda5e79849999835f733ce3ceccf70cc3..7ac500c8d55d6d5f459dad95bde63a7e4e309a85 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntrySet.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/26 11:42:02 $
-  Version:   $Revision: 1.45 $
+  Date:      $Date: 2005/02/02 14:26:34 $
+  Version:   $Revision: 1.46 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -69,9 +69,9 @@ public:
    /// \brief adds any type of entry to the entry set
    virtual bool AddEntry(DocEntry *Entry) = 0;
    /// \brief Removes any type of entry out of the entry set, and destroys it
-   virtual bool RemoveEntry(DocEntry *EntryToRemove)=0;
+   virtual bool RemoveEntry(DocEntry *EntryToRemove) = 0;
    /// \brief Removes any type of entry out of the entry set, DOESN'T destroy it
-   virtual bool RemoveEntryNoDestroy(DocEntry *EntryToRemove)= 0;
+   virtual bool RemoveEntryNoDestroy(DocEntry *EntryToRemove) = 0;
 
    virtual DocEntry *GetFirstEntry()=0;
    virtual DocEntry *GetNextEntry()=0;
@@ -82,13 +82,13 @@ public:
    virtual std::string GetEntryVR(uint16_t group, uint16_t elem);
 
    /// \brief Gets any type of DocEntry, identified by its (group,elem)
-   virtual DocEntry *GetDocEntry(uint16_t group,uint16_t elem) = 0;
-   /// \brief Gets a ValEntry, identified by its (group,elem)
-   virtual ValEntry *GetValEntry(uint16_t group,uint16_t elem);
+   virtual DocEntry *GetDocEntry(uint16_t group, uint16_t elem) = 0;
+   /// \brief Gets a ValEntry, identified by its (group, elem)
+   virtual ValEntry *GetValEntry(uint16_t group, uint16_t elem);
    /// \brief Gets a BinEntry, identified by its (group,elem)
-   virtual BinEntry *GetBinEntry(uint16_t group,uint16_t elem);
+   virtual BinEntry *GetBinEntry(uint16_t group, uint16_t elem);
    /// \brief Gets a SeqEntry, identified by its (group,elem)
-   virtual SeqEntry *GetSeqEntry(uint16_t group,uint16_t elem);
+   virtual SeqEntry *GetSeqEntry(uint16_t group, uint16_t elem);
 
    virtual bool SetValEntry(std::string const &content,
                             uint16_t group, uint16_t elem);
@@ -116,9 +116,9 @@ public:
 // DocEntry  related utilities 
    ValEntry *NewValEntry(uint16_t group,uint16_t elem,
                          TagName const &vr = GDCM_UNKNOWN);
-   BinEntry *NewBinEntry(uint16_t group,uint16_t elem,
+   BinEntry *NewBinEntry(uint16_t group, uint16_t elem,
                          TagName const &vr = GDCM_UNKNOWN);
-   SeqEntry *NewSeqEntry(uint16_t group,uint16_t elem);
+   SeqEntry *NewSeqEntry(uint16_t group, uint16_t elem);
 
 protected:
 // DictEntry  related utilities