1 /*=========================================================================
4 Module: $RCSfile: gdcmHeader.h,v $
6 Date: $Date: 2004/10/12 04:35:46 $
7 Version: $Revision: 1.89 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
22 #include "gdcmCommon.h"
23 #include "gdcmDocument.h"
28 //-----------------------------------------------------------------------------
31 * The purpose of an instance of Header is to act as a container of
32 * all the DICOM elements and their corresponding values (and
33 * additionaly the corresponding DICOM dictionary entry) of the header
36 * The typical usage of instances of class Header is to classify a set of
37 * dicom files according to header information e.g. to create a file hierarchy
38 * reflecting the Patient/Study/Serie informations, or extracting a given
39 * SerieId. Accessing the content (image[s] or volume[s]) is beyond the
40 * functionality of this class and belongs to gdmcFile.
41 * \note The various entries of the explicit value representation (VR) shall
42 * be managed within a dictionary which is shared by all Header
44 * \note The Header::Set*Tag* family members cannot be defined as
45 * protected due to Swig limitations for as Has_a dependency between
49 //-----------------------------------------------------------------------------
50 // Dicom Part 3.3 Compliant
55 BI, // Biomagnetic Imaging
56 CF, // Cinefluorography
58 CR, // Computed Radiography
60 CT, // Computed Tomography
62 DF, // Digital Fluoroscopy
64 DM, // Digital Microscopy
65 DS, // Digital Substraction Angiography
66 DX, // Digital Radiography
67 ECG, // Echocardiography
68 EPS, // Basic Cardiac EP
70 FA, // Fluorescein Angiography
75 LS, // Laser Surface Scan
76 MA, // Magnetic Resonance Angiography
77 MR, // Magnetic Resonance
78 NM, // Nuclear Medicine
80 PT, // Positron Emission Tomography
81 RF, // Radio Fluoroscopy
82 RG, // Radiographic Imaging
83 RTDOSE, // Radiotherapy Dose
84 RTIMAGE, // Radiotherapy Image
85 RTPLAN, // Radiotherapy Plan
86 RTSTRUCT, // Radiotherapy Structure Set
87 SM, // Microscopic Imaging
88 ST, // Single-photon Emission Computed Tomography
91 VF, // Videofluorography
92 XA, // X-Ray Angiography
93 XC // Photographic Imaging
95 //-----------------------------------------------------------------------------
97 class GDCM_EXPORT Header : public Document
100 /// \brief In some cases (e.g. for some ACR-NEMA images) the Header Entry Element
101 /// Number of the 'Pixel Element' is *not* found at 0x0010. In order to
102 /// make things easier the parser shall store the proper value in
103 /// NumPixel to provide a unique access facility. See also the constructor
104 /// \ref Header::Header
106 /// \brief In some cases (e.g. for some ACR-NEMA images) the header entry for
107 /// the group of pixels is *not* found at 0x7fe0. In order to
108 /// make things easier the parser shall store the proper value in
109 /// GrPixel to provide a unique access facility. See also the constructor
110 /// \ref Header::Header
115 Header( std::string const & filename );
119 // Standard values and informations contained in the header
120 virtual bool IsReadable();
122 // Some heuristic based accessors, end user intended
124 int GetBitsAllocated();
125 int GetSamplesPerPixel();
126 int GetPlanarConfiguration();
128 int GetHighBitPosition();
129 bool IsSignedPixelData();
131 bool IsPaletteColor();
134 std::string GetPixelType();
135 size_t GetPixelOffset();
136 size_t GetPixelAreaLength();
138 //Some image informations needed for third package imaging library
146 //void GetSpacing(float &x, float &y, float &z);
148 // Useful for rescaling graylevel:
149 float GetRescaleIntercept();
150 float GetRescaleSlope();
152 int GetNumberOfScalarComponents();
153 int GetNumberOfScalarComponentsRaw();
155 int GetImageNumber();
156 ModalityType GetModality();
161 //void GetOrigin(float &x, float &y, float &z);
165 unsigned char * GetLUTRGBA();
167 std::string GetTransfertSyntaxName();
169 /// Accessor to \ref Header::GrPixel
170 uint16_t GetGrPixel() { return GrPixel; }
172 /// Accessor to \ref Header::NumPixel
173 uint16_t GetNumPixel() { return NumPixel; }
175 /// Read (used in File)
176 void SetImageDataSize(size_t expectedSize);
178 void Write(FILE* fp, FileType filetype);
181 bool AnonymizeHeader();
182 void GetImageOrientationPatient( float iop[6] );
185 friend class SerieHeader;
187 } // end namespace gdcm
189 //-----------------------------------------------------------------------------