GDCM: gdcmPDBHeader.h Source File

GDCM 3.2.10

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;
53 class GDCM_EXPORT PDBHeader
54{
55 friend std::ostream& operator<<(std::ostream &_os, const PDBHeader &d);
56public :
57 PDBHeader() = default;
58 ~PDBHeader() = default;
59
61 bool LoadFromDataElement(DataElement const &de);
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//-----------------------------------------------------------------------------
87 inline 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
gdcm::DataElement
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
gdcm::PDBElement
Class to represent a PDB Element.
Definition gdcmPDBElement.h:30
gdcm::PDBHeader::GetPDBElementByName
const PDBElement & GetPDBElementByName(const char *name)
gdcm::PDBHeader::Print
void Print(std::ostream &os) const
Print.
gdcm::PDBHeader::GetPDBInfoTag
static const PrivateTag & GetPDBInfoTag()
Return the Private Tag where the PDB header is stored within a DICOM DataSet.
gdcm::PDBHeader::GetPDBEEnd
const PDBElement & GetPDBEEnd() const
gdcm::PDBHeader::FindPDBElementByName
bool FindPDBElementByName(const char *name)
Return true if the PDB element matching name is found or not.
gdcm::PDBHeader::operator<<
friend std::ostream & operator<<(std::ostream &_os, const PDBHeader &d)
Definition gdcmPDBHeader.h:87
gdcm::PDBHeader::~PDBHeader
~PDBHeader()=default
gdcm::PDBHeader::LoadFromDataElement
bool LoadFromDataElement(DataElement const &de)
Load the PDB Header from a DataElement of a DataSet.
gdcm::PDBHeader::PDBHeader
PDBHeader()=default
gdcm::PrivateTag
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner).
Definition gdcmPrivateTag.h:39
gdcmDataSet.h
gdcmPDBElement.h
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88