Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Oracle/ParseDicomFromFileCommand.h @ 1623:74be0f498b08
Updated mechanism to avoid using deleted objects in RequestAnimationFrame callbacks.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 04 Nov 2020 11:39:15 +0100 |
parents | 8563ea5d8ae4 |
children | 9ac2a65d4172 |
rev | line source |
---|---|
1110 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
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 | 6 * |
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 |
1110 | 9 * as published by the Free Software Foundation, either version 3 of |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
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/>. |
1110 | 20 **/ |
21 | |
22 | |
23 #pragma once | |
24 | |
1128
8e3763d1736a
removing CustomOracleCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1124
diff
changeset
|
25 #include "OracleCommandBase.h" |
1484
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
26 #include "../Loaders/DicomSource.h" |
1110 | 27 |
1154 | 28 #include <string> |
29 | |
1110 | 30 namespace OrthancStone |
31 { | |
1151
48befc2bf66d
ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
32 class ParseDicomFromFileCommand : public OracleCommandBase |
1110 | 33 { |
34 private: | |
1484
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
35 DicomSource source_; |
1110 | 36 std::string path_; |
37 bool pixelDataIncluded_; | |
38 | |
1151
48befc2bf66d
ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
39 ParseDicomFromFileCommand(const ParseDicomFromFileCommand& other) : |
1484
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
40 source_(other.source_), |
1135
a0a33e5ea5bb
IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1134
diff
changeset
|
41 path_(other.path_), |
a0a33e5ea5bb
IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1134
diff
changeset
|
42 pixelDataIncluded_(other.pixelDataIncluded_) |
a0a33e5ea5bb
IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1134
diff
changeset
|
43 { |
a0a33e5ea5bb
IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1134
diff
changeset
|
44 } |
a0a33e5ea5bb
IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1134
diff
changeset
|
45 |
1110 | 46 public: |
1484
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
47 ParseDicomFromFileCommand(const DicomSource& source, |
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
48 const std::string& path) : |
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
49 source_(source), |
1110 | 50 path_(path), |
51 pixelDataIncluded_(true) | |
52 { | |
53 } | |
54 | |
1484
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
55 ParseDicomFromFileCommand(const DicomSource& source, |
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
56 const std::string& dicomDirPath, |
1151
48befc2bf66d
ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
57 const std::string& file) : |
1484
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
58 source_(source), |
1111
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
59 path_(GetDicomDirPath(dicomDirPath, file)), |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
60 pixelDataIncluded_(true) |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
61 { |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
62 } |
1151
48befc2bf66d
ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
63 |
1111
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
64 static std::string GetDicomDirPath(const std::string& dicomDirPath, |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
65 const std::string& file); |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
66 |
1571 | 67 virtual Type GetType() const ORTHANC_OVERRIDE |
1110 | 68 { |
1151
48befc2bf66d
ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
69 return Type_ParseDicomFromFile; |
1110 | 70 } |
71 | |
1571 | 72 virtual IOracleCommand* Clone() const ORTHANC_OVERRIDE |
1135
a0a33e5ea5bb
IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1134
diff
changeset
|
73 { |
1151
48befc2bf66d
ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
74 return new ParseDicomFromFileCommand(*this); |
1135
a0a33e5ea5bb
IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1134
diff
changeset
|
75 } |
a0a33e5ea5bb
IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1134
diff
changeset
|
76 |
1484
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
77 const DicomSource& GetSource() const |
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
78 { |
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
79 return source_; |
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
80 } |
121d01aa328e
SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
81 |
1110 | 82 const std::string& GetPath() const |
83 { | |
84 return path_; | |
85 } | |
86 | |
87 bool IsPixelDataIncluded() const | |
88 { | |
89 return pixelDataIncluded_; | |
90 } | |
91 | |
92 void SetPixelDataIncluded(bool included) | |
93 { | |
94 pixelDataIncluded_ = included; | |
95 } | |
96 }; | |
97 } |