1 /*=========================================================================
4 Module: $RCSfile: gdcmHeader.h,v $
6 Date: $Date: 2004/10/28 03:10:58 $
7 Version: $Revision: 1.92 $
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"
27 //-----------------------------------------------------------------------------
30 * The purpose of an instance of Header is to act as a container of
31 * all the DICOM elements and their corresponding values (and
32 * additionaly the corresponding DICOM dictionary entry) of the header
35 * The typical usage of instances of class Header is to classify a set of
36 * dicom files according to header information e.g. to create a file hierarchy
37 * reflecting the Patient/Study/Serie informations, or extracting a given
38 * SerieId. Accessing the content (image[s] or volume[s]) is beyond the
39 * functionality of this class and belongs to gdmcFile.
40 * \note The various entries of the explicit value representation (VR) shall
41 * be managed within a dictionary which is shared by all Header
43 * \note The Header::Set*Tag* family members cannot be defined as
44 * protected due to Swig limitations for as Has_a dependency between
48 //-----------------------------------------------------------------------------
49 // Dicom Part 3.3 Compliant
54 BI, // Biomagnetic Imaging
55 CF, // Cinefluorography
57 CR, // Computed Radiography
59 CT, // Computed Tomography
61 DF, // Digital Fluoroscopy
63 DM, // Digital Microscopy
64 DS, // Digital Substraction Angiography
65 DX, // Digital Radiography
66 ECG, // Echocardiography
67 EPS, // Basic Cardiac EP
69 FA, // Fluorescein Angiography
74 LS, // Laser Surface Scan
75 MA, // Magnetic Resonance Angiography
76 MR, // Magnetic Resonance
77 NM, // Nuclear Medicine
79 PT, // Positron Emission Tomography
80 RF, // Radio Fluoroscopy
81 RG, // Radiographic Imaging
82 RTDOSE, // Radiotherapy Dose
83 RTIMAGE, // Radiotherapy Image
84 RTPLAN, // Radiotherapy Plan
85 RTSTRUCT, // Radiotherapy Structure Set
86 SM, // Microscopic Imaging
87 ST, // Single-photon Emission Computed Tomography
90 VF, // Videofluorography
91 XA, // X-Ray Angiography
92 XC // Photographic Imaging
94 //-----------------------------------------------------------------------------
96 class GDCM_EXPORT Header : public Document
99 /// \brief In some cases (e.g. for some ACR-NEMA images) the Header Entry Element
100 /// Number of the 'Pixel Element' is *not* found at 0x0010. In order to
101 /// make things easier the parser shall store the proper value in
102 /// NumPixel to provide a unique access facility. See also the constructor
103 /// \ref Header::Header
105 /// \brief In some cases (e.g. for some ACR-NEMA images) the header entry for
106 /// the group of pixels is *not* found at 0x7fe0. In order to
107 /// make things easier the parser shall store the proper value in
108 /// GrPixel to provide a unique access facility. See also the constructor
109 /// \ref Header::Header
114 Header( std::string const & filename );
118 // Standard values and informations contained in the header
121 // Some heuristic based accessors, end user intended
123 int GetBitsAllocated();
124 int GetSamplesPerPixel();
125 int GetPlanarConfiguration();
127 int GetHighBitPosition();
128 bool IsSignedPixelData();
130 bool IsPaletteColor();
133 std::string GetPixelType();
134 size_t GetPixelOffset();
135 size_t GetPixelAreaLength();
137 //Some image informations needed for third package imaging library
146 // Useful for rescaling graylevel:
147 float GetRescaleIntercept();
148 float GetRescaleSlope();
150 int GetNumberOfScalarComponents();
151 int GetNumberOfScalarComponentsRaw();
153 int GetImageNumber();
154 ModalityType GetModality();
163 std::string GetTransfertSyntaxName();
165 /// Accessor to \ref Header::GrPixel
166 uint16_t GetGrPixel() { return GrPixel; }
168 /// Accessor to \ref Header::NumPixel
169 uint16_t GetNumPixel() { return NumPixel; }
171 /// Read (used in File)
172 void SetImageDataSize(size_t expectedSize);
174 void Write(std::ofstream* fp, FileType filetype);
177 bool AnonymizeHeader();
178 void GetImageOrientationPatient( float iop[6] );
181 friend class SerieHeader;
183 } // end namespace gdcm
185 //-----------------------------------------------------------------------------