Mercurial > hg > orthanc-stone
annotate Framework/Oracle/ParseDicomFileCommand.h @ 1111:3730956f41a5 broker
ParseDicomFileCommand::GetDicomDirPath()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 31 Oct 2019 18:38:26 +0100 |
parents | b82b74d13830 |
children | a08699daf78b |
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 | |
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium | |
6 * | |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
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 | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #if !defined(ORTHANC_ENABLE_DCMTK) | |
25 # error The macro ORTHANC_ENABLE_DCMTK must be defined | |
26 #endif | |
27 | |
28 #if ORTHANC_ENABLE_DCMTK != 1 | |
29 # error Support for DCMTK must be enabled to use ParseDicomFileCommand | |
30 #endif | |
31 | |
32 #include "../Messages/IMessage.h" | |
33 #include "OracleCommandWithPayload.h" | |
34 | |
35 #include <Core/DicomParsing/ParsedDicomFile.h> | |
36 | |
37 #include <dcmtk/dcmdata/dcfilefo.h> | |
38 | |
39 namespace OrthancStone | |
40 { | |
41 class ParseDicomFileCommand : public OracleCommandWithPayload | |
42 { | |
43 public: | |
44 class SuccessMessage : public OriginMessage<ParseDicomFileCommand> | |
45 { | |
46 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); | |
47 | |
48 private: | |
49 std::auto_ptr<Orthanc::ParsedDicomFile> dicom_; | |
50 | |
51 public: | |
52 SuccessMessage(const ParseDicomFileCommand& command, | |
53 DcmFileFormat& content); | |
54 | |
1111
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
55 bool HasDicom() const |
1110 | 56 { |
1111
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
57 return dicom_.get() != NULL; |
1110 | 58 } |
1111
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
59 |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
60 Orthanc::ParsedDicomFile& GetDicom() const; |
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 Orthanc::ParsedDicomFile* ReleaseDicom(); |
1110 | 63 }; |
64 | |
65 private: | |
66 std::string path_; | |
67 bool pixelDataIncluded_; | |
68 | |
69 public: | |
70 ParseDicomFileCommand(const std::string& path) : | |
71 path_(path), | |
72 pixelDataIncluded_(true) | |
73 { | |
74 } | |
75 | |
1111
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
76 ParseDicomFileCommand(const std::string& dicomDirPath, |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
77 const std::string& file) : |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
78 path_(GetDicomDirPath(dicomDirPath, file)), |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
79 pixelDataIncluded_(true) |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
80 { |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
81 } |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
82 |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
83 static std::string GetDicomDirPath(const std::string& dicomDirPath, |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
84 const std::string& file); |
3730956f41a5
ParseDicomFileCommand::GetDicomDirPath()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
85 |
1110 | 86 virtual Type GetType() const |
87 { | |
88 return Type_ParseDicomFile; | |
89 } | |
90 | |
91 const std::string& GetPath() const | |
92 { | |
93 return path_; | |
94 } | |
95 | |
96 bool IsPixelDataIncluded() const | |
97 { | |
98 return pixelDataIncluded_; | |
99 } | |
100 | |
101 void SetPixelDataIncluded(bool included) | |
102 { | |
103 pixelDataIncluded_ = included; | |
104 } | |
105 }; | |
106 } |