comparison Framework/Oracle/ParseDicomFileCommand.h @ 1110:b82b74d13830 broker

ParseDicomFileCommand
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 31 Oct 2019 15:05:46 +0100
parents
children 3730956f41a5
comparison
equal deleted inserted replaced
1109:79b1b541fe15 1110:b82b74d13830
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
55 const Orthanc::ParsedDicomFile& GetDicom() const
56 {
57 return *dicom_;
58 }
59 };
60
61 private:
62 std::string path_;
63 bool pixelDataIncluded_;
64
65 public:
66 ParseDicomFileCommand(const std::string& path) :
67 path_(path),
68 pixelDataIncluded_(true)
69 {
70 }
71
72 virtual Type GetType() const
73 {
74 return Type_ParseDicomFile;
75 }
76
77 const std::string& GetPath() const
78 {
79 return path_;
80 }
81
82 bool IsPixelDataIncluded() const
83 {
84 return pixelDataIncluded_;
85 }
86
87 void SetPixelDataIncluded(bool included)
88 {
89 pixelDataIncluded_ = included;
90 }
91 };
92 }