From: regrain Date: Mon, 12 Jan 2004 13:12:27 +0000 (+0000) Subject: * src/*.h : add comments X-Git-Tag: Version0.3.1~15 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=15d7b1b38f5ddb59d395e0e4e3f9b0250eb90eec;p=gdcm.git * src/*.h : add comments -- BeNours --- diff --git a/ChangeLog b/ChangeLog index 5e88ab4f..2058c649 100644 --- 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 diff --git a/src/gdcm.h b/src/gdcm.h index 802f5ed0..f7ec8fc6 100644 --- a/src/gdcm.h +++ b/src/gdcm.h @@ -15,15 +15,21 @@ #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 diff --git a/src/gdcmCommon.h b/src/gdcmCommon.h index 3db17d81..40e65101 100644 --- a/src/gdcmCommon.h +++ b/src/gdcmCommon.h @@ -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 diff --git a/src/gdcmDictEntry.h b/src/gdcmDictEntry.h index fc3817a6..682803fb 100644 --- a/src/gdcmDictEntry.h +++ b/src/gdcmDictEntry.h @@ -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 { diff --git a/src/gdcmDictSet.h b/src/gdcmDictSet.h index 4256ad8e..a6567752 100644 --- a/src/gdcmDictSet.h +++ b/src/gdcmDictSet.h @@ -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 * GetPubDictTagNames(void); std::map >* @@ -42,6 +44,7 @@ public: gdcmDictSet(void); ~gdcmDictSet(void); void Print(std::ostream& os); + gdcmDict* GetDict(DictKey DictName); gdcmDict* GetDefaultPubDict(void); }; diff --git a/src/gdcmElValSet.h b/src/gdcmElValSet.h index 0140b138..889f37bf 100644 --- a/src/gdcmElValSet.h +++ b/src/gdcmElValSet.h @@ -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 // FIXME For FILE on GCC only +#include #include #include // 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 TagElValueHT; typedef std::map TagElValueNameHT; diff --git a/src/gdcmElValue.h b/src/gdcmElValue.h index 400a03b8..06935834 100644 --- a/src/gdcmElValue.h +++ b/src/gdcmElValue.h @@ -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 -/////////////////////////////////////////////////////////////////////////// -// 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 diff --git a/src/gdcmException.h b/src/gdcmException.h index fee65d6c..094cd568 100644 --- a/src/gdcmException.h +++ b/src/gdcmException.h @@ -6,7 +6,7 @@ #include #include -/** +/* * 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 * diff --git a/src/gdcmFile.h b/src/gdcmFile.h index 9fc32bae..395f7ed4 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -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); diff --git a/src/gdcmHeader.h b/src/gdcmHeader.h index 01caad0b..2bfd53cb 100644 --- a/src/gdcmHeader.h +++ b/src/gdcmHeader.h @@ -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 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 diff --git a/src/gdcmHeaderHelper.h b/src/gdcmHeaderHelper.h index 204a7864..e631b9f0 100644 --- a/src/gdcmHeaderHelper.h +++ b/src/gdcmHeaderHelper.h @@ -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 @@ -51,15 +51,15 @@ 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: diff --git a/src/gdcmHeaderIdo.cxx b/src/gdcmHeaderIdo.cxx index 91a9aecf..28e40085 100644 --- a/src/gdcmHeaderIdo.cxx +++ b/src/gdcmHeaderIdo.cxx @@ -5,10 +5,11 @@ gdcmHeaderIdo::gdcmHeaderIdo (char* InFilename) : gdcmHeader(InFilename) -{ } +{ +} void gdcmHeaderIdo::BuildHeader(void) { - gdcmHeaderIdo::BuildHeader(); + gdcmHeaderIdo::BuildHeader(); setAcrLibido(); } diff --git a/src/gdcmIdo.h b/src/gdcmIdo.h index 5884baea..bd2a6986 100644 --- a/src/gdcmIdo.h +++ b/src/gdcmIdo.h @@ -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); }; diff --git a/src/gdcmTS.h b/src/gdcmTS.h index 6380c07c..fde45c6b 100644 --- a/src/gdcmTS.h +++ b/src/gdcmTS.h @@ -11,8 +11,10 @@ typedef std::string TSKey; typedef std::string TSAtr; typedef std::map 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; diff --git a/src/gdcmUtil.h b/src/gdcmUtil.h index 2566e82f..2e469625 100644 --- a/src/gdcmUtil.h +++ b/src/gdcmUtil.h @@ -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 @@ -10,13 +10,22 @@ #include #include +/* + * 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; diff --git a/src/gdcmVR.h b/src/gdcmVR.h index 9301e24a..f2932193 100644 --- a/src/gdcmVR.h +++ b/src/gdcmVR.h @@ -11,8 +11,10 @@ typedef std::string VRKey; typedef std::string VRAtr; typedef std::map 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;