annotate Framework/Oracle/ParseDicomFromFileCommand.h @ 1307:8a28a9bf8876 broker

ViewportController now gets a ref to its parent viewport for proper lock usage
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 04 Mar 2020 10:07:37 +0100
parents 0ca50d275b9a
children 121d01aa328e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1110
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
b82b74d13830 ParseDicomFileCommand
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: 1154
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
1110
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
1128
8e3763d1736a removing CustomOracleCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1124
diff changeset
24 #include "OracleCommandBase.h"
1110
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
1154
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1151
diff changeset
26 #include <string>
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1151
diff changeset
27
1110
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 namespace OrthancStone
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
30 class ParseDicomFromFileCommand : public OracleCommandBase
1110
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 {
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 private:
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 std::string path_;
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 bool pixelDataIncluded_;
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
36 ParseDicomFromFileCommand(const ParseDicomFromFileCommand& other) :
1135
a0a33e5ea5bb IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1134
diff changeset
37 path_(other.path_),
a0a33e5ea5bb IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1134
diff changeset
38 pixelDataIncluded_(other.pixelDataIncluded_)
a0a33e5ea5bb IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1134
diff changeset
39 {
a0a33e5ea5bb IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1134
diff changeset
40 }
a0a33e5ea5bb IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1134
diff changeset
41
1110
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 public:
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
43 ParseDicomFromFileCommand(const std::string& path) :
1110
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 path_(path),
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 pixelDataIncluded_(true)
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 {
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 }
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
49 ParseDicomFromFileCommand(const std::string& dicomDirPath,
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
50 const std::string& file) :
1111
3730956f41a5 ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1110
diff changeset
51 path_(GetDicomDirPath(dicomDirPath, file)),
3730956f41a5 ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1110
diff changeset
52 pixelDataIncluded_(true)
3730956f41a5 ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1110
diff changeset
53 {
3730956f41a5 ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1110
diff changeset
54 }
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
55
1111
3730956f41a5 ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1110
diff changeset
56 static std::string GetDicomDirPath(const std::string& dicomDirPath,
3730956f41a5 ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1110
diff changeset
57 const std::string& file);
3730956f41a5 ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1110
diff changeset
58
1110
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 virtual Type GetType() const
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 {
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
61 return Type_ParseDicomFromFile;
1110
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 }
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
1135
a0a33e5ea5bb IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1134
diff changeset
64 virtual IOracleCommand* Clone() const
a0a33e5ea5bb IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1134
diff changeset
65 {
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
66 return new ParseDicomFromFileCommand(*this);
1135
a0a33e5ea5bb IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1134
diff changeset
67 }
a0a33e5ea5bb IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1134
diff changeset
68
1110
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 const std::string& GetPath() const
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 {
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 return path_;
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 }
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 bool IsPixelDataIncluded() const
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 {
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 return pixelDataIncluded_;
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 }
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 void SetPixelDataIncluded(bool included)
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 {
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 pixelDataIncluded_ = included;
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 }
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 };
b82b74d13830 ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 }