annotate OrthancServer/DicomInstanceToStore.cpp @ 3027:fd587cf51a89 db-changes

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 18 Dec 2018 12:50:27 +0100
parents bbfd95a0c429
children 4e43e67f8ecf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1854
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1005
diff changeset
4 * Department, University Hospital of Liege, Belgium
2447
878b59270859 upgrade to year 2018
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2409
diff changeset
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * In addition, as a special exception, the copyright holders of this
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * program give permission to link the code of its release with the
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * the linked executables. You must obey the GNU General Public License
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * in all respects for all of the code used other than "OpenSSL". If you
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * modify file(s) with this exception, you may extend this exception to
1d35281d967c DicomInstanceToStore
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
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * you do not wish to do so, delete this exception statement from your
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * version. If you delete this exception statement from all source files
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * in the program, then also delete it here.
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 *
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * This program is distributed in the hope that it will be useful, but
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * General Public License for more details.
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 *
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * You should have received a copy of the GNU General Public License
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 **/
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
1624
0a2ad4a6858f fix missing precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1573
diff changeset
34 #include "PrecompiledHeadersServer.h"
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "DicomInstanceToStore.h"
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
37 #include "../Core/DicomParsing/FromDcmtkBridge.h"
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
38 #include "../Core/DicomParsing/ParsedDicomFile.h"
1486
f967bdf8534e refactoring to Logging.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
39 #include "../Core/Logging.h"
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
40 #include "../Core/OrthancException.h"
1004
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
41
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
42 #include <dcmtk/dcmdata/dcfilefo.h>
2189
c4b3259c8bce New metadata automatically computed at the instance level: "TransferSyntax"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2131
diff changeset
43 #include <dcmtk/dcmdata/dcdeftag.h>
1004
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
44
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
45
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 namespace Orthanc
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
48 // Anonymous namespace to avoid clashes between compilation modules
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
49 namespace
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
50 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
51 template <typename T>
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
52 class SmartContainer
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
53 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
54 private:
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
55 T* content_;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
56 bool toDelete_;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
57 bool isReadOnly_;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
58
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
59 void Deallocate()
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
60 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
61 if (content_ && toDelete_)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
62 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
63 delete content_;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
64 toDelete_ = false;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
65 content_ = NULL;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
66 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
67 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
68
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
69 public:
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
70 SmartContainer() : content_(NULL), toDelete_(false), isReadOnly_(true)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
71 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
72 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
73
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
74 ~SmartContainer()
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
75 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
76 Deallocate();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
77 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
78
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
79 void Allocate()
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
80 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
81 Deallocate();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
82 content_ = new T;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
83 toDelete_ = true;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
84 isReadOnly_ = false;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
85 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
86
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
87 void TakeOwnership(T* content)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
88 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
89 if (content == NULL)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
90 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
91 throw OrthancException(ErrorCode_ParameterOutOfRange);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
92 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
93
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
94 Deallocate();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
95 content_ = content;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
96 toDelete_ = true;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
97 isReadOnly_ = false;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
98 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
99
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
100 void SetReference(T& content) // Read and write assign, without transfering ownership
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
101 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
102 Deallocate();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
103 content_ = &content;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
104 toDelete_ = false;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
105 isReadOnly_ = false;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
106 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
107
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
108 void SetConstReference(const T& content) // Read-only assign, without transfering ownership
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
109 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
110 Deallocate();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
111 content_ = &const_cast<T&>(content);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
112 toDelete_ = false;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
113 isReadOnly_ = true;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
114 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
115
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
116 bool HasContent() const
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
117 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
118 return content_ != NULL;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
119 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
120
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
121 T& GetContent()
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
122 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
123 if (content_ == NULL)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
124 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
125 throw OrthancException(ErrorCode_BadSequenceOfCalls);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
126 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
127
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
128 if (isReadOnly_)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
129 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
130 throw OrthancException(ErrorCode_ReadOnly);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
131 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
132
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
133 return *content_;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
134 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
135
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
136 const T& GetConstContent() const
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
137 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
138 if (content_ == NULL)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
139 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
140 throw OrthancException(ErrorCode_BadSequenceOfCalls);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
141 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
142
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
143 return *content_;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
144 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
145 };
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
146 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
147
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
148
2898
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
149 class DicomInstanceToStore::PImpl
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
150 {
2898
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
151 public:
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
152 DicomInstanceOrigin origin_;
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
153 SmartContainer<std::string> buffer_;
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
154 SmartContainer<ParsedDicomFile> parsed_;
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
155 SmartContainer<DicomMap> summary_;
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
156 SmartContainer<Json::Value> json_;
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
157 MetadataMap metadata_;
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
158
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
159 private:
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
160 std::auto_ptr<DicomInstanceHasher> hasher_;
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
161
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
162 void ComputeMissingInformation()
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
163 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
164 if (buffer_.HasContent() &&
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
165 summary_.HasContent() &&
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
166 json_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
167 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
168 // Fine, everything is available
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
169 return;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
170 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
171
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
172 if (!buffer_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
173 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
174 if (!parsed_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
175 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
176 if (!summary_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
177 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
178 throw OrthancException(ErrorCode_NotImplemented);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
179 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
180 else
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
181 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
182 parsed_.TakeOwnership(new ParsedDicomFile(summary_.GetConstContent()));
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
183 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
184 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
185
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
186 // Serialize the parsed DICOM file
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
187 buffer_.Allocate();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
188 if (!FromDcmtkBridge::SaveToMemoryBuffer(buffer_.GetContent(),
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
189 *parsed_.GetContent().GetDcmtkObject().getDataset()))
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
190 {
2955
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2898
diff changeset
191 throw OrthancException(ErrorCode_InternalError,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2898
diff changeset
192 "Unable to serialize a DICOM file to a memory buffer");
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
193 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
194 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
195
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
196 if (summary_.HasContent() &&
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
197 json_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
198 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
199 return;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
200 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
201
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
202 // At this point, we know that the DICOM file is available as a
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
203 // memory buffer, but that its summary or its JSON version is
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
204 // missing
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
205
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
206 if (!parsed_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
207 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
208 parsed_.TakeOwnership(new ParsedDicomFile(buffer_.GetConstContent()));
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
209 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
210
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
211 // At this point, we have parsed the DICOM file
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
212
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
213 if (!summary_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
214 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
215 summary_.Allocate();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
216 FromDcmtkBridge::ExtractDicomSummary(summary_.GetContent(),
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
217 *parsed_.GetContent().GetDcmtkObject().getDataset());
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
218 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
219
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
220 if (!json_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
221 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
222 json_.Allocate();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
223
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
224 std::set<DicomTag> ignoreTagLength;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
225 FromDcmtkBridge::ExtractDicomAsJson(json_.GetContent(),
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
226 *parsed_.GetContent().GetDcmtkObject().getDataset(),
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
227 ignoreTagLength);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
228 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
229 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
230
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
231
2898
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
232 public:
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
233 const char* GetBufferData()
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
234 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
235 ComputeMissingInformation();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
236
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
237 if (!buffer_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
238 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
239 throw OrthancException(ErrorCode_InternalError);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
240 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
241
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
242 if (buffer_.GetConstContent().size() == 0)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
243 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
244 return NULL;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
245 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
246 else
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
247 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
248 return buffer_.GetConstContent().c_str();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
249 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
250 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
251
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
252
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
253 size_t GetBufferSize()
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
254 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
255 ComputeMissingInformation();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
256
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
257 if (!buffer_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
258 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
259 throw OrthancException(ErrorCode_InternalError);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
260 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
261
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
262 return buffer_.GetConstContent().size();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
263 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
264
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
265
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
266 const DicomMap& GetSummary()
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
267 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
268 ComputeMissingInformation();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
269
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
270 if (!summary_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
271 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
272 throw OrthancException(ErrorCode_InternalError);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
273 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
274
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
275 return summary_.GetConstContent();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
276 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
277
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
278
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
279 const Json::Value& GetJson()
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
280 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
281 ComputeMissingInformation();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
282
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
283 if (!json_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
284 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
285 throw OrthancException(ErrorCode_InternalError);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
286 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
287
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
288 return json_.GetConstContent();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
289 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
290
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
291
2898
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
292 DicomInstanceHasher& GetHasher()
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
293 {
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
294 if (hasher_.get() == NULL)
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
295 {
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
296 hasher_.reset(new DicomInstanceHasher(GetSummary()));
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
297 }
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
298
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
299 if (hasher_.get() == NULL)
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
300 {
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
301 throw OrthancException(ErrorCode_InternalError);
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
302 }
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
303
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
304 return *hasher_;
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
305 }
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
306
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
307
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
308 bool LookupTransferSyntax(std::string& result)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
309 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
310 ComputeMissingInformation();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
311
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
312 DicomMap header;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
313 if (DicomMap::ParseDicomMetaInformation(header, GetBufferData(), GetBufferSize()))
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
314 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
315 const DicomValue* value = header.TestAndGetValue(DICOM_TAG_TRANSFER_SYNTAX_UID);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
316 if (value != NULL &&
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
317 !value->IsBinary() &&
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
318 !value->IsNull())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
319 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
320 result = Toolbox::StripSpaces(value->GetContent());
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
321 return true;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
322 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
323 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
324
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
325 return false;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
326 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
327 };
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
328
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
329
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
330 DicomInstanceToStore::DicomInstanceToStore() :
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
331 pimpl_(new PImpl)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
332 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
333 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
334
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
335
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
336 void DicomInstanceToStore::SetOrigin(const DicomInstanceOrigin& origin)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
337 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
338 pimpl_->origin_ = origin;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
339 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
340
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
341
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
342 const DicomInstanceOrigin& DicomInstanceToStore::GetOrigin() const
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
343 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
344 return pimpl_->origin_;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
345 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
346
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
347
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
348 void DicomInstanceToStore::SetBuffer(const std::string& dicom)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
349 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
350 pimpl_->buffer_.SetConstReference(dicom);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
351 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
352
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
353
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
354 void DicomInstanceToStore::SetParsedDicomFile(ParsedDicomFile& parsed)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
355 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
356 pimpl_->parsed_.SetReference(parsed);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
357 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
358
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
359
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
360 void DicomInstanceToStore::SetSummary(const DicomMap& summary)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
361 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
362 pimpl_->summary_.SetConstReference(summary);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
363 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
364
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
365
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
366 void DicomInstanceToStore::SetJson(const Json::Value& json)
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
367 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
368 pimpl_->json_.SetConstReference(json);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
369 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
370
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
371
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
372 const DicomInstanceToStore::MetadataMap& DicomInstanceToStore::GetMetadata() const
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
373 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
374 return pimpl_->metadata_;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
375 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
376
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
377
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
378 DicomInstanceToStore::MetadataMap& DicomInstanceToStore::GetMetadata()
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
379 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
380 return pimpl_->metadata_;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
381 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
382
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
383
1004
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
384 void DicomInstanceToStore::AddMetadata(ResourceType level,
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 MetadataType metadata,
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 const std::string& value)
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
388 pimpl_->metadata_[std::make_pair(level, metadata)] = value;
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 }
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391
1004
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
392 const char* DicomInstanceToStore::GetBufferData()
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
394 return pimpl_->GetBufferData();
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 }
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 size_t DicomInstanceToStore::GetBufferSize()
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
400 return pimpl_->GetBufferSize();
1004
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
401 }
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
402
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
403
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
404 const DicomMap& DicomInstanceToStore::GetSummary()
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
405 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
406 return pimpl_->GetSummary();
1004
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
407 }
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
408
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
409
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
410 const Json::Value& DicomInstanceToStore::GetJson()
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
411 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
412 return pimpl_->GetJson();
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 }
1572
904096e7367e More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1486
diff changeset
414
904096e7367e More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1486
diff changeset
415
2189
c4b3259c8bce New metadata automatically computed at the instance level: "TransferSyntax"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2131
diff changeset
416 bool DicomInstanceToStore::LookupTransferSyntax(std::string& result)
c4b3259c8bce New metadata automatically computed at the instance level: "TransferSyntax"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2131
diff changeset
417 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
418 return pimpl_->LookupTransferSyntax(result);
2189
c4b3259c8bce New metadata automatically computed at the instance level: "TransferSyntax"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2131
diff changeset
419 }
2898
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
420
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
421
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
422 DicomInstanceHasher& DicomInstanceToStore::GetHasher()
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
423 {
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
424 return pimpl_->GetHasher();
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
425 }
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 }