]> Creatis software - gdcm.git/blobdiff - src/gdcmHeaderHelper.h
ENH: Adding 'gdcm' namespace. Be nice with me this was a ~13000 lines patch. Also...
[gdcm.git] / src / gdcmHeaderHelper.h
index e631b9f060e2ce5aec8542ff7e5a808e7a6473bc..5dc42bfc916e123e479e13b4da4c32380f6fc559 100644 (file)
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.h,v 1.9 2004/01/12 13:12:28 regrain Exp $
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: gdcmHeaderHelper.h,v $
+  Language:  C++
+  Date:      $Date: 2004/10/12 04:35:46 $
+  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
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
 
 #ifndef GDCMHEADERHELPER_H
 #define GDCMHEADERHELPER_H
 
 #include "gdcmHeader.h"
 
-   // Dicom Part 3.3 Compliant
-   enum ModalityType {
-      Unknow,
-      AU,       // Voice Audio
-      AS,       // Angioscopy
-      BI,       // Biomagnetic Imaging
-      CF,       // Cinefluorography
-      CP,       // Culposcopy
-      CR,       // Computed Radiography
-      CS,       // Cystoscopy
-      CT,       // Computed Tomography
-      DD,       // Duplex Dopler
-      DF,       // Digital Fluoroscopy
-      DG,       // Diaphanography
-      DM,       // Digital Microscopy
-      DS,       // Digital Substraction Angiography
-      DX,       // Digital Radiography
-      ECG,      // Echocardiography
-      EPS,      // Basic Cardiac EP
-      ES,       // Endoscopy
-      FA,       // Fluorescein Angiography
-      FS,       // Fundoscopy
-      HC,       // Hard Copy
-      HD,       // Hemodynamic
-      LP,       // Laparoscopy
-      LS,       // Laser Surface Scan
-      MA,       // Magnetic Resonance Angiography
-      MR,       // Magnetic Resonance
-      NM,       // Nuclear Medicine
-      OT,       // Other
-      PT,       // Positron Emission Tomography
-      RF,       // Radio Fluoroscopy
-      RG,       // Radiographic Imaging
-      RTDOSE,   // Radiotherapy Dose
-      RTIMAGE,  // Radiotherapy Image
-      RTPLAN,   // Radiotherapy Plan
-      RTSTRUCT, // Radiotherapy Structure Set
-      SM,       // Microscopic Imaging
-      ST,       // Single-photon Emission Computed Tomography
-      TG,       // Thermography
-      US,       // Ultrasound
-      VF,       // Videofluorography
-      XA,       // X-Ray Angiography
-      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
- *  - ...
- */
-class GDCM_EXPORT gdcmHeaderHelper : public gdcmHeader {
-
-public:
-   gdcmHeaderHelper::gdcmHeaderHelper();
-   gdcmHeaderHelper::gdcmHeaderHelper(const char *filename, bool exception_on_error = false);
-
-   int GetPixelSize();
-   std::string GetPixelType();
-   
-   float GetXSpacing();
-   float GetYSpacing();
-   float GetZSpacing();
-   
-   //Usefull for rescaling graylevel:
-   float GetRescaleIntercept();
-   float GetRescaleSlope();
-
-   int GetNumberOfScalarComponents();
-   int GetNumberOfScalarComponentsRaw();
-
-   std::string GetStudyUID();
-   std::string GetSeriesUID();
-   std::string GetClassUID();
-   std::string GetInstanceUID();
-   
-    /**
-    change GetXImagePosition -> GetXOrigin in order not to confused reader
-      -# GetXOrigin can return default value (=0) if it was not ImagePosition
-      -# Image Position is different in dicomV3 <> ACR NEMA -> better use generic
-      name
-    */
-   float GetXOrigin();
-   float GetYOrigin();
-   float GetZOrigin();
-   
-   int GetImageNumber();
-   ModalityType GetModality();
-   
-   void GetImageOrientationPatient( float* iop );
-  
-
-};
+namespace gdcm 
+{
 
-/**
-This class should be used for a stack of 2D dicom images.
-For a multiframe dicom image better use directly gdcmHeaderHelper
+//-----------------------------------------------------------------------------
+/*
+ * \defgroup SerieHeader
+ * \brief  
+ *
+ * - This class should be used for a stack of 2D dicom images.
+ * - For a multiframe dicom image better use directly HeaderHelper
 */
-class GDCM_EXPORT gdcmSerieHeaderHelper {
-
+class GDCM_EXPORT SerieHeader 
+{
 public:
-    gdcmSerieHeaderHelper::gdcmSerieHeaderHelper() {};
-    gdcmSerieHeaderHelper::~gdcmSerieHeaderHelper();
+    SerieHeader();
+    ~SerieHeader();
 
-   void AddFileName(std::string filename); //should return bool or throw error ?
-   void AddGdcmFile(gdcmHeaderHelper *file);
-   void SetDirectory(std::string dir);
+   /// \todo should return bool or throw error ?
+   void AddFileName(std::string const & filename);
+   void AddGdcmFile(Header *file);
+   void SetDirectory(std::string const & dir);
    void OrderGdcmFileList();
    
-   gdcmHeaderHelper *GetGdcmHeader()
-   {
-      //Assume all element in the list have the same global infos
-      return CoherentGdcmFileList.front();
-   }
-   
-   std::list<gdcmHeaderHelper*>& GetGdcmFileList();
+   /// \warning Assumes all elements in the list have the same global infos.
+   ///          Assumes the list is not empty.
+   Header* GetGdcmHeader() { return CoherentGdcmFileList.front(); }
+
+   typedef std::list<Header* > GdcmHeaderList;
+
+   /// \brief Gets the *coherent* File List
+   /// @return the *coherent* File List
+   const GdcmHeaderList& GetGdcmFileList() { return CoherentGdcmFileList; }
 
 private:
    bool ImagePositionPatientOrdering();
    bool ImageNumberOrdering();
    bool FileNameOrdering();
    
-   std::list<gdcmHeaderHelper*> CoherentGdcmFileList;
-
+   GdcmHeaderList CoherentGdcmFileList;
 };
 
+} // end namespace gdcm
+
+//-----------------------------------------------------------------------------
 #endif