]> Creatis software - gdcm.git/blobdiff - src/gdcmHeaderEntry.h
BUG: JP suggest me to do this change
[gdcm.git] / src / gdcmHeaderEntry.h
index 0bb7c5938eaa9b1408a9a09114be0d82f90728f1..178cefffc3d3fd2b16e4b68d3cf8f1093117d0bc 100644 (file)
 class gdcmHeader;
 
 //-----------------------------------------------------------------------------
-/*
- * The dicom header of a Dicom file contains a set of such entries
- * (when successfuly parsed against a given Dicom dictionary)
+/**
+ * \ingroup gdcmHeaderEntry
+ * \brief   The dicom header of a Dicom file contains a set of such entries
+ *          (when successfuly parsed against a given Dicom dictionary)
  */
 class GDCM_EXPORT gdcmHeaderEntry {
 public:
    gdcmHeaderEntry(gdcmDictEntry*);
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   returns the Dicom Group number of the current Dicom Header Entry
-    * @return 
-    */    
+
+   /// Returns the Dicom Group number of the current Dicom Header Entry
    inline guint16      GetGroup(void)     { return entry->GetGroup();  };
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   returns the Dicom Element number of the current Dicom Header Entry
-    * @return 
-    */ 
+
+   /// Returns the Dicom Element number of the current Dicom Header Entry
    inline guint16      GetElement(void)   { return entry->GetElement();};
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   returns the 'key' of the current Dicom Header Entry
-    * @return 
-    */
+
+   /// Returns the 'key' of the current Dicom Header Entry
    inline std::string  GetKey(void)       { return entry->GetKey();    };
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   returns the 'Name' '(e.g. "Patient's Name")
-    *          found in the Dicom Dictionnary
-    *          of the current Dicom Header Entry
-    * @return
-    */ 
+
+   /// \brief Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom
+   /// Dictionnary of the current Dicom Header Entry
    inline std::string  GetName(void)      { return entry->GetName();   };
 
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   returns the 'Value Representation' 
-    *          (e.g. "PN" : Person Name, "SL" : Signed Long),
-    *          found in the Dicom Header or in the Dicom Dictionnary,
-    *          of the current Dicom Header Entry
-    * @return
-    */
+   /// \brief Returns the 'Value Representation' (e.g. "PN" : Person Name,
+   /// "SL" : Signed Long), found in the Dicom Header or in the Dicom
+   /// Dictionnary, of the current Dicom Header Entry
    inline std::string  GetVR(void)        { return entry->GetVR();     };
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   returns the 'Value' (e.g. "Dupond Marcel")
-    *          converted into a 'string', if it's stored as an integer
-    *          in the Dicom Header
-    *          of the current Dicom Header Entry
-    * @return
-    */ 
+
+   /// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted into a
+   /// 'string', if it's stored as an integer in the Dicom Header of the
+   /// current Dicom Header Entry
    inline std::string  GetValue(void)     { return value;              };
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   returns the area value of the current Dicom Header Entry
-    *          when it's not string-translatable
-    *          (e.g : a LUT table)         
-    * @return
-    */    
+
+   /// \brief Returns the area value of the current Dicom Header Entry
+   ///  when it's not string-translatable (e.g : a LUT table)         
    inline void *       GetVoidArea(void)  { return voidArea;           };
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   returns offset (since the beginning of the file,
-    *          including the File Pramble, if any)
-    *          of the value of the current Dicom Header Entry
-    * \warning : offset of the *value*, not of the Dicom Header Entry
-    *  
-    * @return
-    */    
+
+   /// \brief Returns offset (since the beginning of the file, including
+   /// the File Pramble, if any) of the value of the current Dicom HeaderEntry
+   /// \warning offset of the *value*, not of the Dicom Header Entry
    inline size_t       GetOffset(void)    { return Offset;             };
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   returns the actual value length of the current Dicom Header Entry
-    * \warning this value is not *allways* the one stored in the Dicom Header
-    *          in case on well knowned buggs
-    * @return
-    */        
-   inline guint32      GetLength(void)    { return UsableLength;       };
+
+   /// \brief Returns the actual value length of the current Dicom Header Entry
+   /// \warning this value is not *allways* the one stored in the Dicom Header
+   ///          in case of well knowned bugs
+   inline guint32 GetLength(void) { return UsableLength; };
     
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   returns the 'read length' of the current Dicom Header Entry
-    * \warning this value is the one stored in the Dicom Header
-    *          but not mandatoryly the one thats's used
-    *          (in case on SQ, or delimiters, the usable length is set to zero)
-    * @return
-    */     
-   inline guint32      GetReadLength(void) { return ReadLength;};
-
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   Sets the 'Value Representation' of the current Dicom Header Entry
-    */   
-   inline void         SetVR(std::string v)      { entry->SetVR(v);          };    
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   Sets both 'Read Length' and 'Usable Length'
-    *          of the current Dicom Header Entry
-    */ 
-   inline void         SetLength(guint32 l)      { ReadLength=UsableLength=l;};
+   /// \brief Returns the 'read length' of the current Dicom Header Entry
+   /// \warning this value is the one stored in the Dicom Header but not
+   ///          mandatoryly the one thats's used (in case on SQ, or delimiters,
+   ///          the usable length is set to zero)
+   inline guint32 GetReadLength(void) { return ReadLength; };
+
+   /// Sets the 'Value Representation' of the current Dicom Header Entry
+   inline void SetVR(std::string v) { entry->SetVR(v); };    
+
+   /// \brief Sets both 'Read Length' and 'Usable Length' of the current
+   /// Dicom Header Entry
+   inline void SetLength(guint32 l) { ReadLength=UsableLength=l;};
       
    // The following 3 members, for internal use only ! 
    
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   Sets only 'Read Length' (*not* 'Usable Length')
-    *          of the current Dicom Header Entry
-    */ 
-   inline void         SetReadLength(guint32 l)  { ReadLength   = l; };
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   Sets only 'Usable Length' (*not* 'Read Length')
-    *          of the current Dicom Header Entry
-    */         
-   inline void         SetUsableLength(guint32 l){ UsableLength = l; }; 
-       
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   Sets the value (string)
-    *          of the current Dicom Header Entry
-    */         
-   inline void         SetValue(std::string val) { value = val;      };
-
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   Sets the value (non string)
-    *          of the current Dicom Header Entry
-    */ 
-    inline void         SetVoidArea(void * area)  { voidArea = area;  };
+   /// \brief Sets only 'Read Length' (*not* 'Usable Length') of the current
+   /// Dicom Header Entry
+   inline void SetReadLength(guint32 l) { ReadLength   = l; };
+
+   /// \brief Sets only 'Usable Length' (*not* 'Read Length') of the current
+   /// Dicom Header Entry
+   inline void SetUsableLength(guint32 l) { UsableLength = l; }; 
+    
+   /// Sets the value (string) of the current Dicom Header Entry
+   inline void SetValue(std::string val) {  value = val; };
+
+   /// Sets the value (non string) of the current Dicom Header Entry
+   inline void SetVoidArea(void * area)  { voidArea = area;  };
    
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   Sets the offset of the Dicom Element
-    * \warning : use with caution !
-    * @param   of offset to be set
-    */
+   /// \brief   Sets the offset of the Dicom Element
+   /// \warning use with caution !
+   /// @param   of offset to be set
    inline void gdcmHeaderEntry::SetOffset(size_t of) { Offset = of; };
 
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   Sets to TRUE the ImplicitVr flag of the current Dicom Element
-    */
+   /// Sets to TRUE the ImplicitVr flag of the current Dicom Element
    inline void gdcmHeaderEntry::SetImplicitVR(void) { ImplicitVR = true; };
  
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   tells us if the current Dicom Element was checked as ImplicitVr
-    * @return true if the current Dicom Element was checked as ImplicitVr
-    */ 
-   inline bool  gdcmHeaderEntry::IsImplicitVR(void) { return ImplicitVR; };
-
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   tells us if the VR of the current Dicom Element is Unkonwn
-    * @return true if the VR is unkonwn
-    */ 
-   inline bool   gdcmHeaderEntry::IsVRUnknown(void) { return entry->IsVRUnknown(); };
-
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   Sets the DicEntry of the current Dicom Element
-    * @param   NewEntry pointer to the DictEntry
-    */ 
-   inline void gdcmHeaderEntry::SetDictEntry(gdcmDictEntry *NewEntry) { 
-      entry = NewEntry;
-   };
-
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   Gets the DicEntry of the current Dicom Element
-    * @return  the DicEntry of the current Dicom Element
-    */
+   /// \brief Tells us if the current Dicom Element was checked as ImplicitVr
+   /// @return true if the current Dicom Element was checked as ImplicitVr
+   inline bool gdcmHeaderEntry::IsImplicitVR(void) { return ImplicitVR; };
+
+   /// \brief Tells us if the VR of the current Dicom Element is Unkonwn
+   /// @return true if the VR is unkonwn
+   inline bool gdcmHeaderEntry::IsVRUnknown(void)
+               { return entry->IsVRUnknown(); };
+
+   /// \brief   Sets the DicEntry of the current Dicom Element
+   /// @param   NewEntry pointer to the DictEntry
+   inline void gdcmHeaderEntry::SetDictEntry(gdcmDictEntry *NewEntry)
+               { entry = NewEntry; };
+
+   /// \brief  Gets the DicEntry of the current Dicom Element
+   /// @return The DicEntry of the current Dicom Element
    gdcmDictEntry * gdcmHeaderEntry::GetDictEntry(void) { return entry; }; 
 
-   /**
-    * \ingroup gdcmHeaderEntry
-    * \brief   Sets the print level for the Dicom Header Elements
-    * \note 0 for Light Print; 1 for 'medium' Print, 2 for Heavy
-    */
+   /// \brief Sets the print level for the Dicom Header Elements
+   /// \note 0 for Light Print; 1 for 'medium' Print, 2 for Heavy
    void SetPrintLevel(int level) { printLevel = level; };
-   void Print (std::ostream & os = std::cout); 
 
+   void Print (std::ostream & os = std::cout); 
+    
+   /// Gets the depth level of a Dicom Header Entry embedded in a SeQuence
+   inline int GetSQDepthLevel(void) { return (SQDepthLevel); };
+         
+   guint32 GetFullLength(void);
+   
 private:
    // FIXME: In fact we should be more specific and use :
    // friend gdcmHeaderEntry * gdcmHeader::ReadNextElement(void);
    friend class gdcmHeader;
 
+   /// Sets the depth level of a Dicom Header Entry embedded in a SeQuence 
+   inline void SetSQDepthLevel(int depthLevel) { SQDepthLevel = depthLevel; };
+      
 // Variables
    gdcmDictEntry *entry;
-   guint32 UsableLength;  // Updated from ReadLength, by FixFoungLentgh()
-                          // for fixing a bug in the header 
-                          // or helping 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
-       
-   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.
-                         
 
+   /// \brief Updated from ReadLength, by FixFoungLentgh() for fixing a bug
+   /// in the header or helping the parser going on    
+   guint32 UsableLength; 
+  
+   /// \brief 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.
+   guint32 ReadLength;
+
+   /// \brief 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.
+   bool ImplicitVR;
+  
+   /// \brief Header Entry value, stores as a std::string (VR will be used,
+   /// later, to decode)
    std::string  value;
-   void *voidArea;   // unsecure memory area to hold 'non string' values 
-                     // (ie : Lookup Tables, overlays)
-   size_t Offset;    // Offset from the begining of file for direct user access
+
+   /// \brief unsecure memory area to hold 'non string' values 
+   /// (ie : Lookup Tables, overlays)   
+   void *voidArea;
+
+   /// Offset from the begining of file for direct user access
+   size_t Offset; 
+
+   /// How many details are to be printed (value : 0,1,2)      
    int printLevel;
+   
+   /// Gives the depth level of elements inside SeQuences   
+   int SQDepthLevel;
 };
 
 //-----------------------------------------------------------------------------