1 /*=========================================================================
4 Module: $RCSfile: gdcmFile.h,v $
6 Date: $Date: 2005/03/22 11:37:15 $
7 Version: $Revision: 1.106 $
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 class JPEGFragmentsInfo;
29 //-----------------------------------------------------------------------------
30 // Dicom Part 3.3 Compliant
35 BI, // Biomagnetic Imaging
36 CF, // Cinefluorography
38 CR, // Computed Radiography
40 CT, // Computed Tomography
42 DF, // Digital Fluoroscopy
44 DM, // Digital Microscopy
45 DS, // Digital Substraction Angiography
46 DX, // Digital Radiography
47 ECG, // Echocardiography
48 EPS, // Basic Cardiac EP
50 FA, // Fluorescein Angiography
55 LS, // Laser Surface Scan
56 MA, // Magnetic Resonance Angiography
57 MR, // Magnetic Resonance
58 NM, // Nuclear Medicine
60 PT, // Positron Emission Tomography
61 RF, // Radio Fluoroscopy
62 RG, // Radiographic Imaging
63 RTDOSE, // Radiotherapy Dose
64 RTIMAGE, // Radiotherapy Image
65 RTPLAN, // Radiotherapy Plan
66 RTSTRUCT, // Radiotherapy Structure Set
67 SM, // Microscopic Imaging
68 ST, // Single-photon Emission Computed Tomography
71 VF, // Videofluorography
72 XA, // X-Ray Angiography
73 XC // Photographic Imaging
76 //-----------------------------------------------------------------------------
79 * \brief DICOM elements and their corresponding values (and
80 * additionaly the corresponding DICOM dictionary entry) of the header
83 * The typical usage of instances of class File is to classify a set of
84 * dicom files according to header information e.g. to create a file hierarchy
85 * reflecting the Patient/Study/Serie informations, or extracting a given
86 * SerieId. Accessing the content (image[s] or volume[s]) is beyond the
87 * functionality of this class and belongs to gdmcFile.
88 * \note The various entries of the explicit value representation (VR) shall
89 * be managed within a dictionary which is shared by all File
91 * \note The File::Set*Tag* family members cannot be defined as
92 * protected due to Swig limitations for as Has_a dependency between
93 * File and FileHelper.
95 class GDCM_EXPORT File : public Document
99 File( std::string const &filename );
102 // Standard values and informations contained in the header
105 // Some heuristic based accessors, end user intended
106 int GetImageNumber();
107 ModalityType GetModality();
121 void GetImageOrientationPatient( float iop[6] );
124 int GetBitsAllocated();
125 int GetHighBitPosition();
126 int GetSamplesPerPixel();
127 int GetPlanarConfiguration();
129 std::string GetPixelType();
130 bool IsSignedPixelData();
132 bool IsMonochrome1();
133 bool IsPaletteColor();
139 // For rescaling graylevel:
140 float GetRescaleIntercept();
141 float GetRescaleSlope();
143 int GetNumberOfScalarComponents();
144 int GetNumberOfScalarComponentsRaw();
146 /// Accessor to \ref File::GrPixel
147 uint16_t GetGrPixel() { return GrPixel; }
148 /// Accessor to \ref File::NumPixel
149 uint16_t GetNumPixel() { return NumPixel; }
151 size_t GetPixelOffset();
152 size_t GetPixelAreaLength();
154 /// returns the RLE info
155 RLEFramesInfo *GetRLEInfo() { return RLEInfo; }
156 /// Returns the JPEG Fragments info
157 JPEGFragmentsInfo *GetJPEGInfo() { return JPEGInfo; }
159 // Anonymization process
160 void AddAnonymizeElement (uint16_t group, uint16_t elem,
161 std::string const &value);
162 /// Clears the list of elements to be anonymized
163 void ClearAnonymizeList() { AnonymizeList.clear(); }
164 void AnonymizeNoLoad();
165 /// Replace patient's own information by info from the Anonymization list
166 bool AnonymizeFile();
168 bool Write(std::string fileName, FileType filetype);
172 /// Store the RLE frames info obtained during parsing of pixels.
173 RLEFramesInfo *RLEInfo;
174 /// Store the JPEG fragments info obtained during parsing of pixels.
175 JPEGFragmentsInfo *JPEGInfo;
177 /// \brief In some cases (e.g. for some ACR-NEMA images) the Entry Element
178 /// Number of the 'Pixel Element' is *not* found at 0x0010. In order to
179 /// make things easier the parser shall store the proper value in
180 /// NumPixel to provide a unique access facility.
182 /// \brief In some cases (e.g. for some ACR-NEMA images) the header entry for
183 /// the group of pixels is *not* found at 0x7fe0.
184 /// In order to make things easier the parser shall store the proper value
185 /// in GrPixel to provide a unique access facility.
189 void ComputeRLEInfo();
190 void ComputeJPEGFragmentInfo();
191 bool ReadTag(uint16_t, uint16_t);
192 uint32_t ReadTagLength(uint16_t, uint16_t);
193 void ReadAndSkipEncapsulatedBasicOffsetTable();
196 } // end namespace gdcm
198 //-----------------------------------------------------------------------------