]> Creatis software - gdcm.git/blobdiff - src/gdcmHeaderHelper.h
ENH: Fix a shadow variable
[gdcm.git] / src / gdcmHeaderHelper.h
index 6fb9e2d478d97d6e745a7e3b1853680b0801cb78..f2305d414c756d701242edea29135f90033beca4 100644 (file)
@@ -1,99 +1,63 @@
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.h,v 1.1 2003/09/08 16:37:47 malaterre Exp $
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: gdcmHeaderHelper.h,v $
+  Language:  C++
+  Date:      $Date: 2004/07/02 13:55:28 $
+  Version:   $Revision: 1.20 $
+                                                                                
+  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.htm 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"
-#include <list>
-#include <string>
-#include <vector>
 
-   enum ModalityType {
-      Unknow,
-      CR,
-      CT,
-      MR,
-      NM,
-      OT,
-      US,
-      XA };
-      
-/**
-  This class is meant to *interprate* 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
-   * ...
+//-----------------------------------------------------------------------------
+/*
+ * \defgroup gdcmSerieHeader
+ * \brief  
+ *
+ * - This class should be used for a stack of 2D dicom images.
+ * - For a multiframe dicom image better use directly gdcmHeaderHelper
 */
-class GDCM_EXPORT gdcmHeaderHelper : public gdcmHeader {
-
+class GDCM_EXPORT gdcmSerieHeader 
+{
 public:
+    gdcmSerieHeader();
+    ~gdcmSerieHeader();
 
-   gdcmHeaderHelper::gdcmHeaderHelper();
-   gdcmHeaderHelper::gdcmHeaderHelper(const char *filename, bool exception_on_error = false);
-
-    //Ces fonction releve de l'interpretation des donnĂ©es de gdcmHeader
-   int GetPixelSize();
-   std::string GetPixelType();
-   
-   float GetXSpacing();
-   float GetYSpacing();
-   float GetZSpacing();
-   
-   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();
+   /// \todo should return bool or throw error ?
+   void AddFileName(std::string const & filename);
+   void AddGdcmFile(gdcmHeader *file);
+   void SetDirectory(std::string const & dir);
+   void OrderGdcmFileList();
    
-   void GetImageOrientationPatient( float* iop );
-
-};
-
-/**
-This class should be used for a stack of 2D dicom images.
-For a multiframe dicom image better use directly gdcmHeaderHelper
-*/
-class GDCM_EXPORT gdcmSerieHeaderHelper {
+   /// \warning Assumes all elements in the list have the same global infos.
+   ///          Assumes the list is not empty.
+   gdcmHeader* GetGdcmHeader() { return CoherentGdcmFileList.front(); }
 
-public:
-    gdcmSerieHeaderHelper::gdcmSerieHeaderHelper() {};
-    gdcmSerieHeaderHelper::~gdcmSerieHeaderHelper();
+   typedef std::list<gdcmHeader* > GdcmHeaderList;
 
-   void AddFileName(std::string filename); //should return bool or throw error ?
-   void AddGdcmFile(gdcmHeaderHelper *file);
-   void SetDirectory(std::string dir);
-   void OrderGdcmFileList();
-   
-   gdcmHeaderHelper *GetGdcmHeader()
-   {
-      //Assume all element in the list have the same global infos
-      return CoherentGdcmFileList.front();
-   }
-   
-   std::list<gdcmHeaderHelper*>& GetGdcmFileList();
+   /// \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;
 };
 
+//-----------------------------------------------------------------------------
 #endif