Mercurial > hg > orthanc-stone
annotate Framework/Toolbox/DicomFrameConverter.h @ 98:a33abae66344 wasm
scrolling over series
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 30 May 2017 15:02:24 +0200 |
parents | 28956ed68280 |
children | 2eca030792aa 4cff7b1ed31d |
rev | line source |
---|---|
0 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
40
7207a407bcd8
shared copyright with osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
32
diff
changeset
|
5 * Copyright (C) 2017 Osimis, Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
47 | 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. | |
0 | 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 | |
47 | 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 | |
0 | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
32 | 24 #include "../../Resources/Orthanc/Core/Images/ImageAccessor.h" |
25 #include "../../Resources/Orthanc/Plugins/Samples/Common/IDicomDataset.h" | |
0 | 26 |
32 | 27 #include <memory> |
0 | 28 |
29 namespace OrthancStone | |
30 { | |
31 /** | |
32 * This class is responsible for converting the pixel format of a | |
33 * DICOM frame coming from Orthanc, into a pixel format that is | |
34 * suitable for Stone, given the relevant DICOM tags: | |
35 * - Color frames will stay in the RGB24 format. | |
36 * - Grayscale frames will be converted to the Float32 format. | |
37 **/ | |
38 class DicomFrameConverter | |
39 { | |
40 private: | |
41 bool isSigned_; | |
42 bool isColor_; | |
43 bool hasRescale_; | |
44 float rescaleIntercept_; | |
45 float rescaleSlope_; | |
46 float defaultWindowCenter_; | |
47 float defaultWindowWidth_; | |
48 | |
49 void SetDefaultParameters(); | |
50 | |
51 public: | |
52 DicomFrameConverter() | |
53 { | |
54 SetDefaultParameters(); | |
55 } | |
56 | |
57 Orthanc::PixelFormat GetExpectedPixelFormat() const; | |
58 | |
32 | 59 void ReadParameters(const OrthancPlugins::IDicomDataset& dicom); |
0 | 60 |
61 float GetDefaultWindowCenter() const | |
62 { | |
63 return defaultWindowCenter_; | |
64 } | |
65 | |
66 float GetDefaultWindowWidth() const | |
67 { | |
68 return defaultWindowWidth_; | |
69 } | |
70 | |
71 void ConvertFrame(std::auto_ptr<Orthanc::ImageAccessor>& source) const; | |
72 }; | |
73 } |