Mercurial > hg > orthanc
comparison OrthancFramework/Sources/DicomFormat/DicomTag.cpp @ 4297:785a2713323e
abi continued
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 05 Nov 2020 17:20:49 +0100 |
parents | 8e069a7e1c11 |
children | 91554aecff9a |
comparison
equal
deleted
inserted
replaced
4296:3b70a2e6a06c | 4297:785a2713323e |
---|---|
52 (GetCharValue(c[2]) << 4) + | 52 (GetCharValue(c[2]) << 4) + |
53 GetCharValue(c[3])); | 53 GetCharValue(c[3])); |
54 } | 54 } |
55 | 55 |
56 | 56 |
57 DicomTag::DicomTag(uint16_t group, uint16_t element) : | |
58 group_(group), | |
59 element_(element) | |
60 { | |
61 } | |
62 | |
63 uint16_t DicomTag::GetGroup() const | |
64 { | |
65 return group_; | |
66 } | |
67 | |
68 uint16_t DicomTag::GetElement() const | |
69 { | |
70 return element_; | |
71 } | |
72 | |
73 bool DicomTag::IsPrivate() const | |
74 { | |
75 return group_ % 2 == 1; | |
76 } | |
77 | |
78 | |
57 bool DicomTag::operator< (const DicomTag& other) const | 79 bool DicomTag::operator< (const DicomTag& other) const |
58 { | 80 { |
59 if (group_ < other.group_) | 81 if (group_ < other.group_) |
60 return true; | 82 return true; |
61 | 83 |
73 | 95 |
74 if (group_ > other.group_) | 96 if (group_ > other.group_) |
75 return false; | 97 return false; |
76 | 98 |
77 return element_ <= other.element_; | 99 return element_ <= other.element_; |
100 } | |
101 | |
102 bool DicomTag::operator>(const DicomTag &other) const | |
103 { | |
104 return !(*this <= other); | |
105 } | |
106 | |
107 bool DicomTag::operator>=(const DicomTag &other) const | |
108 { | |
109 return !(*this < other); | |
110 } | |
111 | |
112 bool DicomTag::operator==(const DicomTag &other) const | |
113 { | |
114 return group_ == other.group_ && element_ == other.element_; | |
115 } | |
116 | |
117 bool DicomTag::operator!=(const DicomTag &other) const | |
118 { | |
119 return !(*this == other); | |
78 } | 120 } |
79 | 121 |
80 | 122 |
81 std::ostream& operator<< (std::ostream& o, const DicomTag& tag) | 123 std::ostream& operator<< (std::ostream& o, const DicomTag& tag) |
82 { | 124 { |