1 /*=========================================================================
4 Module: $RCSfile: gdcmFile.h,v $
6 Date: $Date: 2005/01/23 10:12:34 $
7 Version: $Revision: 1.99 $
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"
27 //-----------------------------------------------------------------------------
28 // Dicom Part 3.3 Compliant
33 BI, // Biomagnetic Imaging
34 CF, // Cinefluorography
36 CR, // Computed Radiography
38 CT, // Computed Tomography
40 DF, // Digital Fluoroscopy
42 DM, // Digital Microscopy
43 DS, // Digital Substraction Angiography
44 DX, // Digital Radiography
45 ECG, // Echocardiography
46 EPS, // Basic Cardiac EP
48 FA, // Fluorescein Angiography
53 LS, // Laser Surface Scan
54 MA, // Magnetic Resonance Angiography
55 MR, // Magnetic Resonance
56 NM, // Nuclear Medicine
58 PT, // Positron Emission Tomography
59 RF, // Radio Fluoroscopy
60 RG, // Radiographic Imaging
61 RTDOSE, // Radiotherapy Dose
62 RTIMAGE, // Radiotherapy Image
63 RTPLAN, // Radiotherapy Plan
64 RTSTRUCT, // Radiotherapy Structure Set
65 SM, // Microscopic Imaging
66 ST, // Single-photon Emission Computed Tomography
69 VF, // Videofluorography
70 XA, // X-Ray Angiography
71 XC // Photographic Imaging
74 //-----------------------------------------------------------------------------
76 * \brief DICOM elements and their corresponding values (and
77 * additionaly the corresponding DICOM dictionary entry) of the header
80 * The typical usage of instances of class File is to classify a set of
81 * dicom files according to header information e.g. to create a file hierarchy
82 * reflecting the Patient/Study/Serie informations, or extracting a given
83 * SerieId. Accessing the content (image[s] or volume[s]) is beyond the
84 * functionality of this class and belongs to gdmcFile.
85 * \note The various entries of the explicit value representation (VR) shall
86 * be managed within a dictionary which is shared by all File
88 * \note The File::Set*Tag* family members cannot be defined as
89 * protected due to Swig limitations for as Has_a dependency between
90 * File and FileHelper.
93 //-----------------------------------------------------------------------------
95 class GDCM_EXPORT File : public Document
98 /// \brief In some cases (e.g. for some ACR-NEMA images) the 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.
103 /// \brief In some cases (e.g. for some ACR-NEMA images) the header entry for
104 /// the group of pixels is *not* found at 0x7fe0. In order to
105 /// make things easier the parser shall store the proper value in
106 /// GrPixel to provide a unique access facility.
111 File( std::string const &filename );
115 // Standard values and informations contained in the header
118 // Some heuristic based accessors, end user intended
120 int GetBitsAllocated();
121 int GetSamplesPerPixel();
122 int GetPlanarConfiguration();
124 int GetHighBitPosition();
125 bool IsSignedPixelData();
127 bool IsPaletteColor();
130 std::string GetPixelType();
131 size_t GetPixelOffset();
132 size_t GetPixelAreaLength();
134 //Some image informations needed for third package imaging library
143 // For rescaling graylevel:
144 float GetRescaleIntercept();
145 float GetRescaleSlope();
147 int GetNumberOfScalarComponents();
148 int GetNumberOfScalarComponentsRaw();
150 // To organize DICOM files based on their x,y,z position
151 void GetImageOrientationPatient( float iop[6] );
153 int GetImageNumber();
154 ModalityType GetModality();
163 /// Accessor to \ref File::GrPixel
164 uint16_t GetGrPixel() { return GrPixel; }
166 /// Accessor to \ref File::NumPixel
167 uint16_t GetNumPixel() { return NumPixel; }
169 bool Write(std::string fileName, FileType filetype);
171 /// Initialize DICOM File when none
172 void InitializeDefaultFile();
175 /// Replace patient's specific information by 'anonymous'
176 bool AnonymizeFile();
181 } // end namespace gdcm
183 //-----------------------------------------------------------------------------