2 //-----------------------------------------------------------------------------
6 #include "gdcmCommon.h"
7 //#include "gdcmParser.h"
8 #include "gdcmDocument.h"
9 //-----------------------------------------------------------------------------
12 * The purpose of an instance of gdcmHeader is to act as a container of
13 * all the DICOM elements and their corresponding values (and
14 * additionaly the corresponding DICOM dictionary entry) of the header
17 * The typical usage of instances of class gdcmHeader is to classify a set of
18 * dicom files according to header information e.g. to create a file hierarchy
19 * reflecting the Patient/Study/Serie informations, or extracting a given
20 * SerieId. Accessing the content (image[s] or volume[s]) is beyond the
21 * functionality of this class and belongs to gdmcFile.
22 * \note The various entries of the explicit value representation (VR) shall
23 * be managed within a dictionary which is shared by all gdcmHeader
25 * \note The gdcmHeader::Set*Tag* family members cannot be defined as
26 * protected due to Swig limitations for as Has_a dependency between
27 * gdcmFile and gdcmHeader.
29 class GDCM_EXPORT gdcmHeader : public gdcmDocument
32 /// \brief In some cases (e.g. for some ACR-NEMA images) the Header Entry Element
33 /// Number of the 'Pixel Element' is *not* found at 0x0010. In order to
34 /// make things easier the parser shall store the proper value in
35 /// NumPixel to provide a unique access facility. See also the constructor
36 /// \ref gdcmHeader::gdcmHeader
38 /// \brief In some cases (e.g. for some ACR-NEMA images) the header entry for
39 /// the group of pixels is *not* found at 0x7fe0. In order to
40 /// make things easier the parser shall store the proper value in
41 /// GrPixel to provide a unique access facility. See also the constructor
42 /// \ref gdcmHeader::gdcmHeader
46 gdcmHeader(bool exception_on_error = false);
47 gdcmHeader(const char *filename,
48 bool exception_on_error = false,
49 bool enable_sequences = false,
50 bool skip_shadow = false);
52 virtual ~gdcmHeader();
54 // Standard values and informations contained in the header
55 virtual bool IsReadable(void);
57 // Some heuristic based accessors, end user intended
58 // (to be moved to gdcmHeaderHelper?)
62 int GetBitsStored(void);
63 int GetBitsAllocated(void);
64 int GetSamplesPerPixel(void);
65 int GetPlanarConfiguration(void);
67 int GetPixelSize(void);
68 std::string GetPixelType(void);
69 size_t GetPixelOffset(void);
70 size_t GetPixelAreaLength(void);
73 int GetLUTNbits(void);
74 unsigned char * GetLUTRGBA(void);
76 std::string GetTransfertSyntaxName(void);
78 /// Accessor to \ref gdcmHeader::GrPixel
79 guint16 GetGrPixel(void) {return GrPixel;}
81 /// Accessor to \ref gdcmHeader::NumPixel
82 guint16 GetNumPixel(void) {return NumPixel;}
84 /// Read (used in gdcmFile)
85 void SetImageDataSize(size_t ExpectedSize);
88 bool anonymizeHeader(void);
93 //-----------------------------------------------------------------------------