]> Creatis software - gdcm.git/blobdiff - src/gdcmHeader.h
ENH: If NDEBUG is passed to prepro then all debug stuff are yanked (should improve...
[gdcm.git] / src / gdcmHeader.h
index 684b99aac0d2641d1caebf7fc3654684111f981d..87a10f130f0fc6d296d82dc60fc3883f8878adc2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmHeader.h,v $
   Language:  C++
-  Date:      $Date: 2004/10/18 12:49:22 $
-  Version:   $Revision: 1.90 $
+  Date:      $Date: 2005/01/11 23:06:35 $
+  Version:   $Revision: 1.100 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 #ifndef GDCMHEADER_H
 #define GDCMHEADER_H
 
-#include "gdcmCommon.h"
 #include "gdcmDocument.h"
+
 namespace gdcm 
 {
 
-
-//-----------------------------------------------------------------------------
-/**
- * \brief
- * The purpose of an instance of Header 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 Header 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. Accessing 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 Header
- *        instances.
- * \note  The Header::Set*Tag* family members cannot be defined as
- *        protected due to Swig limitations for as Has_a dependency between
- *        File and Header.
- */
-
 //-----------------------------------------------------------------------------
 // Dicom Part 3.3 Compliant
 enum ModalityType {
@@ -92,6 +70,26 @@ enum ModalityType {
    XA,       // X-Ray Angiography
    XC        // Photographic Imaging
 };
+
+//-----------------------------------------------------------------------------
+/**
+ * \brief 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 Header 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. Accessing 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 Header
+ *        instances.
+ * \note  The Header::Set*Tag* family members cannot be defined as
+ *        protected due to Swig limitations for as Has_a dependency between
+ *        File and Header.
+ */
+
 //-----------------------------------------------------------------------------
 
 class GDCM_EXPORT Header : public Document
@@ -112,12 +110,12 @@ protected:
 
 public:
    Header();
-   Header( std::string const & filename );
+   Header( std::string const &filename );
  
-   virtual ~Header();
+   ~Header();
 
    // Standard values and informations contained in the header
-   virtual bool IsReadable();
+   bool IsReadable();
 
    // Some heuristic based accessors, end user intended 
    int GetBitsStored();
@@ -143,7 +141,6 @@ public:
    float GetXSpacing();
    float GetYSpacing();
    float GetZSpacing();
-   //void GetSpacing(float &x, float &y, float &z);
 
    // Useful for rescaling graylevel:
    float GetRescaleIntercept();
@@ -158,26 +155,27 @@ public:
    float GetXOrigin();
    float GetYOrigin();
    float GetZOrigin();
-   //void GetOrigin(float &x, float &y, float &z);
 
    bool   HasLUT();
    int    GetLUTNbits();
 
-   std::string GetTransfertSyntaxName();
-
    /// Accessor to \ref Header::GrPixel
    uint16_t GetGrPixel()  { return GrPixel; }
    
    /// Accessor to \ref Header::NumPixel
    uint16_t GetNumPixel() { return NumPixel; }
 
-   /// Read (used in File)
-   void SetImageDataSize(size_t expectedSize);
+   bool Write(std::string fileName, FileType filetype);
 
-   void Write(FILE* fp, FileType filetype);
+   /// Initialize DICOM header when none
+   void InitializeDefaultHeader();
  
 protected:
+   /// Replace patient's specific information by 'anonymous'
    bool AnonymizeHeader();
+
+   /// Helper function needed to organize DICOM files based on 
+   /// their x,y,z position
    void GetImageOrientationPatient( float iop[6] );
 
 private: