MeVisLab Toolbox Reference
DCMTree_TagInfo.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef DCM_TREE_TAG_INFO_H
14 #define DCM_TREE_TAG_INFO_H
15 
16 #ifdef _MSC_VER
17  #pragma warning (push)
18  #pragma warning (disable : 4251 4350)
19 #endif
20 
21 #include <istream>
22 #include <ostream>
23 
24 #include <string>
25 
26 #include "DCMTree_Lib.h"
27 #include "DCMTree_Defines.h"
28 #include "DCMTree_TagId.h"
29 #include "DCMTree_Dict.h"
30 
31 namespace DCMTree
32 {
35  {
36  public:
39 
43  TagInfo (const TagId &tagid, const Dict& dictionary);
44 
48  TagInfo (const TagId &tagid,const Vr &vr,const TagValueMultiplicity &multiplicity);
49 
51  TagInfo (const TagInfo &other);
52 
54  ~TagInfo() override;
55 
61  TagInfo &operator=(const TagInfo &other);
62 
66  const TagId &id() const;
67 
71  const Vr &vr() const;
72 
77  bool isCodedString() const;
78 
83 
87  void setId (const TagId &tagid);
88 
92  void setVr (const Vr &vr);
93 
97  void setMultiplicity (const TagValueMultiplicity &multiplicity);
98 
104  void fromStream (std::istream &in, bool readName);
105 
111  void toStream (std::ostream &out, bool writeName) const;
112 
113  void serializeX (DCMTree_Serialization::Sink &sink) const override;
115 
116  private:
117  TagId _id;
118  Vr _vr;
119  TagValueMultiplicity _multiplicity;
120  };
121 
122  inline std::ostream &operator << (std::ostream &out,const TagInfo &t)
123  {
124  t.toStream (out, false);
125  return out;
126  }
127 
128  inline std::istream &operator >> (std::istream &in,TagInfo &t)
129  {
130  t.fromStream (in, false);
131  return in;
132  }
133 }
134 
135 #ifdef _MSC_VER
136  #pragma warning (pop)
137 #endif
138 
139 #endif
140 
141 
#define DCMTREE_EXPORT
Class to wrap a tag-id.
Definition: DCMTree_TagId.h:40
Class to carry meta-information about a specific tag.
void deserializeX(DCMTree_Serialization::Source &source) override
Overwrites data of this object with data from Source.
const TagId & id() const
get the TagId of this
TagInfo(const TagId &tagid, const Vr &vr, const TagValueMultiplicity &multiplicity)
create a new instance, initialized with the given values
bool isCodedString() const
check if the string encoding depends on the specific character set
const TagValueMultiplicity & multiplicity() const
get the multiplicity of this
const Vr & vr() const
get the vr of this
void setMultiplicity(const TagValueMultiplicity &multiplicity)
set the multiplicity of this
TagInfo(const TagId &tagid, const Dict &dictionary)
create a new instance, getting the values regarding the tag id from the dictionary
void setId(const TagId &tagid)
set the TagId of this
void toStream(std::ostream &out, bool writeName) const
copy this instance recursively into the given stream writeName = true writes tag name(s) to stream,...
TagInfo & operator=(const TagInfo &other)
assignment operator copies all values from other to this handles self-assignment well
~TagInfo() override
dtor
TagInfo(const TagInfo &other)
copy ctor
void serializeX(DCMTree_Serialization::Sink &sink) const override
Writes data of this object to Sink.
void setVr(const Vr &vr)
set the vr of this
void fromStream(std::istream &in, bool readName)
extract this instance from the given stream readName = true reads tag name(s) from stream,...
Interface which provides a method to deserialize an object.
Interface which provides a method to serialize an object.
Interface of a data sink for the serialization of objects.
Interface of a data source for the deserialization of objects.
class to dump a DCMTree dicom message into a human readable file this class could be used as a starte...
Vr
DICOM VR.
Definition: DCMTree_Lib.h:208
std::istream & operator>>(std::istream &in, Message &m)
std::pair< unsigned, unsigned > TagValueMultiplicity
the multiplicity of a tag, first=min second=max
Definition: DCMTree_Lib.h:173
std::ostream & operator<<(std::ostream &out, const Message &m)
boost::graph_traits< ml_graph_ptr >::vertex_descriptor source(graph_traits< ml_graph_ptr >::edge_descriptor e, const ml_graph_ptr)
Returns the vertex descriptor for u of the edge (u,v) represented by e.