]> Creatis software - gdcm.git/blob - src/gdcmHeaderHelper.h
Special patch to allow gdcm to read ACR-LibIDO formatted images
[gdcm.git] / src / gdcmHeaderHelper.h
1 // $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.h,v 1.2 2003/09/09 08:46:32 malaterre Exp $
2
3 #ifndef GDCMHEADERHELPER_H
4 #define GDCMHEADERHELPER_H
5
6 #include "gdcmHeader.h"
7 #include <list>
8 #include <string>
9 #include <vector>
10
11    enum ModalityType {
12       Unknow,
13       CR,
14       CT,
15       MR,
16       NM,
17       OT,
18       US,
19       XA };
20       
21 /**
22   This class is meant to *interpret* data given from gdcmHeader
23   That is to say :
24    * it will help other dev to link against there lib
25    * return value instead of string
26    * will be able to search for data at some other place
27    * return *default value* which is not a gdcmHeader goal
28    * ...
29 */
30 class GDCM_EXPORT gdcmHeaderHelper : public gdcmHeader {
31
32 public:
33
34    gdcmHeaderHelper::gdcmHeaderHelper();
35    gdcmHeaderHelper::gdcmHeaderHelper(const char *filename, bool exception_on_error = false);
36
37    int GetPixelSize();
38    std::string GetPixelType();
39    
40    float GetXSpacing();
41    float GetYSpacing();
42    float GetZSpacing();
43    
44    std::string GetStudyUID();
45    std::string GetSeriesUID();
46    std::string GetClassUID();
47    std::string GetInstanceUID();
48    
49     /**
50     change GetXImagePosition -> GetXOrigin in order not to confused reader
51       -# GetXOrigin can return default value (=0) if it was not ImagePosition
52       -# Image Position is different in dicomV3 <> ACR NEMA -> better use generic
53       name
54     */
55    float GetXOrigin();
56    float GetYOrigin();
57    float GetZOrigin();
58    
59    int GetImageNumber();
60    ModalityType GetModality();
61    
62    void GetImageOrientationPatient( float* iop );
63
64 };
65
66 /**
67 This class should be used for a stack of 2D dicom images.
68 For a multiframe dicom image better use directly gdcmHeaderHelper
69 */
70 class GDCM_EXPORT gdcmSerieHeaderHelper {
71
72 public:
73     gdcmSerieHeaderHelper::gdcmSerieHeaderHelper() {};
74     gdcmSerieHeaderHelper::~gdcmSerieHeaderHelper();
75
76    void AddFileName(std::string filename); //should return bool or throw error ?
77    void AddGdcmFile(gdcmHeaderHelper *file);
78    void SetDirectory(std::string dir);
79    void OrderGdcmFileList();
80    
81    gdcmHeaderHelper *GetGdcmHeader()
82    {
83       //Assume all element in the list have the same global infos
84       return CoherentGdcmFileList.front();
85    }
86    
87    std::list<gdcmHeaderHelper*>& GetGdcmFileList();
88
89 private:
90    bool ImagePositionPatientOrdering();
91    bool ImageNumberOrdering();
92    bool FileNameOrdering();
93    
94    std::list<gdcmHeaderHelper*> CoherentGdcmFileList;
95
96 };
97
98 #endif