Mercurial > hg > orthanc
annotate Core/DicomParsing/ITagVisitor.h @ 3966:fde1355a625a
c-get compatibility with ginkgocadx
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 22 May 2020 09:02:04 +0200 |
parents | 4922bdd046dd |
children |
rev | line source |
---|---|
2499
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
3640
94f4a18a79cc
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3198
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
2499
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU General Public License as |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * published by the Free Software Foundation, either version 3 of the |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * License, or (at your option) any later version. |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * In addition, as a special exception, the copyright holders of this |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * program give permission to link the code of its release with the |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * that use the same license as the "OpenSSL" library), and distribute |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * the linked executables. You must obey the GNU General Public License |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * in all respects for all of the code used other than "OpenSSL". If you |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * modify file(s) with this exception, you may extend this exception to |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * your version of the file(s), but you are not obligated to do so. If |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * you do not wish to do so, delete this exception statement from your |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 * version. If you delete this exception statement from all source files |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 * in the program, then also delete it here. |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 * |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 * This program is distributed in the hope that it will be useful, but |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 * WITHOUT ANY WARRANTY; without even the implied warranty of |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 * General Public License for more details. |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 * |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 * You should have received a copy of the GNU General Public License |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 **/ |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 #pragma once |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 #include "../DicomFormat/DicomTag.h" |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 #include <vector> |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 #include <boost/noncopyable.hpp> |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 namespace Orthanc |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 { |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 class ITagVisitor : public boost::noncopyable |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 { |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 public: |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 enum Action |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 { |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 Action_Replace, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 Action_None |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 }; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 virtual ~ITagVisitor() |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 { |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 } |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 |
3195 | 56 // Visiting a DICOM element that is internal to DCMTK |
57 virtual void VisitNotSupported(const std::vector<DicomTag>& parentTags, | |
58 const std::vector<size_t>& parentIndexes, | |
59 const DicomTag& tag, | |
60 ValueRepresentation vr) = 0; | |
61 | |
62 // SQ | |
63 virtual void VisitEmptySequence(const std::vector<DicomTag>& parentTags, | |
64 const std::vector<size_t>& parentIndexes, | |
65 const DicomTag& tag) = 0; | |
66 | |
67 // SL, SS, UL, US | |
68 virtual void VisitIntegers(const std::vector<DicomTag>& parentTags, | |
69 const std::vector<size_t>& parentIndexes, | |
70 const DicomTag& tag, | |
71 ValueRepresentation vr, | |
72 const std::vector<int64_t>& values) = 0; | |
73 | |
3691
4922bdd046dd
Fix issue #140 (Modifying private tags with REST API changes VR from LO to UN) - DANGEROUS COMMIT
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
74 // FL, FD, OD, OF |
3195 | 75 virtual void VisitDoubles(const std::vector<DicomTag>& parentTags, |
2499
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 const std::vector<size_t>& parentIndexes, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 const DicomTag& tag, |
3195 | 78 ValueRepresentation vr, |
79 const std::vector<double>& values) = 0; | |
2499
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 |
3195 | 81 // AT |
82 virtual void VisitAttributes(const std::vector<DicomTag>& parentTags, | |
83 const std::vector<size_t>& parentIndexes, | |
84 const DicomTag& tag, | |
85 const std::vector<DicomTag>& values) = 0; | |
86 | |
3691
4922bdd046dd
Fix issue #140 (Modifying private tags with REST API changes VR from LO to UN) - DANGEROUS COMMIT
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
87 // OB, OL, OW, UN |
2499
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 virtual void VisitBinary(const std::vector<DicomTag>& parentTags, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 const std::vector<size_t>& parentIndexes, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 const DicomTag& tag, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 ValueRepresentation vr, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 const void* data, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 size_t size) = 0; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 |
3195 | 95 // Visiting an UTF-8 string |
2499
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 virtual Action VisitString(std::string& newValue, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 const std::vector<DicomTag>& parentTags, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 const std::vector<size_t>& parentIndexes, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 const DicomTag& tag, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 ValueRepresentation vr, |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 const std::string& value) = 0; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 }; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 } |