annotate OrthancStone/Sources/Loaders/DicomResourcesLoader.h @ 1689:fad38c4525f9

nicer modal for user preferences
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 25 Nov 2020 17:07:32 +0100
parents 52b8b96cb55f
children 9ac2a65d4172
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1271
0ca50d275b9a upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1250
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * 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
8 * modify it under the terms of the GNU Lesser General Public License
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * 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
14 * 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
15 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
16 *
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
17 * 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
18 * 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
19 * <http://www.gnu.org/licenses/>.
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #pragma once
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
1471
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
25 #include "../OrthancStone.h"
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
26
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #if !defined(ORTHANC_ENABLE_DCMTK)
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 # error The macro ORTHANC_ENABLE_DCMTK must be defined
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #endif
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 #include "../Oracle/HttpCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 #include "../Oracle/OracleCommandExceptionMessage.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #include "../Oracle/OrthancRestApiCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include "../Oracle/ReadFileCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "DicomSource.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 #include "ILoaderFactory.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 #include "LoadedDicomResources.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 #include "OracleScheduler.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
1484
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
40 namespace Orthanc
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
41 {
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
42 #if ORTHANC_ENABLE_DCMTK == 1
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
43 class ParsedDicomDir;
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
44 #endif
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
45 }
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
46
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 namespace OrthancStone
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
1484
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
49 #if ORTHANC_ENABLE_DCMTK == 1
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
50 class ParseDicomFromFileCommand;
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
51 #endif
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
52
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 class DicomResourcesLoader :
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 public ObserverBase<DicomResourcesLoader>,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 public IObservable
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 private:
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 class Handler;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 class StringHandler;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 class DicomWebHandler;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 class OrthancHandler;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 class OrthancInstanceTagsHandler;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 class OrthancOneChildInstanceHandler;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 class OrthancAllChildrenInstancesHandler;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 #if ORTHANC_ENABLE_DCMTK == 1
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 class DicomDirHandler;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 #endif
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 void Handle(const HttpCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 void Handle(const OrthancRestApiCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 void Handle(const ReadFileCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 void Handle(const OracleCommandExceptionMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 #if ORTHANC_ENABLE_DCMTK == 1
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 void Handle(const ParseDicomSuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 #endif
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 void ScheduleLoadOrthancInstanceTags(boost::shared_ptr<LoadedDicomResources> target,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 int priority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 const DicomSource& source,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 const std::string& instanceId,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 boost::shared_ptr<unsigned int> remainingCommands,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 boost::shared_ptr<Orthanc::IDynamicObject> userPayload);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 void ScheduleLoadOrthancOneChildInstance(boost::shared_ptr<LoadedDicomResources> target,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 int priority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 const DicomSource& source,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 Orthanc::ResourceType level,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 const std::string& id,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 boost::shared_ptr<unsigned int> remainingCommands,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 boost::shared_ptr<Orthanc::IDynamicObject> userPayload);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
97 explicit DicomResourcesLoader(ILoadersContext& context) :
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 context_(context)
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 ILoadersContext& context_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 public:
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
106 class SuccessMessage : public OriginMessage<DicomResourcesLoader>
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 private:
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 boost::shared_ptr<LoadedDicomResources> resources_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 int priority_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 const DicomSource& source_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 const Orthanc::IDynamicObject* userPayload_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 public:
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 SuccessMessage(const DicomResourcesLoader& origin,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 boost::shared_ptr<LoadedDicomResources> resources,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 int priority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 const DicomSource& source,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 const Orthanc::IDynamicObject* userPayload) :
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 OriginMessage(origin),
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 resources_(resources),
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 priority_(priority),
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 source_(source),
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 userPayload_(userPayload)
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 int GetPriority() const
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 return priority_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 const boost::shared_ptr<LoadedDicomResources> GetResources() const
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 return resources_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 const DicomSource& GetDicomSource() const
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 return source_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 bool HasUserPayload() const
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 return userPayload_ != NULL;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 const Orthanc::IDynamicObject& GetUserPayload() const;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 };
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 class Factory : public ILoaderFactory
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 public:
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
157 virtual boost::shared_ptr<IObserver> Create(ILoadersContext::ILock& stone) ORTHANC_OVERRIDE
1472
474360793956 DicomResourcesLoader::Create()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
158 {
474360793956 DicomResourcesLoader::Create()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
159 return DicomResourcesLoader::Create(stone);
474360793956 DicomResourcesLoader::Create()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
160 }
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 };
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162
1472
474360793956 DicomResourcesLoader::Create()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
163
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
164 static boost::shared_ptr<DicomResourcesLoader> Create(const ILoadersContext::ILock& stone);
1472
474360793956 DicomResourcesLoader::Create()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
165
1250
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
166 void ScheduleGetDicomWeb(boost::shared_ptr<LoadedDicomResources> target,
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
167 int priority,
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
168 const DicomSource& source,
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
169 const std::string& uri,
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
170 const std::set<Orthanc::DicomTag>& includeTags,
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
171 Orthanc::IDynamicObject* userPayload);
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172
1250
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
173 void ScheduleGetDicomWeb(boost::shared_ptr<LoadedDicomResources> target,
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
174 int priority,
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
175 const DicomSource& source,
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
176 const std::string& uri,
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
177 Orthanc::IDynamicObject* userPayload)
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 std::set<Orthanc::DicomTag> includeTags;
1250
a8248b08115c LoadedDicomResources::MergeResource()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
180 ScheduleGetDicomWeb(target, priority, source, uri, includeTags, userPayload);
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 void ScheduleQido(boost::shared_ptr<LoadedDicomResources> target,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 int priority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 const DicomSource& source,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 Orthanc::ResourceType level,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 const Orthanc::DicomMap& filter,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 const std::set<Orthanc::DicomTag>& includeTags,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 Orthanc::IDynamicObject* userPayload);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 void ScheduleLoadOrthancResources(boost::shared_ptr<LoadedDicomResources> target,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 int priority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 const DicomSource& source,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 Orthanc::ResourceType topLevel,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 const std::string& topId,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 Orthanc::ResourceType bottomLevel,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 Orthanc::IDynamicObject* userPayload);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 void ScheduleLoadOrthancResource(boost::shared_ptr<LoadedDicomResources> target,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 int priority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 const DicomSource& source,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 Orthanc::ResourceType level,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 const std::string& id,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 Orthanc::IDynamicObject* userPayload)
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 ScheduleLoadOrthancResources(target, priority, source, level, id, level, userPayload);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 #if ORTHANC_ENABLE_DCMTK == 1
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 static void GetDicomDirInstances(LoadedDicomResources& target,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 const Orthanc::ParsedDicomDir& dicomDir);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 #endif
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 void ScheduleLoadDicomDir(boost::shared_ptr<LoadedDicomResources> target,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 int priority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 const DicomSource& source,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 const std::string& path,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 Orthanc::IDynamicObject* userPayload);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 void ScheduleLoadDicomFile(boost::shared_ptr<LoadedDicomResources> target,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 int priority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 const DicomSource& source,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 const std::string& path,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 bool includePixelData,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 Orthanc::IDynamicObject* userPayload);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 bool ScheduleLoadDicomFile(boost::shared_ptr<LoadedDicomResources> target,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 int priority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 const DicomSource& source,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 const std::string& dicomDirPath,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 const Orthanc::DicomMap& dicomDirEntry,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 bool includePixelData,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 Orthanc::IDynamicObject* userPayload);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 };
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 }