2 //-----------------------------------------------------------------------------
3 #ifndef GDCMHEADERHELPER_H
4 #define GDCMHEADERHELPER_H
6 #include "gdcmHeader.h"
8 //-----------------------------------------------------------------------------
9 // Dicom Part 3.3 Compliant
14 BI, // Biomagnetic Imaging
15 CF, // Cinefluorography
17 CR, // Computed Radiography
19 CT, // Computed Tomography
21 DF, // Digital Fluoroscopy
23 DM, // Digital Microscopy
24 DS, // Digital Substraction Angiography
25 DX, // Digital Radiography
26 ECG, // Echocardiography
27 EPS, // Basic Cardiac EP
29 FA, // Fluorescein Angiography
34 LS, // Laser Surface Scan
35 MA, // Magnetic Resonance Angiography
36 MR, // Magnetic Resonance
37 NM, // Nuclear Medicine
39 PT, // Positron Emission Tomography
40 RF, // Radio Fluoroscopy
41 RG, // Radiographic Imaging
42 RTDOSE, // Radiotherapy Dose
43 RTIMAGE, // Radiotherapy Image
44 RTPLAN, // Radiotherapy Plan
45 RTSTRUCT, // Radiotherapy Structure Set
46 SM, // Microscopic Imaging
47 ST, // Single-photon Emission Computed Tomography
50 VF, // Videofluorography
51 XA, // X-Ray Angiography
52 XC // Photographic Imaging
55 //-----------------------------------------------------------------------------
57 * This class is meant to *interpret* data given from gdcmHeader
59 * - it will help other dev to link against there lib
60 * - return value instead of string
61 * - will be able to search for data at some other place
62 * - return *default value* which is not a gdcmHeader goal
65 class GDCM_EXPORT gdcmHeaderHelper : public gdcmHeader {
68 gdcmHeaderHelper(const char *filename,
69 bool exception_on_error = false,
70 bool enable_sequences = false,
71 bool ignore_shadow = false);
74 std::string GetPixelType();
80 // Usefull for rescaling graylevel:
81 float GetRescaleIntercept();
82 float GetRescaleSlope();
84 int GetNumberOfScalarComponents();
85 int GetNumberOfScalarComponentsRaw();
87 std::string GetStudyUID();
88 std::string GetSeriesUID();
89 std::string GetClassUID();
90 std::string GetInstanceUID();
93 * change GetXImagePosition -> GetXOrigin in order not to confuse reader
94 * -# GetXOrigin can return default value (=0) if it was not ImagePosition
95 * -# Image Position is different in dicomV3 <> ACR NEMA -> better use generic
102 int GetImageNumber();
103 ModalityType GetModality();
105 void GetImageOrientationPatient( float* iop );
108 //-----------------------------------------------------------------------------
110 This class should be used for a stack of 2D dicom images.
111 For a multiframe dicom image better use directly gdcmHeaderHelper
113 class GDCM_EXPORT gdcmSerieHeaderHelper {
115 gdcmSerieHeaderHelper() {};
116 ~gdcmSerieHeaderHelper();
118 void AddFileName(std::string filename); //should return bool or throw error ?
119 void AddGdcmFile(gdcmHeaderHelper *file);
120 void SetDirectory(std::string dir);
121 void OrderGdcmFileList();
123 inline gdcmHeaderHelper *GetGdcmHeader()
125 //Assume all element in the list have the same global infos
126 return CoherentGdcmFileList.front();
129 std::list<gdcmHeaderHelper*>& GetGdcmFileList();
132 bool ImagePositionPatientOrdering();
133 bool ImageNumberOrdering();
134 bool FileNameOrdering();
136 std::list<gdcmHeaderHelper*> CoherentGdcmFileList;
139 //-----------------------------------------------------------------------------