Mercurial > hg > orthanc-stone
annotate Framework/Deprecated/Toolbox/Slice.h @ 872:733c6db3e5a3 am-dev
limiting the size of the cache
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Mon, 01 Jul 2019 13:36:51 +0200 |
parents | c35e98d22764 |
children | 2d8ab34c8c91 |
rev | line source |
---|---|
73 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
439 | 5 * Copyright (C) 2017-2019 Osimis S.A., Belgium |
73 | 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 | |
732
c35e98d22764
move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
714
diff
changeset
|
24 #include "../../Toolbox/CoordinateSystem3D.h" |
73 | 25 #include "DicomFrameConverter.h" |
26 | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
27 #include <Core/DicomFormat/DicomImageInformation.h> |
647
6af3099ed8da
uncoupling OrthancStone::SlicesSorter from OrthancStone::Slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
28 #include <Core/IDynamicObject.h> |
118
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
117
diff
changeset
|
29 |
714
d2c0e347ddc2
deprecating DicomFrameConverter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
648
diff
changeset
|
30 namespace Deprecated |
73 | 31 { |
648 | 32 // TODO - Remove this class |
33 class Slice : | |
34 public Orthanc::IDynamicObject /* to be used as a payload of SlicesSorter */ | |
73 | 35 { |
36 private: | |
37 enum Type | |
38 { | |
39 Type_Invalid, | |
102 | 40 Type_Standalone, |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
41 Type_OrthancDecodableFrame, |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
42 Type_OrthancRawFrame |
73 | 43 // TODO A slice could come from some DICOM file (URL) |
44 }; | |
45 | |
118
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
117
diff
changeset
|
46 bool ComputeRTDoseGeometry(const Orthanc::DicomMap& dataset, |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
47 unsigned int frame); |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
48 |
73 | 49 Type type_; |
50 std::string orthancInstanceId_; | |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
51 std::string sopClassUid_; |
73 | 52 unsigned int frame_; |
119
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
53 unsigned int frameCount_; // TODO : Redundant with "imageInformation_" |
714
d2c0e347ddc2
deprecating DicomFrameConverter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
648
diff
changeset
|
54 OrthancStone::CoordinateSystem3D geometry_; |
73 | 55 double pixelSpacingX_; |
56 double pixelSpacingY_; | |
57 double thickness_; | |
119
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
58 unsigned int width_; // TODO : Redundant with "imageInformation_" |
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
59 unsigned int height_; // TODO : Redundant with "imageInformation_" |
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
60 DicomFrameConverter converter_; // TODO : Partially redundant with "imageInformation_" |
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
61 |
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
62 std::auto_ptr<Orthanc::DicomImageInformation> imageInformation_; |
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
63 |
73 | 64 public: |
119
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
65 Slice() : |
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
66 type_(Type_Invalid) |
322 | 67 { |
68 } | |
69 | |
70 | |
71 // this constructor is used to reference, i.e, a slice that is being loaded | |
72 Slice(const std::string& orthancInstanceId, | |
73 unsigned int frame) : | |
74 type_(Type_Invalid), | |
75 orthancInstanceId_(orthancInstanceId), | |
76 frame_(frame) | |
73 | 77 { |
78 } | |
79 | |
85 | 80 // TODO Is this constructor the best way to go to tackle missing |
389 | 81 // layers within SliceViewerWidget? |
714
d2c0e347ddc2
deprecating DicomFrameConverter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
648
diff
changeset
|
82 Slice(const OrthancStone::CoordinateSystem3D& plane, |
85 | 83 double thickness) : |
102 | 84 type_(Type_Standalone), |
85 | 85 frame_(0), |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
86 frameCount_(0), |
85 | 87 geometry_(plane), |
88 pixelSpacingX_(1), | |
89 pixelSpacingY_(1), | |
90 thickness_(thickness), | |
91 width_(0), | |
92 height_(0) | |
93 { | |
94 } | |
95 | |
714
d2c0e347ddc2
deprecating DicomFrameConverter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
648
diff
changeset
|
96 Slice(const OrthancStone::CoordinateSystem3D& plane, |
102 | 97 double pixelSpacingX, |
98 double pixelSpacingY, | |
99 double thickness, | |
100 unsigned int width, | |
101 unsigned int height, | |
102 const DicomFrameConverter& converter) : | |
103 type_(Type_Standalone), | |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
104 frameCount_(1), |
102 | 105 geometry_(plane), |
106 pixelSpacingX_(pixelSpacingX), | |
107 pixelSpacingY_(pixelSpacingY), | |
108 thickness_(thickness), | |
109 width_(width), | |
110 height_(height), | |
111 converter_(converter) | |
112 { | |
113 } | |
114 | |
99 | 115 bool IsValid() const |
116 { | |
117 return type_ != Type_Invalid; | |
118 } | |
119 | |
118
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
117
diff
changeset
|
120 bool ParseOrthancFrame(const Orthanc::DicomMap& dataset, |
73 | 121 const std::string& instanceId, |
122 unsigned int frame); | |
123 | |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
124 bool HasOrthancDecoding() const |
73 | 125 { |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
126 return type_ == Type_OrthancDecodableFrame; |
73 | 127 } |
128 | |
129 const std::string GetOrthancInstanceId() const; | |
130 | |
131 unsigned int GetFrame() const; | |
132 | |
714
d2c0e347ddc2
deprecating DicomFrameConverter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
648
diff
changeset
|
133 const OrthancStone::CoordinateSystem3D& GetGeometry() const; |
73 | 134 |
135 double GetThickness() const; | |
136 | |
137 double GetPixelSpacingX() const; | |
138 | |
139 double GetPixelSpacingY() const; | |
140 | |
141 unsigned int GetWidth() const; | |
142 | |
143 unsigned int GetHeight() const; | |
144 | |
145 const DicomFrameConverter& GetConverter() const; | |
77 | 146 |
714
d2c0e347ddc2
deprecating DicomFrameConverter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
648
diff
changeset
|
147 bool ContainsPlane(const OrthancStone::CoordinateSystem3D& plane) const; |
102 | 148 |
714
d2c0e347ddc2
deprecating DicomFrameConverter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
648
diff
changeset
|
149 void GetExtent(std::vector<OrthancStone::Vector>& points) const; |
119
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
150 |
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
151 const Orthanc::DicomImageInformation& GetImageInformation() const; |
318
3a4ca166fafa
ImageAccessor refactoring + implemented Image Cache in SmartLoader
am@osimis.io
parents:
212
diff
changeset
|
152 |
3a4ca166fafa
ImageAccessor refactoring + implemented Image Cache in SmartLoader
am@osimis.io
parents:
212
diff
changeset
|
153 Slice* Clone() const; |
73 | 154 }; |
155 } |