1 /*=========================================================================
4 Module: $RCSfile: gdcmHeader.h,v $
6 Date: $Date: 2004/06/20 18:08:48 $
7 Version: $Revision: 1.74 $
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.htm 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"
24 //-----------------------------------------------------------------------------
27 * The purpose of an instance of gdcmHeader is to act as a container of
28 * all the DICOM elements and their corresponding values (and
29 * additionaly the corresponding DICOM dictionary entry) of the header
32 * The typical usage of instances of class gdcmHeader is to classify a set of
33 * dicom files according to header information e.g. to create a file hierarchy
34 * reflecting the Patient/Study/Serie informations, or extracting a given
35 * SerieId. Accessing the content (image[s] or volume[s]) is beyond the
36 * functionality of this class and belongs to gdmcFile.
37 * \note The various entries of the explicit value representation (VR) shall
38 * be managed within a dictionary which is shared by all gdcmHeader
40 * \note The gdcmHeader::Set*Tag* family members cannot be defined as
41 * protected due to Swig limitations for as Has_a dependency between
42 * gdcmFile and gdcmHeader.
44 class GDCM_EXPORT gdcmHeader : public gdcmDocument
47 /// \brief In some cases (e.g. for some ACR-NEMA images) the Header Entry Element
48 /// Number of the 'Pixel Element' is *not* found at 0x0010. In order to
49 /// make things easier the parser shall store the proper value in
50 /// NumPixel to provide a unique access facility. See also the constructor
51 /// \ref gdcmHeader::gdcmHeader
53 /// \brief In some cases (e.g. for some ACR-NEMA images) the header entry for
54 /// the group of pixels is *not* found at 0x7fe0. In order to
55 /// make things easier the parser shall store the proper value in
56 /// GrPixel to provide a unique access facility. See also the constructor
57 /// \ref gdcmHeader::gdcmHeader
61 gdcmHeader(bool exception_on_error = false);
62 gdcmHeader(const char *filename,
63 bool exception_on_error = false,
64 bool enable_sequences = false,
65 bool skip_shadow = false);
67 virtual ~gdcmHeader();
69 // Standard values and informations contained in the header
70 virtual bool IsReadable(void);
72 // Some heuristic based accessors, end user intended
73 // (to be moved to gdcmHeaderHelper?)
77 int GetBitsStored(void);
78 int GetBitsAllocated(void);
79 int GetSamplesPerPixel(void);
80 int GetPlanarConfiguration(void);
82 int GetPixelSize(void);
83 std::string GetPixelType(void);
84 size_t GetPixelOffset(void);
85 size_t GetPixelAreaLength(void);
88 int GetLUTNbits(void);
89 unsigned char * GetLUTRGBA(void);
91 std::string GetTransfertSyntaxName(void);
93 /// Accessor to \ref gdcmHeader::GrPixel
94 guint16 GetGrPixel(void) {return GrPixel;}
96 /// Accessor to \ref gdcmHeader::NumPixel
97 guint16 GetNumPixel(void) {return NumPixel;}
99 /// Read (used in gdcmFile)
100 void SetImageDataSize(size_t ExpectedSize);
103 bool anonymizeHeader(void);
108 //-----------------------------------------------------------------------------