annotate OrthancStone/Sources/Oracle/ParseDicomFromWadoCommand.cpp @ 2105:ca376147db15 dicom-sr

integration mainline->dicom-sr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 22 Nov 2023 07:43:50 +0100
parents 07964689cb0b
children c23eef785569
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
2077
07964689cb0b upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
07964689cb0b upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
16 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
17 *
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
19 * License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
20 * <http://www.gnu.org/licenses/>.
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "ParseDicomFromWadoCommand.h"
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1271
diff changeset
26 #include <OrthancException.h>
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
1624
59f95b9ea858 fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
28 #include <cassert>
59f95b9ea858 fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
29
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 namespace OrthancStone
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 {
1484
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
32 ParseDicomFromWadoCommand::ParseDicomFromWadoCommand(const DicomSource& source,
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
33 const std::string& sopInstanceUid,
1726
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
34 bool transcode,
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
35 Orthanc::DicomTransferSyntax transferSyntax,
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 IOracleCommand* restCommand) :
1484
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
37 source_(source),
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 sopInstanceUid_(sopInstanceUid),
1726
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
39 transcode_(transcode),
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
40 transferSyntax_(transferSyntax),
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 restCommand_(restCommand)
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 {
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 if (restCommand == NULL)
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 {
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 }
1726
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
47
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 if (restCommand_->GetType() != Type_Http &&
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 restCommand_->GetType() != Type_OrthancRestApi)
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 {
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadParameterType);
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 }
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 }
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 IOracleCommand* ParseDicomFromWadoCommand::Clone() const
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 {
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 assert(restCommand_.get() != NULL);
1726
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
59 return new ParseDicomFromWadoCommand(source_, sopInstanceUid_, transcode_, transferSyntax_, restCommand_->Clone());
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 }
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
1726
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
63 Orthanc::DicomTransferSyntax ParseDicomFromWadoCommand::GetTranscodeTransferSyntax() const
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
64 {
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
65 if (transcode_)
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
66 {
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
67 return transferSyntax_;
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
68 }
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
69 else
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
70 {
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
71 // "IsTranscode()" should have been called
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
72 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
73 }
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
74 }
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
75
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
76
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
77 bool ParseDicomFromWadoCommand::IsSameCommand(const ParseDicomFromWadoCommand& other) const
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
78 {
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
79 if (source_.IsSameSource(other.source_) &&
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
80 sopInstanceUid_ == other.sopInstanceUid_ &&
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
81 transcode_ == other.transcode_)
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
82 {
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
83 if (transcode_)
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
84 {
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
85 return transferSyntax_ == other.transferSyntax_;
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
86 }
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
87 else
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
88 {
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
89 return true;
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
90 }
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
91 }
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
92 else
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
93 {
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
94 return false;
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
95 }
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
96 }
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
97
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
98
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 const IOracleCommand& ParseDicomFromWadoCommand::GetRestCommand() const
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 {
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 assert(restCommand_.get() != NULL);
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 return *restCommand_;
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 }
1484
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
104
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
105
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
106 ParseDicomFromWadoCommand* ParseDicomFromWadoCommand::Create(
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
107 const DicomSource& source,
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
108 const std::string& studyInstanceUid,
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
109 const std::string& seriesInstanceUid,
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
110 const std::string& sopInstanceUid,
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
111 bool transcode,
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
112 Orthanc::DicomTransferSyntax transferSyntax,
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
113 Orthanc::IDynamicObject* payload)
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
114 {
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
115 std::unique_ptr<Orthanc::IDynamicObject> protection(payload);
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
116
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
117 const std::string uri = ("/studies/" + studyInstanceUid +
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
118 "/series/" + seriesInstanceUid +
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
119 "/instances/" + sopInstanceUid);
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
120
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
121 std::string s;
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
122 if (transcode)
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
123 {
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
124 s = Orthanc::GetTransferSyntaxUid(transferSyntax);
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
125 }
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
126 else
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
127 {
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
128 s = "*"; // No transcoding, keep source transfer syntax
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
129 }
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
130
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
131 std::map<std::string, std::string> arguments, headers;
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
132 headers["Accept"] = ("multipart/related; type=\"application/dicom\"; transfer-syntax=" + s);
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
133
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
134 std::unique_ptr<IOracleCommand> rest(
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
135 source.CreateDicomWebCommand(uri, arguments, headers, NULL));
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
136
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
137 std::unique_ptr<ParseDicomFromWadoCommand> command(
1726
0257339b0884 new method ParseDicomFromWadoCommand::IsSameCommand()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
138 new ParseDicomFromWadoCommand(source, sopInstanceUid, transcode, transferSyntax, rest.release()));
1484
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
139
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
140 if (protection.get() != NULL)
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
141 {
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
142 command->AcquirePayload(protection.release());
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
143 }
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
144
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
145 return command.release();
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
146 }
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 }