]> Creatis software - gdcm.git/commitdiff
* src/*.h : add comments
authorregrain <regrain>
Mon, 12 Jan 2004 13:12:27 +0000 (13:12 +0000)
committerregrain <regrain>
Mon, 12 Jan 2004 13:12:27 +0000 (13:12 +0000)
     -- BeNours

16 files changed:
ChangeLog
src/gdcm.h
src/gdcmCommon.h
src/gdcmDictEntry.h
src/gdcmDictSet.h
src/gdcmElValSet.h
src/gdcmElValue.h
src/gdcmException.h
src/gdcmFile.h
src/gdcmHeader.h
src/gdcmHeaderHelper.h
src/gdcmHeaderIdo.cxx
src/gdcmIdo.h
src/gdcmTS.h
src/gdcmUtil.h
src/gdcmVR.h

index 5e88ab4fb3f5c8491fc573fca6127178639e40c7..2058c649d14696bc971472bcbeba260d9e87050e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2004-01-12 Benoit Regrain
+     * src/*.h : add comments
+     
 2004-01-09 Benoit Regrain
      * gdcmPython/gdcmVersion.py : add a gdcmVERSION variable information
      * setup.py : use a reference to gdcmVERSION
index 802f5ed05ca7620b56cf497c1bf8a283158762ec..f7ec8fc6cb367fc68e93c6cefc99462663288e37 100644 (file)
 
 #include "gdcmException.h"
 #include "gdcmCommon.h"
+
 #include "gdcmDictEntry.h"
 #include "gdcmDict.h"
 #include "gdcmDictSet.h"
+
 #include "gdcmElValue.h"
 #include "gdcmElValSet.h"
+
 #include "gdcmHeader.h"
+#include "gdcmHeaderHelper.h"
+#include "gdcmIdo.h"
 #include "gdcmFile.h"
 
-//class gdcmSerie : gdcmFile;
-//class gdcmMultiFrame : gdcmFile;
+//#include "gdcmTS.h"
+//#include "gdcmVR.h"
+//#include "gdcmUtil.h"
 
 #endif // #ifndef GDCM_H
index 3db17d81b59fb29dbe1fe43459f8c8604ff92c07..40e651014c4df5bfa2a98f2085e2871c0cd314f5 100644 (file)
@@ -71,5 +71,4 @@ enum FileType {
 //For now gdcm is not willing cmake, try to be more quiet
 //#cmakedefine GDCM_NO_ANSI_STRING_STREAM
 
-
 #endif
index fc3817a61eb617dc30fd7f690b5bdbeecdb03d84..682803fb6877d3387b6f06ebd9b0fb4f2e73efc3 100644 (file)
@@ -5,6 +5,14 @@
 
 #include "gdcmCommon.h"
 
+/*
+ * the gdcmDictEntry in an element contained by the gdcmDict.
+ * It contains :
+ *  - the key referenced by the DICOM norm or the constructor (for private keys)
+ *  - the corresponding name in english (it's equivalent to a label)
+ *  - the owner group
+ *  - etc.
+ */
 class GDCM_EXPORT gdcmDictEntry {
 private:
    // FIXME : were are the group and element used except from building up
@@ -21,6 +29,7 @@ private:
    std::string  name;   // e.g. "Patient_Name"
    TagKey  key;         // Redundant with (group, element) but we add it
                         // on efficiency purposes.
+
        // DCMTK has many fields for handling a DictEntry (see below). What are the
        // relevant ones for gdcmlib ?
        //      struct DBI_SimpleEntry {
index 4256ad8e3fc29defb1f33f0b6338ef1c05a3a42e..a65677523650943954f30001d1236469d02033d4 100644 (file)
@@ -24,9 +24,11 @@ private:
        DictSetHT Dicts;
    /// Directory path to dictionaries
    std::string DictPath;
+
        int AppendDict(gdcmDict* NewDict);
        void LoadDictFromFile(std::string FileName, DictKey Name);
    std::string BuildDictPath(void);
+
 public:
    std::list<std::string> * GetPubDictTagNames(void);
    std::map<std::string, std::list<std::string> >*
@@ -42,6 +44,7 @@ public:
        gdcmDictSet(void);
        ~gdcmDictSet(void);
        void Print(std::ostream& os);
+
        gdcmDict* GetDict(DictKey DictName);
        gdcmDict* GetDefaultPubDict(void);
 };
index 0140b1385147e1bb687ddf84039f12987a0f26b3..889f37bf3c13c2a4df05e7493203f0310ef47fcb 100644 (file)
@@ -1,4 +1,4 @@
-// $Header: /cvs/public/gdcm/src/Attic/gdcmElValSet.h,v 1.19 2003/11/13 18:08:34 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmElValSet.h,v 1.20 2004/01/12 13:12:28 regrain Exp $
 
 #ifndef GDCMELVALSET_H
 #define GDCMELVALSET_H
@@ -6,13 +6,13 @@
 #include "gdcmCommon.h"
 #include "gdcmElValue.h"
 
-#include <stdio.h>    // FIXME For FILE on GCC only
+#include <stdio.h>
 #include <map>
 #include <list>       // for linking together *all* the Dicom Elements
 
-////////////////////////////////////////////////////////////////////////////
-// Container for a set of successfully parsed ElValues.
-
+/*
+ * Container for a set of successfully parsed ElValues.
+ */
 typedef std::map<TagKey,      gdcmElValue*> TagElValueHT;
 typedef std::map<std::string, gdcmElValue*> TagElValueNameHT;
    
index 400a03b89331f601ec6c38196e88f56000987e35..06935834273a4746b3c98c1792cc85f0ca021494 100644 (file)
@@ -1,4 +1,4 @@
-// $Header: /cvs/public/gdcm/src/Attic/gdcmElValue.h,v 1.9 2003/11/10 14:17:12 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmElValue.h,v 1.10 2004/01/12 13:12:28 regrain Exp $
 
 #ifndef GDCMELVALUE_H
 #define GDCMELVALUE_H
@@ -8,33 +8,36 @@ class gdcmHeader;
 
 #include <stdio.h>
 
-///////////////////////////////////////////////////////////////////////////
-// The dicom header of a Dicom file contains a set of such ELement VALUES
-// (when successfuly parsed against a given Dicom dictionary)
+/*
+ * The dicom header of a Dicom file contains a set of such ELement VALUES
+ * (when successfuly parsed against a given Dicom dictionary)
+ */
 class GDCM_EXPORT gdcmElValue {
 private:
    gdcmDictEntry *entry;
    guint32 UsableLength;  // Updated from ReadLength, by FixFoungLentgh()
                           // for fixing a bug in the header or helping
-                         // the parser going on 
+                          // the parser going on 
                          
    guint32 ReadLength;    // Length actually read on disk
                           // (before FixFoundLength)
-                         // ReadLength will be updated only when
-                         // FixFoundLength actually fixes a bug in the header,
-                         // not when it performs a trick to help the Parser
-                         // going on.
-                         // *for internal* use only
+                          // ReadLength will be updated only when
+                          // FixFoundLength actually fixes a bug in the header,
+                          // not when it performs a trick to help the Parser
+                          // going on.
+                          // *for internal* use only
        
-   bool ImplicitVr;       // Even when reading explicit vr files, some
+   bool ImplicitVr;  // Even when reading explicit vr files, some
                          // elements happen to be implicit. Flag them here
                          // since we can't use the entry->vr without breaking
                          // the underlying dictionary.
                          
    void SetOffset(size_t of){ Offset = of; };
+
    // FIXME: In fact we should be more specific and use :
-   //friend gdcmElValue * gdcmHeader::ReadNextElement(void);
+   // friend gdcmElValue * gdcmHeader::ReadNextElement(void);
    friend class gdcmHeader;
+
 public:
    std::string  value;
    void * voidArea;  // unsecure memory area to hold 'non string' values 
index fee65d6c748e4a61bfe068c4769cb3f3fd75f789..094cd5682b9e55fd3651c447cb1e81ccf9335cde 100644 (file)
@@ -6,7 +6,7 @@
 #include <iostream>
 #include <exception>
 
-/**
+/*
  * Any exception thrown in the gdcm library
  */
 class GDCM_EXPORT gdcmException : public std::exception {
@@ -17,7 +17,7 @@ class GDCM_EXPORT gdcmException : public std::exception {
   std::string error;
 
  public:
-  /**
+  /*
    * Builds an exception with minimal information: name of the thrower
    * method and error message
    *
@@ -28,7 +28,7 @@ class GDCM_EXPORT gdcmException : public std::exception {
     throw();
   
 
-  /**
+  /*
    * virtual destructor makes this class dynamic
    */
   virtual ~gdcmException() throw() {
@@ -59,7 +59,7 @@ class GDCM_EXPORT gdcmException : public std::exception {
 };
 
 
-/** prints exception stack on output stream
+/* prints exception stack on output stream
  * @param os output stream
  * @param e exception to print
  * @returns output stream os
@@ -67,12 +67,12 @@ class GDCM_EXPORT gdcmException : public std::exception {
 std::ostream& operator<<(std::ostream &os, const gdcmException &e);
 
 
-/**
+/*
  * File error exception thrown in the gdcm library
  */
 class GDCM_EXPORT gdcmFileError : public gdcmException {
  public:
-  /**
+  /*
    * Builds an file-related exception with minimal information: name of
    * the thrower method and error message
    *
@@ -86,12 +86,12 @@ class GDCM_EXPORT gdcmFileError : public gdcmException {
 };
 
 
-/**
+/*
  * Invalid file format exception
  */
 class GDCM_EXPORT gdcmFormatError : public gdcmException {
  public:
-  /**
+  /*
    * Builds an file-related exception with minimal information: name of
    * the thrower method and error message
    *
index 9fc32baed090dbfc5dfb690aa5d77036b44a932f..395f7ed45b6e415164303fd9c0595f721919dfdd 100644 (file)
@@ -6,11 +6,11 @@
 #include "gdcmCommon.h"
 #include "gdcmHeader.h"
 
-////////////////////////////////////////////////////////////////////////////
-// In addition to Dicom header exploration, this class is designed
-// for accessing the image/volume content. One can also use it to
-// write Dicom files.
-
+/*
+ * In addition to Dicom header exploration, this class is designed
+ * for accessing the image/volume content. One can also use it to
+ * write Dicom files.
+ */
 class GDCM_EXPORT gdcmFile
 {
 private:
@@ -35,7 +35,6 @@ private:
 // For Run Length Encoding (TOCHECK)
    bool gdcm_read_RLE_file      (FILE *fp,void * image_buffer); 
 
-     
 protected:
    int WriteBase(std::string FileName, FileType type);
 
@@ -53,7 +52,7 @@ public:
 
        // On writing purposes. When instance was created through
        // gdcmFile(std::string filename) then the filename argument MUST be
-        // different from the constructor's one (no overwriting allowed).
+   // different from the constructor's one (no overwriting allowed).
        // TODO Swig int SetFileName(std::string filename);
 
    void   SetPixelDataSizeFromHeader(void);
@@ -81,7 +80,6 @@ public:
        // Ecrit sur disque les pixels d'UNE image
        // Aucun test n'est fait sur l'"Endiannerie" du processeur.
        // Ca sera à l'utilisateur d'appeler son Reader correctement
-               
    int WriteRawData  (std::string fileName);
    int WriteDcmImplVR(std::string fileName);
    int WriteDcmImplVR(const char * fileName);
index 01caad0b8afb816701b94dd5088428ac5090ab2c..2bfd53cb3cbc8fc9f3a9fa3955b766d62452b7e3 100644 (file)
@@ -1,4 +1,4 @@
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.h,v 1.45 2003/12/22 12:46:16 regrain Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.h,v 1.46 2004/01/12 13:12:28 regrain Exp $
 
 #ifndef GDCMHEADER_H
 #define GDCMHEADER_H
@@ -16,23 +16,24 @@ typedef std::string VRKey;
 typedef std::string VRAtr;
 typedef std::map<VRKey, VRAtr> VRHT;    // Value Representation Hash Table
 
-/// The purpose of an instance of gdcmHeader is to act as a container of
-/// all the DICOM elements and their corresponding values (and
-/// additionaly the corresponding DICOM dictionary entry) of the header
-/// of a DICOM file.
-///
-/// The typical usage of instances of class gdcmHeader is to classify a set of
-/// dicom files according to header information e.g. to create a file hierarchy
-/// reflecting the Patient/Study/Serie informations, or extracting a given
-/// SerieId. Accesing the content (image[s] or volume[s]) is beyond the
-/// functionality of this class and belongs to gdmcFile.
-/// \note  The various entries of the explicit value representation (VR) shall
-///        be managed within a dictionary which is shared by all gdcmHeader
-///        instances.
-/// \note  The gdcmHeader::Set*Tag* family members cannot be defined as
-///        protected due to Swig limitations for as Has_a dependency between
-///        gdcmFile and gdcmHeader.
-
+/*
+ * The purpose of an instance of gdcmHeader is to act as a container of
+ * all the DICOM elements and their corresponding values (and
+ * additionaly the corresponding DICOM dictionary entry) of the header
+ * of a DICOM file.
+ *
+ * The typical usage of instances of class gdcmHeader is to classify a set of
+ * dicom files according to header information e.g. to create a file hierarchy
+ * reflecting the Patient/Study/Serie informations, or extracting a given
+ * SerieId. Accesing the content (image[s] or volume[s]) is beyond the
+ * functionality of this class and belongs to gdmcFile.
+ * \note  The various entries of the explicit value representation (VR) shall
+ *        be managed within a dictionary which is shared by all gdcmHeader
+ *        instances.
+ * \note  The gdcmHeader::Set*Tag* family members cannot be defined as
+ *        protected due to Swig limitations for as Has_a dependency between
+ *        gdcmFile and gdcmHeader.
+ */
 class GDCM_EXPORT gdcmHeader {
 private:
    /// Pointer to the Value Representation Hash Table which contains all
index 204a78645a04d5ee37ed17f0ebb234662ac98c52..e631b9f060e2ce5aec8542ff7e5a808e7a6473bc 100644 (file)
@@ -1,4 +1,4 @@
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.h,v 1.8 2003/12/22 12:46:16 regrain Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.h,v 1.9 2004/01/12 13:12:28 regrain Exp $
 
 #ifndef GDCMHEADERHELPER_H
 #define GDCMHEADERHELPER_H
       XC        // Photographic Imaging
     };
       
-/**
-  This class is meant to *interpret* data given from gdcmHeader
-  That is to say :
  * it will help other dev to link against there lib
  * return value instead of string
  * will be able to search for data at some other place
  * return *default value* which is not a gdcmHeader goal
  * ...
-*/
+/*
* This class is meant to *interpret* data given from gdcmHeader
* That is to say :
*  - it will help other dev to link against there lib
*  - return value instead of string
*  - will be able to search for data at some other place
*  - return *default value* which is not a gdcmHeader goal
*  - ...
+ */
 class GDCM_EXPORT gdcmHeaderHelper : public gdcmHeader {
 
 public:
index 91a9aecfd1b584a9c89b959d704808f3e1d48d6e..28e4008506b8c20439c7b30a74e2e7a71d1ccc9e 100644 (file)
@@ -5,10 +5,11 @@
 
 gdcmHeaderIdo::gdcmHeaderIdo (char* InFilename)
        : gdcmHeader(InFilename)
-{ }
+{ 
+}
 
 void gdcmHeaderIdo::BuildHeader(void) {
-        gdcmHeaderIdo::BuildHeader();
+   gdcmHeaderIdo::BuildHeader();
        setAcrLibido();
 }
 
index 5884baea549a4690400bcbdafc5ade5dd03ace3e..bd2a69860ffdc831ff587bbd20ccf9939ab17c56 100644 (file)
@@ -2,10 +2,18 @@
 
 #include "gdcmHeader.h"
 
+/*
+ * A gdcmHeaderIdo is a specific gdcmHeader that recognize
+ * the creation's source of the file : the libIdo library.
+ * Thus the file type is modified in consequence.
+ *
+ * \see gdcmHeader
+ */
 class gdcmHeaderIdo: protected gdcmHeader {
 private:
        void setAcrLibido(void);
        void BuildHeader(void);
+
 public:
        gdcmHeaderIdo(char* filename);
 };
index 6380c07c82328e2834cd6e87cf2ffd84e3af8472..fde45c6b33b4c5ff7c7c4a7e7b4c2fb733e8085b 100644 (file)
@@ -11,8 +11,10 @@ typedef std::string TSKey;
 typedef std::string TSAtr;
 typedef std::map<TSKey, TSAtr> TSHT;    // Transfert Syntax Hash Table
 
-/// Container for dicom Transfert Syntax Hash Table
-/// \note   This is a singleton
+/*
+ * Container for dicom Transfert Syntax Hash Table
+ * \note   This is a singleton
+ */
 class GDCM_EXPORT gdcmTS {
 private:
    TSHT ts;    
index 2566e82fbd1a15e6f06898e556ee2b7bdd8db81b..2e4696258e524baddc8fd267ea68a42a12279ad5 100644 (file)
@@ -1,4 +1,4 @@
-// $Header: /cvs/public/gdcm/src/gdcmUtil.h,v 1.16 2003/10/02 11:26:16 malaterre Exp $
+// $Header: /cvs/public/gdcm/src/gdcmUtil.h,v 1.17 2004/01/12 13:12:28 regrain Exp $
 
 #ifndef GDCMUTIL_H
 #define GDCMUTIL_H
 #include <vector>
 #include <string>
 
+/*
+ * gdcmDebug is an object for debugging in program.
+ * It has 2 debugging modes :
+ *  - error : for bad library use
+ *  - debug : for debugging messages
+ * 
+ * A debugging message has a level of priority and is 
+ * Shown only when the debug level is higher than the 
+ * message level.
+ */
 class gdcmDebug {
 private:
        int DebugLevel;
 public:
        gdcmDebug(int  = 0);
        void Verbose(int, const char*, const char* ="");
-//     void Verbose(int, char*, char*);
        void Error(bool, const char*,  const char* ="");
        void Error(const char*, const char* ="", const char* ="");
        void Assert(int, bool, const char*, const char*);
@@ -24,6 +33,10 @@ public:
        void SetDebug (int i) {DebugLevel = i;}
 };
 
+/*
+ * This class contains all globals elements that might be
+ * instanciated only one time
+ */
 class gdcmGlobal {
 private:
    static gdcmVR *VR;
index 9301e24a2b59b9d24f523cb39cf3681e6c6489fe..f29321936257a943ab0c84f13547162eab326dbd 100644 (file)
@@ -11,8 +11,10 @@ typedef std::string VRKey;
 typedef std::string VRAtr;
 typedef std::map<VRKey, VRAtr> VRHT;    // Value Representation Hash Table
 
-/// Container for dicom Value Representation Hash Table
-/// \note   This is a singleton
+/*
+ * Container for dicom Value Representation Hash Table
+ * \note   This is a singleton
+ */
 class GDCM_EXPORT gdcmVR {
 private:
    VRHT vr;