annotate OrthancFramework/Sources/DicomFormat/DicomElement.cpp @ 4845:02d77189d8ba received-instance-callback

added ReceivedInstanceCallback + sample C++ plugin
author Alain Mazy <am@osimis.io>
date Thu, 09 Dec 2021 17:22:40 +0100
parents 7053502fbf97
children 43e613a7756b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4297
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
4437
d9473bd5ed43 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4297
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
4831
7053502fbf97 added copyright UCLouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
6 * Copyright (C) 2021-2021 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
4297
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * Lesser General Public License for more details.
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 *
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * License along with this program. If not, see
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * <http://www.gnu.org/licenses/>.
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "../PrecompiledHeaders.h"
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "DicomElement.h"
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 namespace Orthanc
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 DicomElement::DicomElement(uint16_t group,
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 uint16_t element,
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 const DicomValue &value) :
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 tag_(group, element),
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 value_(value.Clone())
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 DicomElement::DicomElement(const DicomTag &tag,
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 const DicomValue &value) :
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 tag_(tag),
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 value_(value.Clone())
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 DicomElement::~DicomElement()
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 delete value_;
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 const DicomTag &DicomElement::GetTag() const
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 return tag_;
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 const DicomValue &DicomElement::GetValue() const
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 return *value_;
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 uint16_t DicomElement::GetTagGroup() const
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 return tag_.GetGroup();
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 uint16_t DicomElement::GetTagElement() const
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 return tag_.GetElement();
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 bool DicomElement::operator<(const DicomElement &other) const
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 return GetTag() < other.GetTag();
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 }