]> Creatis software - gdcm.git/commitdiff
* src/*.cxx : first parss to normalize file organisation
authorregrain <regrain>
Tue, 1 Feb 2005 10:29:54 +0000 (10:29 +0000)
committerregrain <regrain>
Tue, 1 Feb 2005 10:29:54 +0000 (10:29 +0000)
   -- BeNours

42 files changed:
ChangeLog
src/gdcmBase.cxx
src/gdcmBinEntry.cxx
src/gdcmDebug.cxx
src/gdcmDebug.h
src/gdcmDicomDir.cxx
src/gdcmDicomDir.h
src/gdcmDicomDirElement.cxx
src/gdcmDicomDirImage.cxx
src/gdcmDicomDirMeta.cxx
src/gdcmDicomDirObject.cxx
src/gdcmDicomDirPatient.cxx
src/gdcmDicomDirSerie.cxx
src/gdcmDicomDirStudy.cxx
src/gdcmDict.cxx
src/gdcmDictEntry.cxx
src/gdcmDictSet.cxx
src/gdcmDirList.cxx
src/gdcmDocEntry.cxx
src/gdcmDocEntryArchive.cxx
src/gdcmDocEntrySet.cxx
src/gdcmDocument.cxx
src/gdcmElementSet.cxx
src/gdcmException.cxx
src/gdcmFile.cxx
src/gdcmFileHelper.cxx
src/gdcmGlobal.cxx
src/gdcmGlobal.h
src/gdcmJPEGFragment.cxx
src/gdcmJPEGFragmentsInfo.cxx
src/gdcmJpeg2000.cxx
src/gdcmPixelReadConvert.cxx
src/gdcmPixelWriteConvert.cxx
src/gdcmRLEFrame.cxx
src/gdcmRLEFramesInfo.cxx
src/gdcmSQItem.cxx
src/gdcmSeqEntry.cxx
src/gdcmSerieHeader.cxx
src/gdcmTS.cxx
src/gdcmUtil.cxx
src/gdcmVR.cxx
src/gdcmValEntry.cxx

index eadc05b30f5b4d0baf592a19f4dbbbce90410641..423712f11a2a8a710fcf16dd9790a0319860d5fc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2005-01-31 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+  * src/*.cxx : first parss to normalize file organisation
+
 2005-01-31 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
   * src/gdcmDirList.[h|cxx] : add method to find a directory
   * Test/TestAllReadCompareDicom.cxx : bug fix under Windows
index dcba3c95fdda028bdbdfa735ab18d077397ddec6..3a94b08b132ed79845ee31fc54f50abfafc78b6f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmBase.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/23 10:12:32 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2005/02/01 10:29:54 $
+  Version:   $Revision: 1.9 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -39,6 +39,15 @@ Base::~Base()
 { 
 }
 
+//-----------------------------------------------------------------------------
+// Public
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
 //-----------------------------------------------------------------------------
 // Print
 /**
@@ -50,15 +59,6 @@ void Base::Print(std::ostream &, std::string const & )
 {
 }
 
-//-----------------------------------------------------------------------------
-// Public
-
-//-----------------------------------------------------------------------------
-// Protected
-
-//-----------------------------------------------------------------------------
-// Private
-
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
 
index 037db638ea6d91394b33e68ab3f4284547e1993f..37e9267fa3d44fafc10868d35623e77536c11281 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmBinEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/30 17:30:57 $
-  Version:   $Revision: 1.59 $
+  Date:      $Date: 2005/02/01 10:29:54 $
+  Version:   $Revision: 1.60 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
-
 /**
  * \brief   Constructor from a given BinEntry
  */
@@ -64,40 +62,6 @@ BinEntry::~BinEntry()
    }
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Prints a BinEntry (Dicom entry)
- * @param   os ostream we want to print in
- * @param indent Indentation string to be prepended during printing
- */
-void BinEntry::Print(std::ostream &os, std::string const & )
-{
-   os << "B ";
-   DocEntry::Print(os);
-   std::ostringstream s;
-   void* binArea = GetBinArea();
-   if (binArea)
-   {
-      //s << " [" << GDCM_BINLOADED 
-      s << " [" << GetValue()
-        << "; length = " << GetLength() << "]";
-   }
-   else
-   {
-      if ( GetLength() == 0 )
-      {
-         s << " []";
-      }
-      else 
-      {
-         //s << " [gdcm::Binary data NOT loaded]";
-         s << " [" <<GetValue() << "]";
-      }         
-   }
-   os << s.str();
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -189,5 +153,39 @@ void BinEntry::SetBinArea( uint8_t *area, bool self )
 //-----------------------------------------------------------------------------
 // Private
    
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Prints a BinEntry (Dicom entry)
+ * @param   os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
+ */
+void BinEntry::Print(std::ostream &os, std::string const & )
+{
+   os << "B ";
+   DocEntry::Print(os);
+   std::ostringstream s;
+   void* binArea = GetBinArea();
+   if (binArea)
+   {
+      //s << " [" << GDCM_BINLOADED 
+      s << " [" << GetValue()
+        << "; length = " << GetLength() << "]";
+   }
+   else
+   {
+      if ( GetLength() == 0 )
+      {
+         s << " []";
+      }
+      else 
+      {
+         //s << " [gdcm::Binary data NOT loaded]";
+         s << " [" <<GetValue() << "]";
+      }         
+   }
+   os << s.str();
+}
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
index 82ced4141d27c695ad8e4630adafaa88f2ddc7ca..855ef638dc30529a43cffe648d6328ca37c3ef78 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDebug.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/30 17:30:57 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2005/02/01 10:29:54 $
+  Version:   $Revision: 1.20 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 namespace gdcm 
 {
-
-/// warning message level to be displayed
+//-----------------------------------------------------------------------------
+// Warning message level to be displayed
 static bool DebugFlag   = false;
 static bool DebugToFile = false;
 static std::ofstream DebugFile;
 
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
-
 Debug::Debug()
 {
 
@@ -48,7 +46,6 @@ Debug::~Debug()
 
 //-----------------------------------------------------------------------------
 // Public
-
 /**
  * \brief   Accessor
  * @param   flag Set the debug flag
index edb114fd5f05420043d3401c7ee4f93e8aaae5fa..75d700ce90af33f52501e949ed2896c9c7885c7e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDebug.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 12:19:33 $
-  Version:   $Revision: 1.26 $
+  Date:      $Date: 2005/02/01 10:29:54 $
+  Version:   $Revision: 1.27 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -50,17 +50,17 @@ public:
 
    /// This is a global flag that controls whether any debug, warning
    /// messages are displayed.
-   static bool GetDebugFlag ();
    static void SetDebugFlag (bool flag);
-   static void SetDebugOn  () { SetDebugFlag(true);  };
-   static void SetDebugOff () { SetDebugFlag(false); };
+   static bool GetDebugFlag ();
+   static void DebugOn  () { SetDebugFlag(true);  };
+   static void DebugOff () { SetDebugFlag(false); };
 
    /// This is a global flag that controls if debug are redirected
    /// to a file or not
-   static bool GetDebugToFile ();
    static void SetDebugToFile (bool flag);
-   static void SetDebugToFileOn  () { SetDebugToFile(true);  };
-   static void SetDebugToFileOff () { SetDebugToFile(false); };
+   static bool GetDebugToFile ();
+   static void DebugToFileOn  () { SetDebugToFile(true);  };
+   static void DebugToFileOff () { SetDebugToFile(false); };
 
    /// Set the filename the debug stream should be redirect to
    /// Settting a filename also set DebugToFile to true
index 7eb67e4af159aed227c28cecbc381c59cf50bde5..6894e088b968254f3988a0d23ffa5b6475e4142b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/29 11:43:05 $
-  Version:   $Revision: 1.122 $
+  Date:      $Date: 2005/02/01 10:29:54 $
+  Version:   $Revision: 1.123 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
   
 =========================================================================*/
 
+//-----------------------------------------------------------------------------
+//  For full DICOMDIR description, see:
+//  PS 3.3-2003, pages 731-750
+//-----------------------------------------------------------------------------
 #include "gdcmDicomDir.h"
 #include "gdcmDicomDirStudy.h"
 #include "gdcmDicomDirSerie.h"
 
 namespace gdcm 
 {
-
-//-----------------------------------------------------------------------------
-//  For full DICOMDIR description, see:
-//  PS 3.3-2003, pages 731-750
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
-
 /**
  * \brief   Constructor : creates an empty DicomDir
  */
@@ -153,29 +152,6 @@ DicomDir::~DicomDir()
    }
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief  Canonical Printer 
- * @param   os ostream we want to print in
- * @param indent Indentation string to be prepended during printing
- */
-void DicomDir::Print(std::ostream &os, std::string const & )
-{
-   if( MetaElems )
-   {
-      MetaElems->SetPrintLevel(PrintLevel);
-      MetaElems->Print(os);   
-   }   
-   for(ListDicomDirPatient::iterator cc  = Patients.begin();
-                                     cc != Patients.end();
-                                   ++cc)
-   {
-     (*cc)->SetPrintLevel(PrintLevel);
-     (*cc)->Print(os);
-   }
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -398,7 +374,6 @@ bool DicomDir::WriteDicomDir(std::string const &fileName)
 
 //-----------------------------------------------------------------------------
 // Protected
-
 /**
  * \brief create a Document-like chained list from a root Directory 
  * @param path entry point of the tree-like structure
@@ -658,7 +633,6 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type,
    }
 }
 
-//-----------------------------------------------------------------------------
 /**
  * \brief   CallStartMethod
  */
@@ -672,7 +646,6 @@ void DicomDir::CallStartMethod()
    }
 }
 
-//-----------------------------------------------------------------------------
 /**
  * \brief   CallProgressMethod
  */
@@ -684,7 +657,6 @@ void DicomDir::CallProgressMethod()
    }
 }
 
-//-----------------------------------------------------------------------------
 /**
  * \brief   CallEndMethod
  */
@@ -991,3 +963,26 @@ bool DicomDir::HeaderLessThan(Document *header1, Document *header2)
 } // end namespace gdcm
 
 //-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief  Canonical Printer 
+ * @param   os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
+ */
+void DicomDir::Print(std::ostream &os, std::string const & )
+{
+   if( MetaElems )
+   {
+      MetaElems->SetPrintLevel(PrintLevel);
+      MetaElems->Print(os);   
+   }   
+   for(ListDicomDirPatient::iterator cc  = Patients.begin();
+                                     cc != Patients.end();
+                                   ++cc)
+   {
+     (*cc)->SetPrintLevel(PrintLevel);
+     (*cc)->Print(os);
+   }
+}
+
+//-----------------------------------------------------------------------------
index 39c703b8595a924ba525f4ea9c75c82966e69ee4..b54a54d1799225d4c1247c3f9ad4d94b6fb925c6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/25 11:11:58 $
-  Version:   $Revision: 1.50 $
+  Date:      $Date: 2005/02/01 10:29:54 $
+  Version:   $Revision: 1.51 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -39,7 +39,6 @@ typedef std::list<DicomDirPatient *>   ListDicomDirPatient;
 typedef std::vector<Document *>  VectDocument;
 
 //-----------------------------------------------------------------------------
-
 /**
  * \ingroup DicomDir
  * \brief   DicomDir defines an object representing a DICOMDIR in memory
index 9d0bd87822e784090c3694e50b0b8b810f5f98ae..66665db6476f68e3f32eac05dbd24fd609bbf2b6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirElement.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/28 17:01:29 $
-  Version:   $Revision: 1.32 $
+  Date:      $Date: 2005/02/01 10:29:54 $
+  Version:   $Revision: 1.33 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 namespace gdcm 
 {
+//-----------------------------------------------------------------------------
 void FillDefaultDIRDict(DicomDirElement *dde);
+
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
-
 /**
  * \brief   constructor : populates the chained lists 
  *          from the file 'Dicts/DicomDir.dic'
@@ -104,6 +105,44 @@ DicomDirElement::~DicomDirElement()
    DicomDirImageList.clear();
 }
 
+//-----------------------------------------------------------------------------
+// Public
+/**
+ * \brief Add an entry 
+ * @param type type
+ * @param elem elem
+ */
+bool DicomDirElement::AddEntry(DicomDirType type, Element const &elem)
+{
+   switch( type )
+   {
+      case DD_META :
+         DicomDirMetaList.push_back(elem);
+         break;
+      case DD_PATIENT :
+         DicomDirPatientList.push_back(elem);
+         break;
+      case DD_STUDY :
+         DicomDirStudyList.push_back(elem);
+         break;
+      case DD_SERIE :
+         DicomDirSerieList.push_back(elem);
+         break;
+      case DD_IMAGE :
+         DicomDirImageList.push_back(elem);
+         break;
+      default :
+         return false;
+   }
+   return true;
+}
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
 //-----------------------------------------------------------------------------
 // Print
 /**
@@ -156,42 +195,4 @@ void DicomDirElement::Print(std::ostream &os)
 }
 
 //-----------------------------------------------------------------------------
-// Public
-/**
- * \brief Add an entry 
- * @param type type
- * @param elem elem
- */
-bool DicomDirElement::AddEntry(DicomDirType type, Element const &elem)
-{
-   switch( type )
-   {
-      case DD_META :
-         DicomDirMetaList.push_back(elem);
-         break;
-      case DD_PATIENT :
-         DicomDirPatientList.push_back(elem);
-         break;
-      case DD_STUDY :
-         DicomDirStudyList.push_back(elem);
-         break;
-      case DD_SERIE :
-         DicomDirSerieList.push_back(elem);
-         break;
-      case DD_IMAGE :
-         DicomDirImageList.push_back(elem);
-         break;
-      default :
-         return false;
-   }
-   return true;
-}
-//-----------------------------------------------------------------------------
-// Protected
-
-//-----------------------------------------------------------------------------
-// Private
-
-//-----------------------------------------------------------------------------
-
 } // end namespace gdcm
index a7024f1f4e53a766372ac7e807cc2067aa17d09a..8950538cd4cb904b97bbba041b92bb4e9de4ffd9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirImage.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/28 17:01:29 $
-  Version:   $Revision: 1.21 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  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
@@ -46,6 +46,15 @@ DicomDirImage::~DicomDirImage()
 {
 }
 
+//-----------------------------------------------------------------------------
+// Public
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
 //-----------------------------------------------------------------------------
 // Print
 /**
@@ -71,15 +80,6 @@ void DicomDirImage::Print(std::ostream &os, std::string const & )
    DicomDirObject::Print(os);
 }
 
-//-----------------------------------------------------------------------------
-// Public
-
-//-----------------------------------------------------------------------------
-// Protected
-
-//-----------------------------------------------------------------------------
-// Private
-
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
 
index 11602a6659824365deb59109a39c39d97e2e4307..ec3d35b4d4ca69c3dcc1af5f9c7d371f2f8bd535 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirMeta.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:52 $
-  Version:   $Revision: 1.26 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.27 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
-
 /**
  * \brief  Constructor
  */ 
@@ -48,32 +46,8 @@ DicomDirMeta::~DicomDirMeta()
 {
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Prints the Meta Elements
- * @param os ostream to write to 
- * @param indent Indentation string to be prepended during printing
- */ 
-void DicomDirMeta::Print(std::ostream &os, std::string const & )
-{
-   os << "META" << std::endl;
-   // warning : META doesn't behave exactly like a Objet 
-   for (ListDocEntry::iterator i = DocEntries.begin();
-        i != DocEntries.end();
-        ++i)
-   {
-      (*i)->SetPrintLevel(PrintLevel);
-      (*i)->Print();
-      os << std::endl;
-   }
-}
-
-
 //-----------------------------------------------------------------------------
 // Public
-
-
 /**
  * \brief   Writes the Meta Elements
  * @param fp ofstream to write to
@@ -96,5 +70,26 @@ void DicomDirMeta::WriteContent(std::ofstream *fp, FileType filetype)
 //-----------------------------------------------------------------------------
 // Private
 
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Prints the Meta Elements
+ * @param os ostream to write to 
+ * @param indent Indentation string to be prepended during printing
+ */ 
+void DicomDirMeta::Print(std::ostream &os, std::string const & )
+{
+   os << "META" << std::endl;
+   // warning : META doesn't behave exactly like a Objet 
+   for (ListDocEntry::iterator i = DocEntries.begin();
+        i != DocEntries.end();
+        ++i)
+   {
+      (*i)->SetPrintLevel(PrintLevel);
+      (*i)->Print();
+      os << std::endl;
+   }
+}
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
index 2495ac01dfcd5d8f6bdb056bb287bdb89f5bed2d..e81d6b77294bdae4b7dde26c8ccf2a8e5bebb942 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirObject.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 14:14:11 $
-  Version:   $Revision: 1.18 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.19 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -24,7 +24,6 @@
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 /**
  * \brief  Constructor 
@@ -79,5 +78,8 @@ void DicomDirObject::FillObject(ListDicomDirMetaElem const &elemList)
 //-----------------------------------------------------------------------------
 // Private
 
+//-----------------------------------------------------------------------------
+// Print
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
index ea7d00fc7d7c13dd0686ed64e37b5625048f48cd..c35b2f10a939d97715c2de7f5e3bf15560de9a88 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirPatient.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 12:19:33 $
-  Version:   $Revision: 1.35 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.36 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -25,7 +25,6 @@
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
@@ -51,27 +50,6 @@ DicomDirPatient::~DicomDirPatient()
    ClearStudy();
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Prints the Object
- * @param os ostream to write to 
- * @param indent Indentation string to be prepended during printing
- */ 
-void DicomDirPatient::Print(std::ostream &os, std::string const & )
-{
-   os << "PATIENT" << std::endl;
-   DicomDirObject::Print(os);
-
-   for(ListDicomDirStudy::const_iterator cc = Studies.begin();
-                                         cc != Studies.end(); 
-                                       ++cc )
-   {
-      (*cc)->SetPrintLevel(PrintLevel);
-      (*cc)->Print(os);
-   }
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -164,5 +142,26 @@ DicomDirStudy *DicomDirPatient::GetLastStudy()
 //-----------------------------------------------------------------------------
 // Private
 
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Prints the Object
+ * @param os ostream to write to 
+ * @param indent Indentation string to be prepended during printing
+ */ 
+void DicomDirPatient::Print(std::ostream &os, std::string const & )
+{
+   os << "PATIENT" << std::endl;
+   DicomDirObject::Print(os);
+
+   for(ListDicomDirStudy::const_iterator cc = Studies.begin();
+                                         cc != Studies.end(); 
+                                       ++cc )
+   {
+      (*cc)->SetPrintLevel(PrintLevel);
+      (*cc)->Print(os);
+   }
+}
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
index 7dfcfdfddcc44d3638054109c8ddc6fe41183721..16e7e4f22c3a3393392f71a91b082dc546ffb6a1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirSerie.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/28 17:01:29 $
-  Version:   $Revision: 1.36 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.37 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -24,7 +24,6 @@
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
@@ -50,27 +49,6 @@ DicomDirSerie::~DicomDirSerie()
    ClearImage();
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Prints the Object
- * @param os ostream to write to
- * @param indent Indentation string to be prepended during printing
- */ 
-void DicomDirSerie::Print(std::ostream &os, std::string const &)
-{
-   os << "SERIE" << std::endl;
-   DicomDirObject::Print(os);
-
-   for(ListDicomDirImage::iterator cc = Images.begin();
-                                   cc != Images.end();
-                                   ++cc)
-   {
-      (*cc)->SetPrintLevel(PrintLevel);
-      (*cc)->Print(os);
-   }
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -149,6 +127,25 @@ DicomDirImage *DicomDirSerie::GetNextImage()
 // Private
 
 //-----------------------------------------------------------------------------
-} // end namespace gdcm
+// Print
+/**
+ * \brief   Prints the Object
+ * @param os ostream to write to
+ * @param indent Indentation string to be prepended during printing
+ */ 
+void DicomDirSerie::Print(std::ostream &os, std::string const &)
+{
+   os << "SERIE" << std::endl;
+   DicomDirObject::Print(os);
 
+   for(ListDicomDirImage::iterator cc = Images.begin();
+                                   cc != Images.end();
+                                   ++cc)
+   {
+      (*cc)->SetPrintLevel(PrintLevel);
+      (*cc)->Print(os);
+   }
+}
 
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
index 6cac6bebf371a0fa0ca63239620a82a5dfbbfa20..0c6fab78c45c06872e70d0eb8bd6f455c7229498 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirStudy.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 12:19:33 $
-  Version:   $Revision: 1.34 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.35 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -49,28 +49,6 @@ DicomDirStudy::~DicomDirStudy()
    ClearSerie();
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Prints the Object
- * @param os ostream to write to 
- * @param indent Indentation string to be prepended during printing
- * @return
- */ 
-void DicomDirStudy::Print(std::ostream &os, std::string const & )
-{
-   os << "STUDY" << std::endl;
-   DicomDirObject::Print(os);
-
-   for(ListDicomDirSerie::iterator cc = Series.begin();
-                                   cc != Series.end();
-                                   ++cc)
-   {
-      (*cc)->SetPrintLevel(PrintLevel);
-      (*cc)->Print(os);
-   }
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -165,5 +143,26 @@ DicomDirSerie *DicomDirStudy::GetLastSerie()
 // Private
 
 //-----------------------------------------------------------------------------
-} // end namespace gdcm
+// Print
+/**
+ * \brief   Prints the Object
+ * @param os ostream to write to 
+ * @param indent Indentation string to be prepended during printing
+ * @return
+ */ 
+void DicomDirStudy::Print(std::ostream &os, std::string const & )
+{
+   os << "STUDY" << std::endl;
+   DicomDirObject::Print(os);
 
+   for(ListDicomDirSerie::iterator cc = Series.begin();
+                                   cc != Series.end();
+                                   ++cc)
+   {
+      (*cc)->SetPrintLevel(PrintLevel);
+      (*cc)->Print(os);
+   }
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
index 6287e9aa522325a18510c310e401801b9ae41c3c..d867b3da2cf38ece7ec886a5eed9607cffa9f394 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDict.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 14:14:11 $
-  Version:   $Revision: 1.70 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.71 $
                                                                                 
   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,9 @@
 
 namespace gdcm 
 {
+//-----------------------------------------------------------------------------
 void FillDefaultDataDict(Dict *d);
+
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
@@ -85,33 +87,6 @@ Dict::~Dict()
    ClearEntry();
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Print all the dictionary entries contained in this dictionary.
- *          Entries will be sorted by tag i.e. the couple (group, element).
- * @param   os The output stream to be written to.
- * @param indent Indentation string to be prepended during printing
- */
-void Dict::Print(std::ostream &os, std::string const & )
-{
-   os << "Dict file name : " << Filename << std::endl;
-   std::ostringstream s;
-
-   for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag)
-   {
-      s << "Entry : ";
-      s << "(" << std::hex << std::setw(4) << tag->second.GetGroup() << ',';
-      s << std::hex << std::setw(4) << tag->second.GetElement() << ") = "
-        << std::dec;
-      s << tag->second.GetVR() << ", ";
-      s << tag->second.GetVM() << ", ";
-      s << tag->second.GetName() << "."  << std::endl;
-   }
-   os << s.str();
-}
-
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -247,5 +222,30 @@ DictEntry *Dict::GetNextEntry()
 // Private
 
 //-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Print all the dictionary entries contained in this dictionary.
+ *          Entries will be sorted by tag i.e. the couple (group, element).
+ * @param   os The output stream to be written to.
+ * @param indent Indentation string to be prepended during printing
+ */
+void Dict::Print(std::ostream &os, std::string const & )
+{
+   os << "Dict file name : " << Filename << std::endl;
+   std::ostringstream s;
 
+   for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag)
+   {
+      s << "Entry : ";
+      s << "(" << std::hex << std::setw(4) << tag->second.GetGroup() << ',';
+      s << std::hex << std::setw(4) << tag->second.GetElement() << ") = "
+        << std::dec;
+      s << tag->second.GetVR() << ", ";
+      s << tag->second.GetVM() << ", ";
+      s << tag->second.GetName() << "."  << std::endl;
+   }
+   os << s.str();
+}
+
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
index 7c64268a0d35afba40fb079c8604997419f565f6..1d0c7a5a693b29ca2ec762b094793c960f01a761 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDictEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/23 10:12:33 $
-  Version:   $Revision: 1.43 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.44 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -25,7 +25,6 @@
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
@@ -50,35 +49,6 @@ DictEntry::DictEntry(uint16_t group, uint16_t elem,
    Key     = TranslateToKey(group, elem);
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Prints an entry of the Dicom DictionaryEntry
- * @param   os ostream we want to print in
- * @param indent Indentation string to be prepended during printing
- */
-void DictEntry::Print(std::ostream &os, std::string const & )
-{
-   std::string vr;
-   std::ostringstream s;
-
-   vr = GetVR();
-   if(vr==GDCM_UNKNOWN)
-      vr="  ";
-
-   s << DictEntry::TranslateToKey(GetGroup(),GetElement()); 
-   s << " [" << vr  << "] ";
-
-   if (PrintLevel >= 1)
-   {
-      s.setf(std::ios::left);
-      s << std::setw(66-GetName().length()) << " ";
-   }
-
-   s << "[" << GetName()<< "]";
-   os << s.str() << std::endl;
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -93,7 +63,6 @@ TagKey DictEntry::TranslateToKey(uint16_t group, uint16_t elem)
    return Util::Format("%04x|%04x", group, elem);
 }
 
-//-----------------------------------------------------------------------------
 /**
  * \brief       If-and only if-the V(alue) R(epresentation)
  * \            is unset then overwrite it.
@@ -111,7 +80,6 @@ void DictEntry::SetVR(TagName const &vr)
    }
 }
 
-//-----------------------------------------------------------------------------
 /**
  * \brief       If-and only if-the V(alue) M(ultiplicity)
  * \            is unset then overwrite it.
@@ -134,6 +102,35 @@ void DictEntry::SetVM(TagName const &vm)
 //-----------------------------------------------------------------------------
 // Private
 
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Prints an entry of the Dicom DictionaryEntry
+ * @param   os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
+ */
+void DictEntry::Print(std::ostream &os, std::string const & )
+{
+   std::string vr;
+   std::ostringstream s;
+
+   vr = GetVR();
+   if(vr==GDCM_UNKNOWN)
+      vr="  ";
+
+   s << DictEntry::TranslateToKey(GetGroup(),GetElement()); 
+   s << " [" << vr  << "] ";
+
+   if (PrintLevel >= 1)
+   {
+      s.setf(std::ios::left);
+      s << std::setw(66-GetName().length()) << " ";
+   }
+
+   s << "[" << GetName()<< "]";
+   os << s.str() << std::endl;
+}
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
 
index c9cdfbcfb66a3544144ce1871779e8c3883f52d0..02063318609651db2274c2b8e6a0a0a1285a7196 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDictSet.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/23 10:12:33 $
-  Version:   $Revision: 1.56 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.57 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -59,75 +59,8 @@ DictSet::~DictSet()
    VirtualEntry.clear();
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Print, in an informal fashion, the list of all the dictionaries
- *          contained is this DictSet, along with their respective content.
- * @param   os Output stream used for printing.
- * @param indent Indentation string to be prepended during printing
- */
-void DictSet::Print(std::ostream &os, std::string const & )
-{
-   for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict)
-   {
-      os << "Printing dictionary " << dict->first << std::endl;
-      dict->second->Print(os);
-   }
-}
-
 //-----------------------------------------------------------------------------
 // Public
-/** 
- * \brief   Consider all the entries of the public dicom dictionary. 
- *          Build all list of all the tag names of all those entries.
- * \sa DictSet::GetPubDictTagNamesByCategory
- * @return  A list of all entries of the public dicom dictionary.
- */
-
-// Probabely useless!
-//EntryNamesList *DictSet::GetPubDictEntryNames() 
-//{
-//   return GetDefaultPubDict()->GetDictEntryNames();
-//}
-
-/** 
- * \brief   
- *          - Consider all the entries of the public dicom dictionary.
- *          - Build an hashtable whose keys are the names of the groups
- *           (fourth field in each line of dictionary) and whose corresponding
- *           values are lists of all the dictionary entries among that
- *           group. Note that apparently the Dicom standard doesn't explicitely
- *           define a name (as a string) for each group.
- *           NO ! Dicom Standard explicitely doesn't define 
- *                any name, for any group !
- *          - A typical usage of this method would be to enable a dynamic
- *           configuration of a Dicom file browser: the admin/user can
- *           select in the interface which Dicom tags should be displayed.
- * \warning 
- *          - Dicom *doesn't* define any name for any 'categorie'
- *          (the dictionary fourth field was formerly NIH defined
- *           -and no longer he is-
- *           and will be removed when Dicom provides us a text file
- *           with the 'official' Dictionary, that would be more friendly
- *           than asking us to perform a line by line check of the dictionary
- *           at the beginning of each year to -try to- guess the changes)
- *          - Therefore : please NEVER use that fourth field :-(
- * *
- * @return  An hashtable: whose keys are the names of the groups and whose
- *          corresponding values are lists of all the dictionary entries
- *          among that group.
- */
-
-
-// Probabely useless!
-//EntryNamesByCatMap *DictSet::GetPubDictEntryNamesByCategory() 
-//{
-//   return GetDefaultPubDict()->GetDictEntryNamesByCategory();
-//}
-
 /**
  * \brief   Loads a dictionary from a specified file, and add it
  *          to already the existing ones contained in this DictSet.
@@ -224,7 +157,6 @@ std::string DictSet::BuildDictPath()
    return resultPath;
 }
 
-
 /**
  * \brief   Get the first entry while visiting the DictSet
  * \return  The first Dict if found, otherwhise NULL
@@ -254,7 +186,6 @@ Dict *DictSet::GetNextEntry()
 
 //-----------------------------------------------------------------------------
 // Protected
-
 /**
  * \brief   Adds a Dictionary to a DictSet
  * \return  always true
@@ -270,5 +201,21 @@ bool DictSet::AppendDict(Dict *newDict, DictKey const &name)
 // Private
 
 //-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Print, in an informal fashion, the list of all the dictionaries
+ *          contained is this DictSet, along with their respective content.
+ * @param   os Output stream used for printing.
+ * @param indent Indentation string to be prepended during printing
+ */
+void DictSet::Print(std::ostream &os, std::string const & )
+{
+   for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict)
+   {
+      os << "Printing dictionary " << dict->first << std::endl;
+      dict->second->Print(os);
+   }
+}
 
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
index 4656a2c16d7fdf865acf537b5d50c01dcb9f630c..0600fd16a8e686120c1f775a1f32deda94378038 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDirList.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/01 10:00:34 $
-  Version:   $Revision: 1.41 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.42 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -32,6 +32,7 @@
 
 namespace gdcm 
 {
+//-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
  * \brief Constructor  
@@ -53,7 +54,6 @@ DirList::~DirList()
 
 //-----------------------------------------------------------------------------
 // Public
-
 /**
  * \brief   Print method
  * @param os ostream to write to 
@@ -69,7 +69,6 @@ void DirList::Print(std::ostream &os)
 
 //-----------------------------------------------------------------------------
 // Private
-
 /**
  * \brief   Explore a directory with possibility of recursion
  *          return number of files read
@@ -161,6 +160,8 @@ bool DirList::IsDirectory(std::string const &dirName)
 #endif
 }
 
-} // end namespace gdcm
+//-----------------------------------------------------------------------------
+// Print
 
 //-----------------------------------------------------------------------------
+} // end namespace gdcm
index a1f5882ed1d3916c72db66824daac467dbab6fb9..d90383c0822c693e498073f278bb4a4969f5f22c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/30 17:30:57 $
-  Version:   $Revision: 1.49 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.50 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -28,6 +28,7 @@
 
 namespace gdcm 
 {
+//-----------------------------------------------------------------------------
 #define MAX_SIZE_PRINT_ELEMENT_VALUE 64
 
 //-----------------------------------------------------------------------------
@@ -48,70 +49,6 @@ DocEntry::DocEntry(DictEntry *in)
    Length = 0;
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Prints the common part of ValEntry, BinEntry, SeqEntry
- * @param   os ostream we want to print in
- * @param indent Indentation string to be prepended during printing
- */
-void DocEntry::Print(std::ostream &os, std::string const & )
-{
-   size_t o;
-   std::string st;
-   TSKey v;
-   std::string d2, vr;
-   std::ostringstream s;
-   uint32_t lgth;
-
-   o  = GetOffset();
-   vr = GetVR();
-   if(vr==GDCM_UNKNOWN)
-      vr="  ";
-
-   s << DictEntry::TranslateToKey(GetGroup(),GetElement()); 
-
-   if (PrintLevel >= 2)
-   {
-      s << " lg : ";
-      lgth = GetReadLength(); // ReadLength, as opposed to Length
-      if (lgth == 0xffffffff)
-      {
-         st = Util::Format("x(ffff)");  // I said : "x(ffff)" !
-         s.setf(std::ios::left);
-         s << std::setw(10-st.size()) << " ";  
-         s << st << " ";
-         s.setf(std::ios::left);
-         s << std::setw(8) << "-1"; 
-      }
-      else
-      {
-         st = Util::Format("x(%x)",lgth);
-         s.setf(std::ios::left);
-         s << std::setw(10-st.size()) << " ";
-         s << st << " ";
-         s.setf(std::ios::left);
-         s << std::setw(8) << lgth; 
-      }
-      s << " Off.: ";
-      st = Util::Format("x(%x)",o); 
-      s << std::setw(10-st.size()) << " ";
-      s << st << " ";
-      s << std::setw(8) << o; 
-   }
-
-   s << "[" << vr  << "] ";
-
-   if (PrintLevel >= 1)
-   {
-      s.setf(std::ios::left);
-      s << std::setw(66-GetName().length()) << " ";
-   }
-    
-   s << "[" << GetName()<< "]";
-   os << s.str();      
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -267,5 +204,69 @@ bool DocEntry::IsSequenceDelimitor()
 //-----------------------------------------------------------------------------
 // Private
 
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Prints the common part of ValEntry, BinEntry, SeqEntry
+ * @param   os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
+ */
+void DocEntry::Print(std::ostream &os, std::string const & )
+{
+   size_t o;
+   std::string st;
+   TSKey v;
+   std::string d2, vr;
+   std::ostringstream s;
+   uint32_t lgth;
+
+   o  = GetOffset();
+   vr = GetVR();
+   if(vr==GDCM_UNKNOWN)
+      vr="  ";
+
+   s << DictEntry::TranslateToKey(GetGroup(),GetElement()); 
+
+   if (PrintLevel >= 2)
+   {
+      s << " lg : ";
+      lgth = GetReadLength(); // ReadLength, as opposed to Length
+      if (lgth == 0xffffffff)
+      {
+         st = Util::Format("x(ffff)");  // I said : "x(ffff)" !
+         s.setf(std::ios::left);
+         s << std::setw(10-st.size()) << " ";  
+         s << st << " ";
+         s.setf(std::ios::left);
+         s << std::setw(8) << "-1"; 
+      }
+      else
+      {
+         st = Util::Format("x(%x)",lgth);
+         s.setf(std::ios::left);
+         s << std::setw(10-st.size()) << " ";
+         s << st << " ";
+         s.setf(std::ios::left);
+         s << std::setw(8) << lgth; 
+      }
+      s << " Off.: ";
+      st = Util::Format("x(%x)",o); 
+      s << std::setw(10-st.size()) << " ";
+      s << st << " ";
+      s << std::setw(8) << o; 
+   }
+
+   s << "[" << vr  << "] ";
+
+   if (PrintLevel >= 1)
+   {
+      s.setf(std::ios::left);
+      s << std::setw(66-GetName().length()) << " ";
+   }
+    
+   s << "[" << GetName()<< "]";
+   os << s.str();      
+}
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
index eb27dff0b66d7b3e40208e56b2e10807c661feda..ee4f5bf565c99506dff8df0977fe941ca4fe0a3e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntryArchive.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/26 11:42:02 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -25,6 +25,7 @@
 namespace gdcm 
 {
 //-----------------------------------------------------------------------------
+// Constructor / Destructor
 /**
  * \brief Constructor
  */
@@ -33,7 +34,6 @@ DocEntryArchive::DocEntryArchive(File *file)
    ArchFile = file;
 }
 
-//-----------------------------------------------------------------------------
 /**
  * \brief Destructor
  */
@@ -42,24 +42,6 @@ DocEntryArchive::~DocEntryArchive()
    ClearArchive();
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Print all 
- * @param   os The output stream to be written to.
- */
-void DocEntryArchive::Print(std::ostream &os) 
-{
-   os << "Elements in archives :" << std::endl;
-   for(TagDocEntryHT::iterator it = Archive.begin();
-       it!=Archive.end();
-       ++it)
-   {
-      if(it->second)
-         it->second->Print(os);
-   }
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -89,20 +71,6 @@ bool DocEntryArchive::Push(DocEntry *newEntry)
       // Set the new DocEntry
       ArchFile->AddEntry(newEntry);
 
-/*      // Save the old DocEntry if any
-      TagDocEntryHT::iterator it = HeaderHT.find(key);
-      if( it!=HeaderHT.end() )
-      {
-         Archive[key] = it->second;
-      }
-      else
-      {
-         Archive[key] = NULL;
-      }
-
-      // Set the new DocEntry
-      HeaderHT[key] = newEntry;*/
-
       return true;
    }
    return false;
@@ -128,14 +96,6 @@ bool DocEntryArchive::Push(uint16_t group,uint16_t elem)
       if( old )
          ArchFile->RemoveEntryNoDestroy(old);
 
-/*      // Save the old DocEntry if any
-      TagDocEntryHT::iterator it = HeaderHT.find(key);
-      if( it!=HeaderHT.end() )
-      {
-         Archive[key] = it->second;
-         HeaderHT.erase(it);
-      }*/
-
       return true;
    }
    return false;
@@ -165,23 +125,6 @@ bool DocEntryArchive::Restore(uint16_t group,uint16_t elem)
       if( Archive[key] )
          ArchFile->AddEntry(Archive[key]);
 
-/*      // Delete the new value
-      TagDocEntryHT::iterator restorePos = HeaderHT.find(key);
-      if( restorePos!=HeaderHT.end() )
-      {
-         delete restorePos->second;
-      }
-
-      // Restore the old value
-      if( Archive[key] )
-      {
-         HeaderHT[key] = Archive[key];
-      }
-      else
-      {
-         HeaderHT.erase(restorePos);
-      }*/
-
       Archive.erase(restoreIt);
 
       return true;
@@ -211,5 +154,22 @@ void DocEntryArchive::ClearArchive( )
 // Private
 
 //-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Print all 
+ * @param   os The output stream to be written to.
+ */
+void DocEntryArchive::Print(std::ostream &os) 
+{
+   os << "Elements in archives :" << std::endl;
+   for(TagDocEntryHT::iterator it = Archive.begin();
+       it!=Archive.end();
+       ++it)
+   {
+      if(it->second)
+         it->second->Print(os);
+   }
+}
 
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
index 9be0a71f6f9d575921ae1781ebfa6d172e90d62e..e2370812b6b6c76f6477c68a234c5f1acce41d05 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntrySet.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/26 11:42:02 $
-  Version:   $Revision: 1.49 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.50 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -28,6 +28,8 @@
 
 namespace gdcm 
 {
+//-----------------------------------------------------------------------------
+// Constructor / Destructor
 
 //-----------------------------------------------------------------------------
 // Public
@@ -585,5 +587,8 @@ DictEntry *DocEntrySet::GetDictEntry(uint16_t group, uint16_t elem,
 //-----------------------------------------------------------------------------
 // Private
 
+//-----------------------------------------------------------------------------
+// Print
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
index 5dd5ef264c0fae05ec66b2724956abbe631da62e..afd0e6ef5bf46e6e7de1f584436ee943e50c52ca 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 12:19:34 $
-  Version:   $Revision: 1.217 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.218 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -42,7 +42,6 @@
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 // Refer to Document::CheckSwap()
 //const unsigned int Document::HEADER_LENGTH_TO_READ = 256;
@@ -53,7 +52,7 @@ const unsigned int Document::MAX_SIZE_PRINT_ELEMENT_VALUE = 0x7fffffff;
 
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
-
+// Constructors and destructors are protected to avoid user to invoke directly
 /**
  * \brief   constructor  
  * @param   filename 'Document' (File or DicomDir) to be opened for parsing
@@ -174,31 +173,6 @@ Document::~Document ()
    RefShaDict = NULL;
 }
 
-//-----------------------------------------------------------------------------
-// Print
-
-/**
-  * \brief   Prints The Dict Entries of THE public Dicom Dictionary
-  * @param os ostream to print to
-  * @return
-  */  
-void Document::PrintPubDict(std::ostream &os)
-{
-   RefPubDict->SetPrintLevel(PrintLevel);
-   RefPubDict->Print(os);
-}
-
-/**
-  * \brief   Prints The Dict Entries of THE shadow Dicom Dictionary
-  * @param os ostream to print to
-  * @return
-  */
-void Document::PrintShaDict(std::ostream &os)
-{
-   RefShaDict->SetPrintLevel(PrintLevel);
-   RefShaDict->Print(os);
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -537,7 +511,6 @@ void Document::WriteContent(std::ofstream *fp, FileType filetype)
 
 // -----------------------------------------
 // Content entries 
-
 /**
  * \brief Loads (from disk) the element content 
  *        when a string is not suitable
@@ -616,9 +589,6 @@ void Document::LoadDocEntrySafe(DocEntry *entry)
 
 //-----------------------------------------------------------------------------
 // Protected
-
-// Constructors and destructors are protected to avoid user to invoke directly
-
 /**
  * \brief Reads a supposed to be 16 Bits integer
  *       (swaps it depending on processor endianity) 
@@ -721,7 +691,6 @@ int Document::ComputeGroup0002Length( FileType filetype )
 
 //-----------------------------------------------------------------------------
 // Private
-
 /**
  * \brief   Parses a DocEntrySet (Zero-level DocEntries or SQ Item DocEntries)
  * @return  length of the parsed set. 
@@ -2081,27 +2050,6 @@ void Document::HandleOutOfGroup0002(uint16_t &group, uint16_t &elem)
    }
 }
 
-// GenerateFreeTagKeyInGroup? 
-// --> What was it designed for ?!? 
-/**
- * \brief   Generate a free TagKey i.e. a TagKey that is not present
- *          in the TagHt dictionary.
- * @param   group The generated tag must belong to this group.  
- * @return  The element of tag with given group which is fee.
- */
-//uint32_t Document::GenerateFreeTagKeyInGroup(uint16_t group) 
-//{
-//   for (uint32_t elem = 0; elem < UINT32_MAX; elem++) 
-//   {
-//      TagKey key = DictEntry::TranslateToKey(group, elem);
-//      if (TagHT.count(key) == 0)
-//      {
-//         return elem;
-//      }
-//   }
-//   return UINT32_MAX;
-//}
-
 /**
  * \brief   Compares two documents, according to \ref DicomDir rules
  * \warning Does NOT work with ACR-NEMA files
@@ -2167,97 +2115,29 @@ bool Document::operator<(Document &document)
    return false;
 }
 
-/*
- * \brief Walk recursively the given \ref DocEntrySet, and feed
- *        the given hash table (\ref TagDocEntryHT) with all the
- *        \ref DocEntry (Dicom entries) encountered.
- *        This method does the job for \ref BuildFlatHashTable.
- * @param builtHT Where to collect all the \ref DocEntry encountered
- *        when recursively walking the given set.
- * @param set The structure to be traversed (recursively).
- */
-/*void Document::BuildFlatHashTableRecurse( TagDocEntryHT &builtHT,
-                                          DocEntrySet *set )
-{ 
-   if (ElementSet *elementSet = dynamic_cast< ElementSet* > ( set ) )
-   {
-      TagDocEntryHT const &currentHT = elementSet->GetTagHT();
-      for( TagDocEntryHT::const_iterator i  = currentHT.begin();
-                                         i != currentHT.end();
-                                       ++i)
-      {
-         DocEntry *entry = i->second;
-         if ( SeqEntry *seqEntry = dynamic_cast<SeqEntry*>(entry) )
-         {
-            const ListSQItem& items = seqEntry->GetSQItems();
-            for( ListSQItem::const_iterator item  = items.begin();
-                                            item != items.end();
-                                          ++item)
-            {
-               BuildFlatHashTableRecurse( builtHT, *item );
-            }
-            continue;
-         }
-         builtHT[entry->GetKey()] = entry;
-      }
-      return;
-    }
-
-   if (SQItem *SQItemSet = dynamic_cast< SQItem* > ( set ) )
-   {
-      const ListDocEntry& currentList = SQItemSet->GetDocEntries();
-      for (ListDocEntry::const_iterator i  = currentList.begin();
-                                        i != currentList.end();
-                                      ++i)
-      {
-         DocEntry *entry = *i;
-         if ( SeqEntry *seqEntry = dynamic_cast<SeqEntry*>(entry) )
-         {
-            const ListSQItem& items = seqEntry->GetSQItems();
-            for( ListSQItem::const_iterator item  = items.begin();
-                                            item != items.end();
-                                          ++item)
-            {
-               BuildFlatHashTableRecurse( builtHT, *item );
-            }
-            continue;
-         }
-         builtHT[entry->GetKey()] = entry;
-      }
-
-   }
-}*/
-
-/*
- * \brief Build a \ref TagDocEntryHT (i.e. a std::map<>) from the current
- *        Document.
- *
- *        The structure used by a Document (through \ref ElementSet),
- *        in order to hold the parsed entries of a Dicom header, is a recursive
- *        one. This is due to the fact that the sequences (when present)
- *        can be nested. Additionaly, the sequence items (represented in
- *        gdcm as \ref SQItem) add an extra complexity to the data
- *        structure. Hence, a gdcm user whishing to visit all the entries of
- *        a Dicom header will need to dig in the gdcm internals (which
- *        implies exposing all the internal data structures to the API).
- *        In order to avoid this burden to the user, \ref BuildFlatHashTable
- *        recursively builds a temporary hash table, which holds all the
- *        Dicom entries in a flat structure (a \ref TagDocEntryHT i.e. a
- *        std::map<>).
- * \warning Of course there is NO integrity constrain between the 
- *        returned \ref TagDocEntryHT and the \ref ElementSet used
- *        to build it. Hence if the underlying \ref ElementSet is
- *        altered, then it is the caller responsability to invoke 
- *        \ref BuildFlatHashTable again...
- * @return The flat std::map<> we juste build.
- */
-/*TagDocEntryHT *Document::BuildFlatHashTable()
+//-----------------------------------------------------------------------------
+// Print
+/**
+  * \brief   Prints The Dict Entries of THE public Dicom Dictionary
+  * @param os ostream to print to
+  * @return
+  */  
+void Document::PrintPubDict(std::ostream &os)
 {
-   TagDocEntryHT *FlatHT = new TagDocEntryHT;
-   BuildFlatHashTableRecurse( *FlatHT, this );
-   return FlatHT;
-}*/
+   RefPubDict->SetPrintLevel(PrintLevel);
+   RefPubDict->Print(os);
+}
 
-} // end namespace gdcm
+/**
+  * \brief   Prints The Dict Entries of THE shadow Dicom Dictionary
+  * @param os ostream to print to
+  * @return
+  */
+void Document::PrintShaDict(std::ostream &os)
+{
+   RefShaDict->SetPrintLevel(PrintLevel);
+   RefShaDict->Print(os);
+}
 
 //-----------------------------------------------------------------------------
+} // end namespace gdcm
index dbf05c6065215f64dcf39c1dadd5bc4f271ede86..510ac74710c48a9e5faf9f8fe95099d9bd1233c3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmElementSet.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/25 15:44:24 $
-  Version:   $Revision: 1.51 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.52 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -24,7 +24,6 @@
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
@@ -45,31 +44,6 @@ ElementSet::~ElementSet()
    ClearEntry();
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
-  * \brief   Prints the Header Entries (Dicom Elements) from the H Table
-  * @param os ostream to write to  
-  * @param indent Indentation string to be prepended during printing
-  */ 
-void ElementSet::Print(std::ostream &os, std::string const & )
-{
-   for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i)
-   {
-      DocEntry* entry = i->second;
-
-      entry->SetPrintLevel(PrintLevel);
-      entry->Print(os);   
-
-      if ( dynamic_cast<SeqEntry*>(entry) )
-      {
-         // Avoid the newline for a sequence:
-         continue;
-      }
-      os << std::endl;
-   }
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -209,5 +183,30 @@ DocEntry *ElementSet::GetDocEntry(uint16_t group, uint16_t elem)
 //-----------------------------------------------------------------------------
 // Private
 
+//-----------------------------------------------------------------------------
+// Print
+/**
+  * \brief   Prints the Header Entries (Dicom Elements) from the H Table
+  * @param os ostream to write to  
+  * @param indent Indentation string to be prepended during printing
+  */ 
+void ElementSet::Print(std::ostream &os, std::string const & )
+{
+   for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i)
+   {
+      DocEntry* entry = i->second;
+
+      entry->SetPrintLevel(PrintLevel);
+      entry->Print(os);   
+
+      if ( dynamic_cast<SeqEntry*>(entry) )
+      {
+         // Avoid the newline for a sequence:
+         continue;
+      }
+      os << std::endl;
+   }
+}
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
index bea47bb10a875eb4aed13fa3ab1bcaaa2a65c951..698b7a608017f0c52fc5f13471eaee4ebaa0c03b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmException.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 14:28:32 $
-  Version:   $Revision: 1.25 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.26 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 #include <typeinfo>
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 // Exception
-
 /**
  * \brief constructor
  * @param f f
@@ -32,22 +30,24 @@ namespace gdcm
  */
 Exception::Exception(const std::string &f, const std::string &msg) throw()
 #ifdef __GNUC__
-  try
+   try
 #endif
-  : From(f), Error(msg) {
-  }
+   : From(f), Error(msg) 
+   {
+   }
 #ifdef __GNUC__
-catch(...) {
-  fatal("Exception::Exception(const std::string&, const std::string&, const std::string&)");
-}
+   catch(...) 
+   {
+      fatal("Exception::Exception(const std::string&, const std::string&, const std::string&)");
+   }
 #endif
 
-
 /**
  * \brief fatal
  * @param from from
  */
-void Exception::fatal(const char *from) throw() {
+void Exception::fatal(const char *from) throw() 
+{
    try
    {
       std::cerr << "Fatal: exception received in " << from 
@@ -102,18 +102,20 @@ std::string Exception::getName() const throw()
       std::string name = typeid(*this).name();
       return name;
 #endif
-  }
-  catch(...) {
-    fatal("Exception::getName(std::string &)");
-    return "";
-  }
+   }
+   catch(...) 
+   {
+      fatal("Exception::getName(std::string &)");
+      return "";
+   }
 }
 
 /**
  * \brief Exception
  */
- Exception::operator const char *() const throw() {
-  return getName().c_str();
+Exception::operator const char *() const throw() 
+{
+   return getName().c_str();
 }
 
 //-----------------------------------------------------------------------------
@@ -122,14 +124,18 @@ std::string Exception::getName() const throw()
  * @param os ostream to write to
  * @param e exception to raise
  */
- std::ostream& operator<<(std::ostream &os, const Exception &e) {
-  try {  
-    os << "Exception " << e.getName() << " thrown: " << e.getError() << std::endl;
-  }
-  catch(...) {
-    Exception::fatal("operator<<(std::ostream &, const Exception&)");
-  }
-  return os;
+std::ostream& operator<<(std::ostream &os, const Exception &e) 
+{
+   try 
+   {
+      os << "Exception " << e.getName() << " thrown: " << e.getError() << std::endl;
+   }
+   catch(...) 
+   {
+      Exception::fatal("operator<<(std::ostream &, const Exception&)");
+   }
+   return os;
 }
+
 } // end namespace gdcm
 //-----------------------------------------------------------------------------
index ffa7ae08bb998bb79502119382fcd58471e55adf..cf11b665b8e5586935e7d149c6fe4a4fdba0599b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/28 15:10:56 $
-  Version:   $Revision: 1.205 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.206 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -155,6 +155,8 @@ File::~File ()
       delete JPEGInfo;
 }
 
+//-----------------------------------------------------------------------------
+// Public
 /**
  * \brief Performs some consistency checking on various 'File related' 
  *       (as opposed to 'DicomDir related') entries 
@@ -279,13 +281,6 @@ bool File::Write(std::string fileName, FileType filetype)
    return true;
 }
 
-//-----------------------------------------------------------------------------
-// Print
-
-
-//-----------------------------------------------------------------------------
-// Public
-
 /**
  * \brief  This predicate, based on hopefully reasonable heuristics,
  *         decides whether or not the current File was properly parsed
@@ -1680,5 +1675,7 @@ void File::ReadAndSkipEncapsulatedBasicOffsetTable()
 }
 
 //-----------------------------------------------------------------------------
+// Print
 
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
index a1cfd210b9f1a45ec058f9f9efce5cb1fd65acd7..33d9f0f8f0dd6ead58f468e0404aa916017d98ee 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFileHelper.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/26 16:28:58 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.9 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -34,8 +34,6 @@
 
 namespace gdcm 
 {
-typedef std::pair<TagDocEntryHT::iterator,TagDocEntryHT::iterator> IterHT;
-
 //-------------------------------------------------------------------------
 // Constructor / Destructor
 /**
@@ -124,17 +122,6 @@ FileHelper::~FileHelper()
    FileInternal = 0;
 }
 
-//-----------------------------------------------------------------------------
-// Print
-void FileHelper::Print(std::ostream &os, std::string const &)
-{
-   FileInternal->SetPrintLevel(PrintLevel);
-   FileInternal->Print(os);
-
-   PixelReadConverter->SetPrintLevel(PrintLevel);
-   PixelReadConverter->Print(os);
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -609,7 +596,6 @@ uint8_t* FileHelper::GetLutRGBA()
 
 //-----------------------------------------------------------------------------
 // Protected
-
 /**
  * \brief Check the write integrity
  *
@@ -943,7 +929,7 @@ BinEntry *FileHelper::CopyBinEntry(uint16_t group,uint16_t elem)
 }
 
 //-----------------------------------------------------------------------------
-// Protected
+// Private
 /**
  * \brief Factorization for various forms of constructors.
  */
@@ -988,8 +974,15 @@ uint8_t *FileHelper::GetRaw()
 }
 
 //-----------------------------------------------------------------------------
-// Private
+// Print
+void FileHelper::Print(std::ostream &os, std::string const &)
+{
+   FileInternal->SetPrintLevel(PrintLevel);
+   FileInternal->Print(os);
+
+   PixelReadConverter->SetPrintLevel(PrintLevel);
+   PixelReadConverter->Print(os);
+}
 
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
-
index 5d8c4e7195124f8fa38fe2d917b2d8935338cbf6..5f455db33ddda99807ab2e6aaffe07ffa473b0fe 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmGlobal.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/23 10:12:34 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.17 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -26,6 +26,7 @@
 
 namespace gdcm 
 {
+//-----------------------------------------------------------------------------
 // Those global string that are return by reference everywhere in gdcm code
 // used to be in gdcmCommon.h but due to a 'bug' in gcc/MacOSX
 // you cannot have static initialization in a multithreaded environment
@@ -38,33 +39,20 @@ const std::string GDCM_BINLOADED = "gdcm::Binary data loaded";
 const std::string GDCM_NOTLOADED = "gdcm::NotLoaded";
 const std::string GDCM_UNREAD    = "gdcm::UnRead";
 
-/**
- * \brief Pointer to a container, holding _all_ the Dicom Dictionaries.
- */
+//-----------------------------------------------------------------------------
 DictSet         *Global::Dicts  = (DictSet *)0;
-
-/**
- * \brief   Pointer to a hash table containing the 'Value Representations'.
- */
 VR              *Global::ValRes     = (VR *)0;
-
-/**
- * \brief   Pointer to a hash table containing the Transfer Syntax codes
- *          and their english description 
- */
 TS              *Global::TranSyn     = (TS *)0;
-
-/**
- * \brief   Pointer to the hash table containing the Dicom Elements
- *          necessary to describe each part of a DICOMDIR 
- */
 DicomDirElement *Global::ddElem = (DicomDirElement *)0;
 
+//-----------------------------------------------------------------------------
 /**
  * \brief   Global container
  */
 Global Glob;
 
+//-------------------------------------------------------------------------
+// Constructor / Destructor
 /**
  * \brief   constructor : populates the various H Tables
  */
@@ -91,6 +79,9 @@ Global::~Global()
    delete TranSyn;
    delete ddElem;
 }
+
+//-----------------------------------------------------------------------------
+// Public
 /**
  * \brief   returns a pointer to the 'Value Representation Table' 
  */
@@ -119,4 +110,15 @@ DicomDirElement *Global::GetDicomDirElements()
 {
    return ddElem;
 }
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
index c32be0060ea1823dc34926f7cdcb6734dfc9751e..7be8db87318a6a78c431e573902506ddd03fc6a0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmGlobal.h,v $
   Language:  C++
-  Date:      $Date: 2004/12/03 20:16:58 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -44,9 +44,15 @@ public:
    static DicomDirElement *GetDicomDirElements();
 
 private:
-   static DictSet *Dicts; 
+   /// Pointer to a container, holding _all_ the Dicom Dictionaries.
+   static DictSet *Dicts;
+   /// Pointer to a hash table containing the 'Value Representations'.
    static VR *ValRes;
+   /// Pointer to a hash table containing the Transfer Syntax codes and their 
+   /// english description 
    static TS *TranSyn; 
+   /// Pointer to the hash table containing the Dicom Elements necessary 
+   /// to describe each part of a DICOMDIR 
    static DicomDirElement *ddElem;
 };
 } // end namespace gdcm
index b16e4bf1e084b244bb20d24c68b191d63b35919c..fa8f86d6ca75e83b0e9717bc69cc6032ac489daa 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJPEGFragment.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 04:15:33 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -21,7 +21,7 @@
 
 namespace gdcm
 {
-
+//-------------------------------------------------------------------------
 // For JPEG 2000, body in file gdcmJpeg2000.cxx
 // Not yet made
 bool gdcm_read_JPEG2000_file (std::ifstream* fp, void* image_buffer);
@@ -30,6 +30,8 @@ bool gdcm_read_JPEG2000_file (std::ifstream* fp, void* image_buffer);
 // Not yet made
 bool gdcm_read_JPEGLS_file (std::ifstream* fp, void* image_buffer);
 
+//-------------------------------------------------------------------------
+// Constructor / Destructor
 /**
  * \brief Default constructor.
  */
@@ -42,19 +44,8 @@ JPEGFragment::JPEGFragment()
 
 }
 
-/**
- * \brief        Print self.
- * @param os     Stream to print to.
- * @param indent Indentation string to be prepended during printing.
- */
-void JPEGFragment::Print( std::ostream &os, std::string indent )
-{
-   os << indent
-      << "JPEG fragment: offset : " <<  Offset
-      << "   length : " <<  Length
-      << std::endl;
-}
-
+//-----------------------------------------------------------------------------
+// Public
 /**
  * \brief Decompress 8bits JPEG Fragment
  * @param fp ifstream to write to
@@ -95,5 +86,27 @@ void JPEGFragment::DecompressJPEGFramesFromFile(std::ifstream *fp,
    }
 }
 
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief        Print self.
+ * @param os     Stream to print to.
+ * @param indent Indentation string to be prepended during printing.
+ */
+void JPEGFragment::Print( std::ostream &os, std::string indent )
+{
+   os << indent
+      << "JPEG fragment: offset : " <<  Offset
+      << "   length : " <<  Length
+      << std::endl;
+}
+
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
 
index 6fcd14ef7d1c230dffebb9e1d1a331dc09014e59..4660612ce6d1e542fe736d8c32c195a1a41dc6fb 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJPEGFragmentsInfo.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 05:24:21 $
-  Version:   $Revision: 1.17 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.18 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -23,7 +23,8 @@
 
 namespace gdcm 
 {
-
+//-------------------------------------------------------------------------
+// Constructor / Destructor
 JPEGFragmentsInfo::JPEGFragmentsInfo()
 {
    StateSuspension = 0;
@@ -43,32 +44,8 @@ JPEGFragmentsInfo::~JPEGFragmentsInfo()
    Fragments.clear();
 }
 
-/**
- * \brief        Print self.
- * @param os     Stream to print to.
- * @param indent Indentation string to be prepended during printing.
- */
-void JPEGFragmentsInfo::Print( std::ostream &os, std::string const &indent )
-{
-   os << std::endl;
-   os << indent
-      << "----------------- JPEG fragments --------------------------------"
-      << std::endl << std::endl;
-   os << indent
-      << "Total number of fragments : " << Fragments.size()
-      << std::endl;
-   int fragmentNumber = 0;
-   for(JPEGFragmentsList::iterator it  = Fragments.begin();
-                                   it != Fragments.end();
-                                 ++it)
-   {
-      os << indent
-         << "   fragment number :" << fragmentNumber++;
-      (*it)->Print( os, indent + "   ");
-   }
-   os << std::endl;
-}
-
+//-----------------------------------------------------------------------------
+// Public
 void JPEGFragmentsInfo::DecompressFromFile(std::ifstream *fp, uint8_t *buffer, int nBits, int , int )
 {
    // Pointer to the Raw image
@@ -114,5 +91,39 @@ unsigned int JPEGFragmentsInfo::GetFragmentCount()
    return Fragments.size();
 }
 
-} // end namespace gdcm
+//-----------------------------------------------------------------------------
+// Protected
 
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief        Print self.
+ * @param os     Stream to print to.
+ * @param indent Indentation string to be prepended during printing.
+ */
+void JPEGFragmentsInfo::Print( std::ostream &os, std::string const &indent )
+{
+   os << std::endl;
+   os << indent
+      << "----------------- JPEG fragments --------------------------------"
+      << std::endl << std::endl;
+   os << indent
+      << "Total number of fragments : " << Fragments.size()
+      << std::endl;
+   int fragmentNumber = 0;
+   for(JPEGFragmentsList::iterator it  = Fragments.begin();
+                                   it != Fragments.end();
+                                 ++it)
+   {
+      os << indent
+         << "   fragment number :" << fragmentNumber++;
+      (*it)->Print( os, indent + "   ");
+   }
+   os << std::endl;
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
index d2862fa9de6e4c9567e5d95e9ac69620384261a2..4ab11d6ee14a4d56781da8e4ed904bb1e36d5a12 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJpeg2000.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 17:17:12 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.17 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -23,7 +23,6 @@
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
  /**
  * \brief   routine for JPEG decompression 
@@ -40,7 +39,7 @@ bool gdcm_read_JPEG2000_file (std::ifstream* fp,void* image_buffer) {
    std::cout << "Sorry JPEG 2000 File not yet taken into account" << std::endl;
    return false;
 }
-} // end namespace gdcm
 
 //-----------------------------------------------------------------------------
+} // end namespace gdcm
 
index 56f941b7b18ce9dfb0d84869613fd48293e4387f..27ff8e2b83384398ebb43b587b4f63467d724c31 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelReadConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 06:17:22 $
-  Version:   $Revision: 1.42 $
+  Date:      $Date: 2005/02/01 10:29:55 $
+  Version:   $Revision: 1.43 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -30,9 +30,9 @@
 
 namespace gdcm
 {
+//-----------------------------------------------------------------------------
 #define str2num(str, typeNum) *((typeNum *)(str))
 
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 PixelReadConvert::PixelReadConvert() 
@@ -47,6 +47,13 @@ PixelReadConvert::PixelReadConvert()
    LutBlueData =0;
 }
 
+PixelReadConvert::~PixelReadConvert() 
+{
+   Squeeze();
+}
+
+//-----------------------------------------------------------------------------
+// Public
 void PixelReadConvert::Squeeze() 
 {
    if ( RGB )
@@ -62,11 +69,6 @@ void PixelReadConvert::Squeeze()
    LutRGBA = 0;
 }
 
-PixelReadConvert::~PixelReadConvert() 
-{
-   Squeeze();
-}
-
 void PixelReadConvert::AllocateRGB()
 {
   if ( RGB )
@@ -854,6 +856,14 @@ bool PixelReadConvert::BuildRGBImage()
    return true;
 }
 
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
 /**
  * \brief        Print self.
  * @param indent Indentation string to be prepended during printing.
@@ -896,6 +906,7 @@ void PixelReadConvert::Print( std::ostream &os, std::string const & indent )
    }
 }
 
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
 
 // NOTES on File internal calls
index 899f816f84e8047ed78399f4cfa27119930b3356..645d03abb7e4c69375e7d6fd4f19d9fc1d012b18 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/23 10:12:34 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2005/02/01 10:29:56 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -23,8 +23,9 @@ namespace gdcm
 {
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
-
-/// \brief Construcror
+/**
+ * \brief Construcror
+ */
 PixelWriteConvert::PixelWriteConvert() 
 {
    ReadData = 0;
@@ -34,14 +35,15 @@ PixelWriteConvert::PixelWriteConvert()
    UserDataSize = 0;
 }
 
-/// \brief Destructor
+/**
+ * \brief Destructor
+ */
 PixelWriteConvert::~PixelWriteConvert() 
 {
 }
 
 //-----------------------------------------------------------------------------
 // Public
-
 /**
  * \brief   SetReadData
  * @param   data data
@@ -96,5 +98,14 @@ size_t PixelWriteConvert::GetDataSize()
    }
 }
 
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
index 62da1c6ce76e55d4148c4f4874328b43746733fb..0b17ce09dbedfa23e8e4943f22156a9d8e1b75ce 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmRLEFrame.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 06:17:22 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2005/02/01 10:29:56 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
                                                                                 
 namespace gdcm
 {
+//-------------------------------------------------------------------------
+// Constructor / Destructor
 
-/**
- * \brief        Print self.
- * @param indent Indentation string to be prepended during printing.
- * @param os     Stream to print to.
- */
-void RLEFrame::Print( std::ostream &os, std::string indent )
-{
-   os << indent
-      << "--- fragments"
-      << std::endl;
-   for ( unsigned int i = 0; i < NumberOfFragments; i++ )
-   {
-      os << indent
-         << "   offset : " <<  Offset[i]
-         << "   length : " <<  Length[i]
-         << std::endl;
-   }
-}
-
+//-----------------------------------------------------------------------------
+// Public
 void RLEFrame::SetOffset(unsigned int id,long offset)
 {
    gdcmAssertMacro(id<15);
@@ -144,6 +129,33 @@ bool RLEFrame::ReadAndDecompressRLEFragment( uint8_t *subRaw,
    return true;
 }
 
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief        Print self.
+ * @param indent Indentation string to be prepended during printing.
+ * @param os     Stream to print to.
+ */
+void RLEFrame::Print( std::ostream &os, std::string indent )
+{
+   os << indent
+      << "--- fragments"
+      << std::endl;
+   for ( unsigned int i = 0; i < NumberOfFragments; i++ )
+   {
+      os << indent
+         << "   offset : " <<  Offset[i]
+         << "   length : " <<  Length[i]
+         << std::endl;
+   }
+}
 
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
 
index cc7a5ca9a09a77942c9d35e8a1cc8778a3eca490..d95e93a521919b540417f2587b277217f3d1531d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmRLEFramesInfo.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 06:17:22 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2005/02/01 10:29:56 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -21,7 +21,8 @@
 
 namespace gdcm 
 {
-
+//-------------------------------------------------------------------------
+// Constructor / Destructor
 RLEFramesInfo::~RLEFramesInfo()
 {
    for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it)
@@ -31,30 +32,8 @@ RLEFramesInfo::~RLEFramesInfo()
    Frames.clear();
 }
 
-/**
- * \brief        Print self.
- * @param indent Indentation string to be prepended during printing.
- * @param os     Stream to print to.
- */
-void RLEFramesInfo::Print( std::ostream &os, std::string indent )
-{
-   os << std::endl;
-   os << indent
-      << "----------------- RLE frames --------------------------------"
-      << std::endl;
-   os << indent
-      << "Total number of Frames : " << Frames.size()
-      << std::endl;
-   int frameNumber = 0;
-   for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it)
-   {
-      os << indent
-         << "   frame number :" << frameNumber++
-         << std::endl;
-      (*it)->Print( os, indent + "   " );
-   }
-}
-
+//-----------------------------------------------------------------------------
+// Public
 void RLEFramesInfo::AddFrame(RLEFrame *frame)
 {
    Frames.push_back(frame);
@@ -146,5 +125,37 @@ bool RLEFramesInfo::ConvertRLE16BitsFromRLE8Bits( uint8_t* raw, int xSize,
    return true;
 }
 
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief        Print self.
+ * @param indent Indentation string to be prepended during printing.
+ * @param os     Stream to print to.
+ */
+void RLEFramesInfo::Print( std::ostream &os, std::string indent )
+{
+   os << std::endl;
+   os << indent
+      << "----------------- RLE frames --------------------------------"
+      << std::endl;
+   os << indent
+      << "Total number of Frames : " << Frames.size()
+      << std::endl;
+   int frameNumber = 0;
+   for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it)
+   {
+      os << indent
+         << "   frame number :" << frameNumber++
+         << std::endl;
+      (*it)->Print( os, indent + "   " );
+   }
+}
 
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
index d4ee46f9cbc0e170dc2a33d8da9a653511f38373..3180df8a39e0fe853f08ee3a331d24d18e09a98e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSQItem.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 12:19:34 $
-  Version:   $Revision: 1.63 $
+  Date:      $Date: 2005/02/01 10:29:56 $
+  Version:   $Revision: 1.64 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -50,45 +50,7 @@ SQItem::~SQItem()
 }
 
 //-----------------------------------------------------------------------------
-// Print
-/*
- * \brief   canonical Printer
- * @param os     Stream to print to. 
- * @param indent Indentation string to be prepended during printing.
- */
-void SQItem::Print(std::ostream &os, std::string const &)
-{
-   std::ostringstream s;
-
-   if (SQDepthLevel > 0)
-   {
-      for (int i = 0; i < SQDepthLevel; ++i)
-      {
-         s << "   | " ;
-      }
-   }
-   os << s.str() << " --- SQItem number " << SQItemNumber  << std::endl;
-   for (ListDocEntry::iterator i  = DocEntries.begin();
-                               i != DocEntries.end();
-                             ++i)
-   {
-      DocEntry *Entry = *i;
-      bool PrintEndLine = true;
-
-      os << s.str();
-      Entry->SetPrintLevel(PrintLevel);
-      Entry->Print(os); 
-      if ( dynamic_cast<SeqEntry*>(Entry) )
-      {
-         PrintEndLine = false;
-      }
-      if (PrintEndLine)
-      {
-         os << std::endl;
-      }
-   } 
-}
-
+// Public
 /*
  * \brief   canonical Writer
  * @param fp     file pointer to an already open file. 
@@ -138,8 +100,6 @@ void SQItem::WriteContent(std::ofstream *fp, FileType filetype)
  
 }
 
-//-----------------------------------------------------------------------------
-// Public
 /**
  * \brief  Remove all entry in the Sequence Item 
  */
@@ -258,7 +218,45 @@ DocEntry *SQItem::GetDocEntry(uint16_t group, uint16_t elem)
 //-----------------------------------------------------------------------------
 // Private
 
-
 //-----------------------------------------------------------------------------
+// Print
+/*
+ * \brief   canonical Printer
+ * @param os     Stream to print to. 
+ * @param indent Indentation string to be prepended during printing.
+ */
+void SQItem::Print(std::ostream &os, std::string const &)
+{
+   std::ostringstream s;
 
+   if (SQDepthLevel > 0)
+   {
+      for (int i = 0; i < SQDepthLevel; ++i)
+      {
+         s << "   | " ;
+      }
+   }
+   os << s.str() << " --- SQItem number " << SQItemNumber  << std::endl;
+   for (ListDocEntry::iterator i  = DocEntries.begin();
+                               i != DocEntries.end();
+                             ++i)
+   {
+      DocEntry *Entry = *i;
+      bool PrintEndLine = true;
+
+      os << s.str();
+      Entry->SetPrintLevel(PrintLevel);
+      Entry->Print(os); 
+      if ( dynamic_cast<SeqEntry*>(Entry) )
+      {
+         PrintEndLine = false;
+      }
+      if (PrintEndLine)
+      {
+         os << std::endl;
+      }
+   } 
+}
+
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
index feadac76014a59750648d2d726136533ce882010..9e510814df433678865a4f339247394f51e68858 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSeqEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 12:19:34 $
-  Version:   $Revision: 1.51 $
+  Date:      $Date: 2005/02/01 10:29:56 $
+  Version:   $Revision: 1.52 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -29,7 +29,6 @@
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
@@ -78,49 +77,6 @@ SeqEntry::~SeqEntry()
    }
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   canonical Printer
- */
-void SeqEntry::Print( std::ostream &os, std::string const & )
-{
-   // First, Print the Dicom Element itself.
-   os << "S ";
-   DocEntry::Print(os);
-   os << std::endl;
-
-   if (GetReadLength() == 0)
-      return;
-
-   // Then, Print each SQ Item   
-   for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
-   {
-      (*cc)->SetPrintLevel(PrintLevel);
-      (*cc)->Print(os);   
-   }
-
-   // at end, print the sequence terminator item, if any
-   if (DelimitorMode)
-   {
-      for ( int i = 0; i < SQDepthLevel; i++ )
-      {
-         os << "   | " ;
-      }
-      if (SeqTerm != NULL)
-      {
-         SeqTerm->SetPrintLevel(PrintLevel);
-         SeqTerm->Print(os);
-         os << std::endl;
-      } 
-      else 
-      {
-         // fuse
-         gdcmVerboseMacro("  -------- should have a sequence terminator item");
-      }
-   }                    
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /*
@@ -206,16 +162,20 @@ SQItem *SeqEntry::GetSQItem(int nb)
    return *(Items.end());
 }
 
-/// \brief returns the number of SQItems within the current Sequence
+/**
+ * \brief returns the number of SQItems within the current Sequence
+ */
 unsigned int SeqEntry::GetNumberOfSQItems()
 {
    return Items.size();
 }
 
-/// \brief   adds the passed ITEM to the ITEM chained List for this SeQuence.
-/// @param sqItem SQItem to be pushed back in the SeqEntry
-/// @param itemNumber ordinal number of the SQItem
-/// \note NOT end-user intendend method !
+/**
+ * \brief   adds the passed ITEM to the ITEM chained List for this SeQuence.
+ * @param sqItem SQItem to be pushed back in the SeqEntry
+ * @param itemNumber ordinal number of the SQItem
+ *  \note NOT end-user intendend method !
+ */
 void SeqEntry::AddSQItem(SQItem *sqItem, int itemNumber)
 {
 // FIXME : SQItemNumber is supposed to be the ordinal number of the SQItem
@@ -235,5 +195,47 @@ void SeqEntry::AddSQItem(SQItem *sqItem, int itemNumber)
 // Private
 
 //-----------------------------------------------------------------------------
-} // end namespace gdcm
+// Print
+/**
+ * \brief   canonical Printer
+ */
+void SeqEntry::Print( std::ostream &os, std::string const & )
+{
+   // First, Print the Dicom Element itself.
+   os << "S ";
+   DocEntry::Print(os);
+   os << std::endl;
 
+   if (GetReadLength() == 0)
+      return;
+
+   // Then, Print each SQ Item   
+   for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
+   {
+      (*cc)->SetPrintLevel(PrintLevel);
+      (*cc)->Print(os);   
+   }
+
+   // at end, print the sequence terminator item, if any
+   if (DelimitorMode)
+   {
+      for ( int i = 0; i < SQDepthLevel; i++ )
+      {
+         os << "   | " ;
+      }
+      if (SeqTerm != NULL)
+      {
+         SeqTerm->SetPrintLevel(PrintLevel);
+         SeqTerm->Print(os);
+         os << std::endl;
+      } 
+      else 
+      {
+         // fuse
+         gdcmVerboseMacro("  -------- should have a sequence terminator item");
+      }
+   }
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
index 93402bf19ca773cbe8c26ed9ac35009fb5cba4fa..627adec081599b96620155e4d14fac460551f83d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSerieHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/31 12:19:34 $
-  Version:   $Revision: 1.17 $
+  Date:      $Date: 2005/02/01 10:29:56 $
+  Version:   $Revision: 1.18 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -62,36 +62,6 @@ SerieHeader::~SerieHeader()
    }
 }
 
-//-----------------------------------------------------------------------------
-// Print
-
-/**
- * \brief   Canonical printer.
- */
-void SerieHeader::Print()
-{
-   // For all the Coherent File lists of the gdcm::Serie
-   CoherentFileListmap::iterator itl = CoherentGdcmFileListHT.begin();
-   if ( itl == CoherentGdcmFileListHT.end() )
-   {
-      gdcmVerboseMacro( "No Coherent File list found" );
-      return;
-   }
-   while (itl != CoherentGdcmFileListHT.end())
-   { 
-      std::cout << "Serie UID :[" << itl->first << "]" << std::endl;
-
-      // For all the files of a Coherent File list
-      for (GdcmFileList::iterator it =  (itl->second)->begin();
-                                  it != (itl->second)->end(); 
-                                ++it)
-      {
-         std::cout << " --- " << (*it)->GetFileName() << std::endl;
-      }
-      ++itl;
-   }
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -414,5 +384,34 @@ bool SerieHeader::FileNameOrdering(GdcmFileList *)
    return true;
 }
 
-} // end namespace gdcm
 //-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Canonical printer.
+ */
+void SerieHeader::Print()
+{
+   // For all the Coherent File lists of the gdcm::Serie
+   CoherentFileListmap::iterator itl = CoherentGdcmFileListHT.begin();
+   if ( itl == CoherentGdcmFileListHT.end() )
+   {
+      gdcmVerboseMacro( "No Coherent File list found" );
+      return;
+   }
+   while (itl != CoherentGdcmFileListHT.end())
+   { 
+      std::cout << "Serie UID :[" << itl->first << "]" << std::endl;
+
+      // For all the files of a Coherent File list
+      for (GdcmFileList::iterator it =  (itl->second)->begin();
+                                  it != (itl->second)->end(); 
+                                ++it)
+      {
+         std::cout << " --- " << (*it)->GetFileName() << std::endl;
+      }
+      ++itl;
+   }
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
index 348f7e003c496a68942de9b0b5261eeb1fa3afc0..3b951c32443c2bd514ed7b374b6bf8f2a45e1d23 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmTS.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/23 10:12:34 $
-  Version:   $Revision: 1.38 $
+  Date:      $Date: 2005/02/01 10:29:56 $
+  Version:   $Revision: 1.39 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -73,7 +73,9 @@ static const char *SpecialStrings[] =  {
   "Unknown Transfer Syntax"
 };
 
+//-----------------------------------------------------------------------------
 void FillDefaultTSDict(TSHT &ts);
+
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 TS::TS() 
@@ -105,29 +107,11 @@ TS::TS()
    }
 }
 
-//-----------------------------------------------------------------------------
 TS::~TS() 
 {
    TsMap.clear();
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Print all 
- * @param   os The output stream to be written to.
- */
-void TS::Print(std::ostream &os) 
-{
-   std::ostringstream s;
-
-   for (TSHT::const_iterator it = TsMap.begin(); it != TsMap.end(); ++it)
-   {
-      s << "TS : " << it->first << " = " << it->second << std::endl;
-   }
-   os << s.str();
-}
-
 //-----------------------------------------------------------------------------
 // Public
 int TS::Count(TSKey const &key) 
@@ -314,5 +298,21 @@ const char* TS::GetSpecialTransferSyntax(SpecialType t)
 // Private
 
 //-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Print all 
+ * @param   os The output stream to be written to.
+ */
+void TS::Print(std::ostream &os) 
+{
+   std::ostringstream s;
 
+   for (TSHT::const_iterator it = TsMap.begin(); it != TsMap.end(); ++it)
+   {
+      s << "TS : " << it->first << " = " << it->second << std::endl;
+   }
+   os << s.str();
+}
+
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
index 8fa6d9b14a896741213ae16efff9e18f7f01660e..552b5840af767f19e0a9d055283d24b18728a0d3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmUtil.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/28 17:29:59 $
-  Version:   $Revision: 1.127 $
+  Date:      $Date: 2005/02/01 10:29:56 $
+  Version:   $Revision: 1.128 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 // For GetCurrentThreadID()
 #ifdef __linux__
-#include <sys/types.h>
-#include <linux/unistd.h>
+   #include <sys/types.h>
+   #include <linux/unistd.h>
 #endif
 #ifdef __sun
-#include <thread.h>
+   #include <thread.h>
 #endif
 
 namespace gdcm 
 {
+//-------------------------------------------------------------------------
 const std::string Util::GDCM_UID = "1.2.826.0.1.3680043.2.1143";
 std::string Util::RootUID        = GDCM_UID;
 
+//-------------------------------------------------------------------------
 /**
  * \brief Provide a better 'c++' approach for sprintf
  * For example c code is:
@@ -107,7 +109,6 @@ std::string Util::RootUID        = GDCM_UID;
  * gdcm style code is
  * Format("%04x|%04x", group , elem);
  */
-
 std::string Util::Format(const char *format, ...)
 {
    char buffer[2048];
@@ -382,29 +383,27 @@ bool Util::IsCurrentProcessorBigEndian()
 #endif
 }
 
-
-
 #ifdef _WIN32
-typedef BOOL(WINAPI * pSnmpExtensionInit) (
-        IN DWORD dwTimeZeroReference,
-        OUT HANDLE * hPollForTrapEvent,
-        OUT AsnObjectIdentifier * supportedView);
-
-typedef BOOL(WINAPI * pSnmpExtensionTrap) (
-        OUT AsnObjectIdentifier * enterprise,
-        OUT AsnInteger * genericTrap,
-        OUT AsnInteger * specificTrap,
-        OUT AsnTimeticks * timeStamp,
-        OUT RFC1157VarBindList * variableBindings);
-
-typedef BOOL(WINAPI * pSnmpExtensionQuery) (
-        IN BYTE requestType,
-        IN OUT RFC1157VarBindList * variableBindings,
-        OUT AsnInteger * errorStatus,
-        OUT AsnInteger * errorIndex);
-
-typedef BOOL(WINAPI * pSnmpExtensionInitEx) (
-        OUT AsnObjectIdentifier * supportedView);
+   typedef BOOL(WINAPI * pSnmpExtensionInit) (
+           IN DWORD dwTimeZeroReference,
+           OUT HANDLE * hPollForTrapEvent,
+           OUT AsnObjectIdentifier * supportedView);
+
+   typedef BOOL(WINAPI * pSnmpExtensionTrap) (
+           OUT AsnObjectIdentifier * enterprise,
+           OUT AsnInteger * genericTrap,
+           OUT AsnInteger * specificTrap,
+           OUT AsnTimeticks * timeStamp,
+           OUT RFC1157VarBindList * variableBindings);
+
+   typedef BOOL(WINAPI * pSnmpExtensionQuery) (
+           IN BYTE requestType,
+           IN OUT RFC1157VarBindList * variableBindings,
+           OUT AsnInteger * errorStatus,
+           OUT AsnInteger * errorIndex);
+
+   typedef BOOL(WINAPI * pSnmpExtensionInitEx) (
+           OUT AsnObjectIdentifier * supportedView);
 #endif //_WIN32
 
 
@@ -597,13 +596,13 @@ int GetMacAddrSys ( unsigned char *addr )
 // We should investiage the use of SIZEOF_ADDR_IFREQ
 //
 #ifdef HAVE_SA_LEN
-#ifndef max
-#define max(a,b) ((a) > (b) ? (a) : (b))
-#endif
-#define ifreq_size(i) max(sizeof(struct ifreq),\
-     sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
+   #ifndef max
+      #define max(a,b) ((a) > (b) ? (a) : (b))
+   #endif
+   #define ifreq_size(i) max(sizeof(struct ifreq),\
+        sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
 #else
-#define ifreq_size(i) sizeof(struct ifreq)
+   #define ifreq_size(i) sizeof(struct ifreq)
 #endif // HAVE_SA_LEN
 
    if( (sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0 )
@@ -734,7 +733,7 @@ std::string Util::GetIPAddress()
    // SUSv2 guarantees that `Host names are limited to 255 bytes'.
    // POSIX 1003.1-2001 guarantees that `Host names (not including the
    // terminating NUL) are limited to HOST_NAME_MAX bytes'.
-#  define HOST_NAME_MAX 255
+#define HOST_NAME_MAX 255
    // In this case we should maybe check the string was not truncated.
    // But I don't known how to check that...
 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__)
@@ -812,7 +811,6 @@ unsigned int Util::GetCurrentProcessID()
   // get process identification, POSIX
   return (unsigned int)getpid();
 #endif
-
 }
 
 /**
@@ -870,6 +868,7 @@ const std::string &Util::GetRootUID()
    return RootUID;
 }
 
+//-------------------------------------------------------------------------
 /**
  * \brief
  * @param os ostream to write to
@@ -934,5 +933,6 @@ std::ostream &binary_write(std::ostream &os, std::string const &val)
    return os.write(val.c_str(), val.size());
 }
 
+//-------------------------------------------------------------------------
 } // end namespace gdcm
 
index e50ccc1bdecda922c88dd8258926f8d1ee57087d..bd179cf8538ea9334018a94dcf5e243bbe646c48 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmVR.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/28 17:01:30 $
-  Version:   $Revision: 1.33 $
+  Date:      $Date: 2005/02/01 10:29:56 $
+  Version:   $Revision: 1.34 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 namespace gdcm 
 {
+//-----------------------------------------------------------------------------
 void FillDefaultVRDict(VRHT &vr);
+
 //-----------------------------------------------------------------------------
+// Constructor / Destructor
 /**
  * \brief Constructor
  */
 VR::VR() 
 {
    std::string filename = DictSet::BuildDictPath() + DICT_VR;
@@ -68,7 +70,6 @@ VR::VR()
    }
 }
 
-//-----------------------------------------------------------------------------
 /**
  * \brief Destructor
  */
@@ -77,23 +78,6 @@ VR::~VR()
    vr.clear();
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Print all 
- * @param   os The output stream to be written to.
- */
-void VR::Print(std::ostream &os) 
-{
-   std::ostringstream s;
-
-   for (VRHT::iterator it = vr.begin(); it != vr.end(); ++it)
-   {
-      s << "VR : " << it->first << " = " << it->second << std::endl;
-   }
-   os << s.str();
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -105,7 +89,6 @@ int VR::Count(VRKey const &key)
    return vr.count(key);
 }
 
-//-----------------------------------------------------------------------------
 /**
  * \brief   Simple predicate that checks whether the given argument
  *          corresponds to the Value Representation of a \ref BinEntry .
@@ -175,5 +158,21 @@ bool VR::IsValidVR(VRKey const &key)
 // Private
 
 //-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Print all 
+ * @param   os The output stream to be written to.
+ */
+void VR::Print(std::ostream &os) 
+{
+   std::ostringstream s;
 
+   for (VRHT::iterator it = vr.begin(); it != vr.end(); ++it)
+   {
+      s << "VR : " << it->first << " = " << it->second << std::endl;
+   }
+   os << s.str();
+}
+
+//-----------------------------------------------------------------------------
 } // end namespace gdcm
index e2dad4e68f9b9d1f4c1d5cb85a260e052a0421b4..cc1f36381bce8cb6d02f30ddfdedf7d5335a99d9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmValEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/30 17:30:57 $
-  Version:   $Revision: 1.53 $
+  Date:      $Date: 2005/02/01 10:29:56 $
+  Version:   $Revision: 1.54 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -27,8 +27,7 @@
 
 namespace gdcm 
 {
-
-// CLEAN ME
+//-----------------------------------------------------------------------------
 #define MAX_SIZE_PRINT_ELEMENT_VALUE 128
 
 //-----------------------------------------------------------------------------
@@ -58,6 +57,112 @@ ValEntry::~ValEntry ()
 {
 }
 
+//-----------------------------------------------------------------------------
+// Public
+/**
+ * \brief   Sets the std::string representable' value of a ValEntry
+ * @param  val value to set 
+ */
+void ValEntry::SetValue(std::string const &val)
+{
+   // Integers have a special treatement for their length:
+   int l = val.length();
+   if ( l != 0) // To avoid to be cheated by 'zero length' integers
+   {   
+      const VRKey &vr = GetVR();
+      if( vr == "US" || vr == "SS" )
+      {
+         // for multivaluated items
+         l = (Util::CountSubstring(val, "\\") + 1) * 2;
+         ContentEntry::SetValue(val);
+      }
+      else if( vr == "UL" || vr == "SL" )
+      {
+         // for multivaluated items
+         l = (Util::CountSubstring(val, "\\") + 1) * 4;;
+         ContentEntry::SetValue(val);
+      }
+      else
+      {
+         std::string finalVal = Util::DicomString( val.c_str() );
+         gdcmAssertMacro( !(finalVal.size() % 2) );
+
+         l = finalVal.length();
+         ContentEntry::SetValue(finalVal);
+      }
+   }
+   else
+   {
+      std::string finalVal = Util::DicomString( val.c_str() );
+      gdcmAssertMacro( !(finalVal.size() % 2) );
+
+      l = finalVal.length();
+      ContentEntry::SetValue(finalVal);
+   }
+
+   SetLength(l);
+}
+
+/**
+ * \brief   Writes the std::string representable' value of a ValEntry
+ * @param fp already open ofstream pointer
+ * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
+ */
+void ValEntry::WriteContent(std::ofstream *fp, FileType filetype)
+{
+   DocEntry::WriteContent(fp, filetype);
+
+   if ( GetGroup() == 0xfffe )
+   {
+      return; //delimitors have NO value
+   }
+
+   const VRKey &vr = GetVR();
+   unsigned int lgr = GetLength();
+   if (vr == "US" || vr == "SS")
+   {
+      // some 'Short integer' fields may be multivaluated
+      // each single value is separated from the next one by '\'
+      // we split the string and write each value as a short int
+      std::vector<std::string> tokens;
+      tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
+      Util::Tokenize (GetValue(), tokens, "\\");
+      for (unsigned int i=0; i<tokens.size();i++)
+      {
+         uint16_t val_uint16 = atoi(tokens[i].c_str());
+         binary_write( *fp, val_uint16);
+      }
+      tokens.clear();
+      return;
+   }
+   if (vr == "UL" || vr == "SL")
+   {
+      // Some 'Integer' fields may be multivaluated (multiple instances 
+      // of integer). But each single integer value is separated from the
+      // next one by '\' (backslash character). Hence we split the string
+      // along the '\' and write each value as an int:
+      std::vector<std::string> tokens;
+      tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
+      Util::Tokenize (GetValue(), tokens, "\\");
+      for (unsigned int i=0; i<tokens.size();i++)
+      {
+         uint32_t val_uint32 = atoi(tokens[i].c_str());
+         binary_write( *fp, val_uint32);
+      }
+      tokens.clear();
+      return;
+   } 
+
+   gdcmAssertMacro( lgr == GetValue().length() );
+   binary_write(*fp, GetValue());
+} 
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
 //-----------------------------------------------------------------------------
 // Print
 /**
@@ -172,113 +277,6 @@ void ValEntry::Print(std::ostream &os, std::string const &)
    os << s.str();
 }
 
-//-----------------------------------------------------------------------------
-// Public
-
-/**
- * \brief   Sets the std::string representable' value of a ValEntry
- * @param  val value to set 
- */
-void ValEntry::SetValue(std::string const &val)
-{
-   // Integers have a special treatement for their length:
-   int l = val.length();
-   if ( l != 0) // To avoid to be cheated by 'zero length' integers
-   {   
-      const VRKey &vr = GetVR();
-      if( vr == "US" || vr == "SS" )
-      {
-         // for multivaluated items
-         l = (Util::CountSubstring(val, "\\") + 1) * 2;
-         ContentEntry::SetValue(val);
-      }
-      else if( vr == "UL" || vr == "SL" )
-      {
-         // for multivaluated items
-         l = (Util::CountSubstring(val, "\\") + 1) * 4;;
-         ContentEntry::SetValue(val);
-      }
-      else
-      {
-         std::string finalVal = Util::DicomString( val.c_str() );
-         gdcmAssertMacro( !(finalVal.size() % 2) );
-
-         l = finalVal.length();
-         ContentEntry::SetValue(finalVal);
-      }
-   }
-   else
-   {
-      std::string finalVal = Util::DicomString( val.c_str() );
-      gdcmAssertMacro( !(finalVal.size() % 2) );
-
-      l = finalVal.length();
-      ContentEntry::SetValue(finalVal);
-   }
-
-   SetLength(l);
-}
-
-/**
- * \brief   Writes the std::string representable' value of a ValEntry
- * @param fp already open ofstream pointer
- * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
- */
-void ValEntry::WriteContent(std::ofstream *fp, FileType filetype)
-{
-   DocEntry::WriteContent(fp, filetype);
-
-   if ( GetGroup() == 0xfffe )
-   {
-      return; //delimitors have NO value
-   }
-
-   const VRKey &vr = GetVR();
-   unsigned int lgr = GetLength();
-   if (vr == "US" || vr == "SS")
-   {
-      // some 'Short integer' fields may be multivaluated
-      // each single value is separated from the next one by '\'
-      // we split the string and write each value as a short int
-      std::vector<std::string> tokens;
-      tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
-      Util::Tokenize (GetValue(), tokens, "\\");
-      for (unsigned int i=0; i<tokens.size();i++)
-      {
-         uint16_t val_uint16 = atoi(tokens[i].c_str());
-         binary_write( *fp, val_uint16);
-      }
-      tokens.clear();
-      return;
-   }
-   if (vr == "UL" || vr == "SL")
-   {
-      // Some 'Integer' fields may be multivaluated (multiple instances 
-      // of integer). But each single integer value is separated from the
-      // next one by '\' (backslash character). Hence we split the string
-      // along the '\' and write each value as an int:
-      std::vector<std::string> tokens;
-      tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
-      Util::Tokenize (GetValue(), tokens, "\\");
-      for (unsigned int i=0; i<tokens.size();i++)
-      {
-         uint32_t val_uint32 = atoi(tokens[i].c_str());
-         binary_write( *fp, val_uint32);
-      }
-      tokens.clear();
-      return;
-   } 
-
-   gdcmAssertMacro( lgr == GetValue().length() );
-   binary_write(*fp, GetValue());
-} 
-
-//-----------------------------------------------------------------------------
-// Protected
-
-//-----------------------------------------------------------------------------
-// Private
-
 //-----------------------------------------------------------------------------
 } // end namespace gdcm