annotate OrthancServer/DicomInstanceToStore.cpp @ 3724:f29a75a3190a

fix for msvc
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 06 Mar 2020 10:47:41 +0100
parents 2a170a8f1faf
children be7df7fe3d80
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
3640
94f4a18a79cc upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3342
diff changeset
5 * Copyright (C) 2017-2020 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:
3712
2a170a8f1faf replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
160 std::unique_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 {
3342
63f59ad9381a Fix issue #136 (C-Find request fails when found DICOM file does not have certain tags)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
182 parsed_.TakeOwnership(new ParsedDicomFile(summary_.GetConstContent(),
63f59ad9381a Fix issue #136 (C-Find request fails when found DICOM file does not have certain tags)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
183 GetDefaultDicomEncoding(),
63f59ad9381a Fix issue #136 (C-Find request fails when found DICOM file does not have certain tags)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
184 false /* be strict */));
2894
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 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
187
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
188 // Serialize the parsed DICOM file
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
189 buffer_.Allocate();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
190 if (!FromDcmtkBridge::SaveToMemoryBuffer(buffer_.GetContent(),
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
191 *parsed_.GetContent().GetDcmtkObject().getDataset()))
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
192 {
2955
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2898
diff changeset
193 throw OrthancException(ErrorCode_InternalError,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2898
diff changeset
194 "Unable to serialize a DICOM file to a memory buffer");
2894
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 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
197
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
198 if (summary_.HasContent() &&
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
199 json_.HasContent())
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 return;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
202 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
203
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
204 // 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
205 // memory buffer, but that its summary or its JSON version is
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
206 // missing
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 if (!parsed_.HasContent())
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 parsed_.TakeOwnership(new ParsedDicomFile(buffer_.GetConstContent()));
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
211 }
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 // At this point, we have parsed the DICOM file
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 if (!summary_.HasContent())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
216 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
217 summary_.Allocate();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
218 FromDcmtkBridge::ExtractDicomSummary(summary_.GetContent(),
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
219 *parsed_.GetContent().GetDcmtkObject().getDataset());
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
220 }
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 if (!json_.HasContent())
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 json_.Allocate();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
225
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
226 std::set<DicomTag> ignoreTagLength;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
227 FromDcmtkBridge::ExtractDicomAsJson(json_.GetContent(),
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
228 *parsed_.GetContent().GetDcmtkObject().getDataset(),
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
229 ignoreTagLength);
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 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
232
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
233
2898
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
234 public:
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
235 const char* GetBufferData()
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 ComputeMissingInformation();
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 if (!buffer_.HasContent())
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 throw OrthancException(ErrorCode_InternalError);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
242 }
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 if (buffer_.GetConstContent().size() == 0)
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 return NULL;
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 else
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 return buffer_.GetConstContent().c_str();
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
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 size_t GetBufferSize()
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 ComputeMissingInformation();
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 if (!buffer_.HasContent())
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 throw OrthancException(ErrorCode_InternalError);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
262 }
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 return buffer_.GetConstContent().size();
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
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 const DicomMap& GetSummary()
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 ComputeMissingInformation();
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 if (!summary_.HasContent())
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 throw OrthancException(ErrorCode_InternalError);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
275 }
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 return summary_.GetConstContent();
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
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 const Json::Value& GetJson()
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 ComputeMissingInformation();
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 if (!json_.HasContent())
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 throw OrthancException(ErrorCode_InternalError);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
288 }
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 return json_.GetConstContent();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
291 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
292
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
293
2898
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
294 DicomInstanceHasher& GetHasher()
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 if (hasher_.get() == NULL)
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 hasher_.reset(new DicomInstanceHasher(GetSummary()));
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
299 }
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 if (hasher_.get() == NULL)
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 throw OrthancException(ErrorCode_InternalError);
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
304 }
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 return *hasher_;
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
307 }
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
308
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
309
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
310 bool LookupTransferSyntax(std::string& result)
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 ComputeMissingInformation();
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
313
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
314 DicomMap header;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
315 if (DicomMap::ParseDicomMetaInformation(header, GetBufferData(), GetBufferSize()))
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
316 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
317 const DicomValue* value = header.TestAndGetValue(DICOM_TAG_TRANSFER_SYNTAX_UID);
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
318 if (value != NULL &&
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
319 !value->IsBinary() &&
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
320 !value->IsNull())
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
321 {
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
322 result = Toolbox::StripSpaces(value->GetContent());
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
323 return true;
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 }
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 return false;
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
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
331
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
332 DicomInstanceToStore::DicomInstanceToStore() :
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
333 pimpl_(new PImpl)
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
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 void DicomInstanceToStore::SetOrigin(const DicomInstanceOrigin& 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 pimpl_->origin_ = origin;
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
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 const DicomInstanceOrigin& DicomInstanceToStore::GetOrigin() const
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 return pimpl_->origin_;
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
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 void DicomInstanceToStore::SetBuffer(const std::string& 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 pimpl_->buffer_.SetConstReference(dicom);
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
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 void DicomInstanceToStore::SetParsedDicomFile(ParsedDicomFile& 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 pimpl_->parsed_.SetReference(parsed);
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
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 void DicomInstanceToStore::SetSummary(const DicomMap& 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 pimpl_->summary_.SetConstReference(summary);
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
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 void DicomInstanceToStore::SetJson(const Json::Value& 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 pimpl_->json_.SetConstReference(json);
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
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 const DicomInstanceToStore::MetadataMap& DicomInstanceToStore::GetMetadata() const
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 return pimpl_->metadata_;
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
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 DicomInstanceToStore::MetadataMap& DicomInstanceToStore::GetMetadata()
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 return pimpl_->metadata_;
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
383 }
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
384
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
385
1004
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
386 void DicomInstanceToStore::AddMetadata(ResourceType level,
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 MetadataType metadata,
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 const std::string& value)
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
390 pimpl_->metadata_[std::make_pair(level, metadata)] = value;
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 }
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393
1004
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
394 const char* DicomInstanceToStore::GetBufferData()
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
396 return pimpl_->GetBufferData();
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397 }
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 size_t DicomInstanceToStore::GetBufferSize()
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
402 return pimpl_->GetBufferSize();
1004
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
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
405
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
406 const DicomMap& DicomInstanceToStore::GetSummary()
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
407 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
408 return pimpl_->GetSummary();
1004
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
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
411
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
412 const Json::Value& DicomInstanceToStore::GetJson()
a226e0959d8b DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1003
diff changeset
413 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
414 return pimpl_->GetJson();
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 }
1572
904096e7367e More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1486
diff changeset
416
904096e7367e More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1486
diff changeset
417
2189
c4b3259c8bce New metadata automatically computed at the instance level: "TransferSyntax"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2131
diff changeset
418 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
419 {
2894
a27b0e9a3fd9 refactoring DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
420 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
421 }
2898
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
422
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 DicomInstanceHasher& DicomInstanceToStore::GetHasher()
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
425 {
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
426 return pimpl_->GetHasher();
e5e3253a1164 DicomInstanceToStore::GetHasher()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2894
diff changeset
427 }
1003
1d35281d967c DicomInstanceToStore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 }