GDCM 3.2.1

gdcmXMLPrinter.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 GDCMXMLPRINTER_H
15#define GDCMXMLPRINTER_H
16
17/*
18
19 The Normative version of the XML Schema for the Native DICOM Model follows:
20
21
22
23 start = element NativeDicomModel { DicomDataSet }
24
25# A DICOM Data Set is as defined in PS3.5. It does not appear
26# as an XML Element, since it does not appear in the binary encoded
27# DICOM objects. It exists here merely as a documentation aid.
28
29 DicomDataSet = DicomAttribute*
30 DicomAttribute = element DicomAttribute {
31 Tag, VR, Keyword?, PrivateCreator?,
32( BulkData | Value+ | Item+ | PersonName+ )?
33}
34
35 BulkData = element BulkData{ UUID }
36 Value = element Value { Number, xsd:string }
37 Item = element Item { Number, DicomDataSet }
38 PersonName = element PersonName {
39 Number,
40 element SingleByte { NameComponents }?,
41 element Ideographic { NameComponents }?,
42 element Phonetic
43{ NameComponents }?
44}
45
46 NameComponents =
47 element FamilyName {xsd:string}?,
48 element GivenName {xsd:string}?,
49 element MiddleName {xsd:string}?,
50 element NamePrefix {xsd:string}?,
51 element NameSuffix {xsd:string}?
52
53# keyword is the attribute tag from PS3.6
54# (derived from the DICOM Attribute's name)
55 Keyword = attribute keyword { xsd:token }
56# canonical XML definition of Hex, with lowercase letters disallowed
57 Tag = attribute tag { xsd:string{ minLength="8" maxLength="8" pattern="[0-9A-F]{8}" } }
58 VR = attribute vr { "AE" | "AS" | "AT"| "CS" | "DA" | "DS" | "DT" | "FL" | "FD"
59| "IS" | "LO" | "LT" | "OB" | "OF" | "OW" | "PN" | "SH" | "SL"
60| "SQ" | "SS" | "ST" | "TM" | "UI" | "UL" | "UN" | "US" | "UT" }
61 PrivateCreator = attribute privateCreator{ xsd:string }
62 UUID = attribute uuid { xsd:string }
63 Number = attribute number { xsd:positiveInteger }
64
65
66*/
67
68#include "gdcmFile.h"
69#include "gdcmDataElement.h"
70
71 namespace gdcm
72{
73
74 class DataSet;
75 class DictEntry;
76 class Dicts;
77
78 class GDCM_EXPORT XMLPrinter
79{
80 public:
81 XMLPrinter();
82 virtual ~XMLPrinter();
83
84 // Set file
85 void SetFile(File const &f) { F = &f; }
86
87
88
89 typedef enum {
90
91 OnlyUUID = 0 ,
92 LOADBULKDATA = 1
93
94 } PrintStyles;
95
96 // Set PrintStyle value
97 void SetStyle(PrintStyles ps)
98 {
99 PrintStyle = ps;
100 }
101
102 // Get PrintStyle value
103 PrintStyles GetPrintStyle() const
104 {
105 return PrintStyle;
106 }
107
108 // Print
109 void Print(std::ostream& os);
110
111 // Print an individual dataset
112 void PrintDataSet(const DataSet &ds, const TransferSyntax & ts, std::ostream& os);
113
114 //void PrintUID(std::ostream &os);
115
119 virtual void HandleBulkData(const char *uuid, const TransferSyntax &ts,
120 const char *bulkdata, size_t bulklen);
121
122 protected:
123
124 VR PrintDataElement(std::ostream &os, const Dicts &dicts, const DataSet & ds, const DataElement &de, const TransferSyntax & ts);
125
126 void PrintSQ(const SequenceOfItems *sqi, const TransferSyntax & ts, std::ostream &os);
127
128 PrintStyles PrintStyle;
129
130 const File *F;
131
132};
133
134} // end namespace gdcm
135
136#endif //GDCMXMLPRINTER_H
gdcm::DataElement
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
gdcm::DataSet
Class to represent a Data Set (which contains Data Elements)
Definition gdcmDataSet.h:56
gdcm::DictEntry
Class to represent an Entry in the Dict.
Definition gdcmDictEntry.h:37
gdcm::Dicts
Class to manipulate the sum of knowledge (all the dict user load)
Definition gdcmDicts.h:29
gdcm::File
a DICOM File
Definition gdcmFile.h:34
gdcm::SequenceOfItems
Class to represent a Sequence Of Items.
Definition gdcmSequenceOfItems.h:40
gdcm::TransferSyntax
Class to manipulate Transfer Syntax.
Definition gdcmTransferSyntax.h:40
gdcm::VR
VR class.
Definition gdcmVR.h:55
gdcm::XMLPrinter::SetStyle
void SetStyle(PrintStyles ps)
Definition gdcmXMLPrinter.h:97
gdcm::XMLPrinter::PrintSQ
void PrintSQ(const SequenceOfItems *sqi, const TransferSyntax &ts, std::ostream &os)
gdcm::XMLPrinter::Print
void Print(std::ostream &os)
gdcm::XMLPrinter::HandleBulkData
virtual void HandleBulkData(const char *uuid, const TransferSyntax &ts, const char *bulkdata, size_t bulklen)
gdcm::XMLPrinter::GetPrintStyle
PrintStyles GetPrintStyle() const
Definition gdcmXMLPrinter.h:103
gdcm::XMLPrinter::SetFile
void SetFile(File const &f)
Definition gdcmXMLPrinter.h:85
gdcm::XMLPrinter::PrintStyle
PrintStyles PrintStyle
Definition gdcmXMLPrinter.h:128
gdcm::XMLPrinter::XMLPrinter
XMLPrinter()
gdcm::XMLPrinter::PrintDataSet
void PrintDataSet(const DataSet &ds, const TransferSyntax &ts, std::ostream &os)
gdcm::XMLPrinter::F
const File * F
Definition gdcmXMLPrinter.h:130
gdcm::XMLPrinter::PrintStyles
PrintStyles
Definition gdcmXMLPrinter.h:89
gdcm::XMLPrinter::LOADBULKDATA
@ LOADBULKDATA
Definition gdcmXMLPrinter.h:92
gdcm::XMLPrinter::OnlyUUID
@ OnlyUUID
Definition gdcmXMLPrinter.h:91
gdcm::XMLPrinter::~XMLPrinter
virtual ~XMLPrinter()
gdcm::XMLPrinter::PrintDataElement
VR PrintDataElement(std::ostream &os, const Dicts &dicts, const DataSet &ds, const DataElement &de, const TransferSyntax &ts)
gdcmDataElement.h
gdcmFile.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21