1 /*=========================================================================
4 Module: $RCSfile: gdcmHeader.h,v $
6 Date: $Date: 2005/01/11 11:37:14 $
7 Version: $Revision: 1.98 $
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 "gdcmDocument.h"
26 //-----------------------------------------------------------------------------
29 * The purpose of an instance of Header is to act as a container of
30 * all the DICOM elements and their corresponding values (and
31 * additionaly the corresponding DICOM dictionary entry) of the header
34 * The typical usage of instances of class Header is to classify a set of
35 * dicom files according to header information e.g. to create a file hierarchy
36 * reflecting the Patient/Study/Serie informations, or extracting a given
37 * SerieId. Accessing the content (image[s] or volume[s]) is beyond the
38 * functionality of this class and belongs to gdmcFile.
39 * \note The various entries of the explicit value representation (VR) shall
40 * be managed within a dictionary which is shared by all Header
42 * \note The Header::Set*Tag* family members cannot be defined as
43 * protected due to Swig limitations for as Has_a dependency between
47 //-----------------------------------------------------------------------------
48 // Dicom Part 3.3 Compliant
53 BI, // Biomagnetic Imaging
54 CF, // Cinefluorography
56 CR, // Computed Radiography
58 CT, // Computed Tomography
60 DF, // Digital Fluoroscopy
62 DM, // Digital Microscopy
63 DS, // Digital Substraction Angiography
64 DX, // Digital Radiography
65 ECG, // Echocardiography
66 EPS, // Basic Cardiac EP
68 FA, // Fluorescein Angiography
73 LS, // Laser Surface Scan
74 MA, // Magnetic Resonance Angiography
75 MR, // Magnetic Resonance
76 NM, // Nuclear Medicine
78 PT, // Positron Emission Tomography
79 RF, // Radio Fluoroscopy
80 RG, // Radiographic Imaging
81 RTDOSE, // Radiotherapy Dose
82 RTIMAGE, // Radiotherapy Image
83 RTPLAN, // Radiotherapy Plan
84 RTSTRUCT, // Radiotherapy Structure Set
85 SM, // Microscopic Imaging
86 ST, // Single-photon Emission Computed Tomography
89 VF, // Videofluorography
90 XA, // X-Ray Angiography
91 XC // Photographic Imaging
93 //-----------------------------------------------------------------------------
95 class GDCM_EXPORT Header : public Document
98 /// \brief In some cases (e.g. for some ACR-NEMA images) the Header Entry Element
99 /// Number of the 'Pixel Element' is *not* found at 0x0010. In order to
100 /// make things easier the parser shall store the proper value in
101 /// NumPixel to provide a unique access facility. See also the constructor
102 /// \ref Header::Header
104 /// \brief In some cases (e.g. for some ACR-NEMA images) the header entry for
105 /// the group of pixels is *not* found at 0x7fe0. In order to
106 /// make things easier the parser shall store the proper value in
107 /// GrPixel to provide a unique access facility. See also the constructor
108 /// \ref Header::Header
113 Header( std::string const &filename );
117 // Standard values and informations contained in the header
120 // Some heuristic based accessors, end user intended
122 int GetBitsAllocated();
123 int GetSamplesPerPixel();
124 int GetPlanarConfiguration();
126 int GetHighBitPosition();
127 bool IsSignedPixelData();
129 bool IsPaletteColor();
132 std::string GetPixelType();
133 size_t GetPixelOffset();
134 size_t GetPixelAreaLength();
136 //Some image informations needed for third package imaging library
145 // Useful for rescaling graylevel:
146 float GetRescaleIntercept();
147 float GetRescaleSlope();
149 int GetNumberOfScalarComponents();
150 int GetNumberOfScalarComponentsRaw();
152 int GetImageNumber();
153 ModalityType GetModality();
162 /// Return the Transfer Syntax as a string
163 std::string GetTransferSyntaxName();
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 bool Write(std::string fileName, FileType filetype);
173 /// Initialize DICOM header when none
174 void InitializeDefaultHeader();
177 /// Replace patient's specific information by 'anonymous'
178 bool AnonymizeHeader();
180 /// Helper function needed to organize DICOM files based on
181 /// their x,y,z position
182 void GetImageOrientationPatient( float iop[6] );
185 friend class SerieHeader;
187 } // end namespace gdcm
189 //-----------------------------------------------------------------------------