GDCM 3.0.24
gdcmPDBHeader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMPDBHEADER_H
15#define GDCMPDBHEADER_H
16
17#include "gdcmTypes.h"
18#include "gdcmDataSet.h"
19#include "gdcmPDBElement.h"
20
21namespace gdcm
22{
23
24/*
25 * Everything done in this code is for the sole purpose of writing interoperable
26 * software under Sect. 1201 (f) Reverse Engineering exception of the DMCA.
27 * If you believe anything in this code violates any law or any of your rights,
28 * please contact us (gdcm-developers@lists.sourceforge.net) so that we can
29 * find a solution.
30 */
31//-----------------------------------------------------------------------------
32
33class DataElement;
34class PrivateTag;
54{
55 friend std::ostream& operator<<(std::ostream &_os, const PDBHeader &d);
56public :
57 PDBHeader() = default;
58 ~PDBHeader() = default;
59
62
64 void Print(std::ostream &os) const;
65
67 static const PrivateTag & GetPDBInfoTag();
68
71 const PDBElement &GetPDBElementByName(const char *name);
72
74 bool FindPDBElementByName(const char *name);
75
76protected:
77 const PDBElement& GetPDBEEnd() const;
78
79private:
80 int readprotocoldatablock(const char *input, size_t inputlen, bool verbose);
81 std::vector<PDBElement> InternalPDBDataSet;
82 static PDBElement PDBEEnd;
83 bool IsXML;
84 std::string xmltxt;
85};
86//-----------------------------------------------------------------------------
87inline std::ostream& operator<<(std::ostream &os, const PDBHeader &d)
88{
89 d.Print( os );
90 return os;
91}
92
93} // end namespace gdcm
94//-----------------------------------------------------------------------------
95#endif //GDCMPDBHEADER_H
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
Class to represent a PDB Element.
Definition gdcmPDBElement.h:30
Class for PDBHeader.
Definition gdcmPDBHeader.h:54
const PDBElement & GetPDBElementByName(const char *name)
void Print(std::ostream &os) const
Print.
static const PrivateTag & GetPDBInfoTag()
Return the Private Tag where the PDB header is stored within a DICOM DataSet.
const PDBElement & GetPDBEEnd() const
bool FindPDBElementByName(const char *name)
Return true if the PDB element matching name is found or not.
~PDBHeader()=default
bool LoadFromDataElement(DataElement const &de)
Load the PDB Header from a DataElement of a DataSet.
PDBHeader()=default
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner)
Definition gdcmPrivateTag.h:39
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88