GDCM  2.4.5
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 
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
98  {
99  PrintStyle = ps;
100  }
101 
102  // Get PrintStyle value
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 
129 
130  const File *F;
131 
132 };
133 
134 } // end namespace gdcm
135 
136 #endif //GDCMXMLPRINTER_H
Class to represent a Data Set (which contains Data Elements) A Data Set represents an instance of a r...
Definition: gdcmDataSet.h:55
Class to represent a Sequence Of Items (value representation : SQ)
Definition: gdcmSequenceOfItems.h:39
const File * F
Definition: gdcmXMLPrinter.h:130
PrintStyles PrintStyle
Definition: gdcmXMLPrinter.h:128
void SetStyle(PrintStyles ps)
Definition: gdcmXMLPrinter.h:97
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
PrintStyles
Definition: gdcmXMLPrinter.h:89
Class to represent a Data Element either Implicit or Explicit.
Definition: gdcmDataElement.h:58
void SetFile(File const &f)
Definition: gdcmXMLPrinter.h:85
PrintStyles GetPrintStyle() const
Definition: gdcmXMLPrinter.h:103
Class to manipulate Transfer Syntax.
Definition: gdcmTransferSyntax.h:39
Definition: gdcmXMLPrinter.h:78
a DICOM File See PS 3.10 File: A File is an ordered string of zero or more bytes, where the first byt...
Definition: gdcmFile.h:33
Class to manipulate the sum of knowledge (all the dict user load)
Definition: gdcmDicts.h:28
VR class This is adapted from DICOM standard The biggest difference is the INVALID VR and the composi...
Definition: gdcmVR.h:54
Definition: gdcmASN1.h:20

Generated on Fri Sep 25 2015 17:58:25 for GDCM by doxygen 1.8.9.1
SourceForge.net Logo