Mercurial > hg > orthanc-stone
annotate Framework/Toolbox/DicomInstanceParameters.h @ 1081:369050c846a9 toa2019102101
Removed erron. error log
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 21 Oct 2019 20:51:35 +0200 |
parents | 78a516d5ead5 |
children | 5a18e6a395bc |
rev | line source |
---|---|
746 | 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 #include "../StoneEnumerations.h" | |
768
55411e7da2f7
LookupTableTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
746
diff
changeset
|
25 #include "../Scene2D/LookupTableTextureSceneLayer.h" |
746 | 26 #include "../Toolbox/CoordinateSystem3D.h" |
27 | |
28 #include <Core/IDynamicObject.h> | |
29 #include <Core/DicomFormat/DicomImageInformation.h> | |
30 | |
31 namespace OrthancStone | |
32 { | |
33 class DicomInstanceParameters : | |
34 public Orthanc::IDynamicObject /* to be used as a payload to SlicesSorter */ | |
35 { | |
36 // This class supersedes the deprecated "DicomFrameConverter" | |
37 | |
38 private: | |
39 struct Data // Struct to ease the copy constructor | |
40 { | |
41 std::string orthancInstanceId_; | |
42 std::string studyInstanceUid_; | |
43 std::string seriesInstanceUid_; | |
44 std::string sopInstanceUid_; | |
45 Orthanc::DicomImageInformation imageInformation_; | |
46 SopClassUid sopClassUid_; | |
47 double thickness_; | |
48 double pixelSpacingX_; | |
49 double pixelSpacingY_; | |
50 CoordinateSystem3D geometry_; | |
51 Vector frameOffsets_; | |
52 bool isColor_; | |
53 bool hasRescale_; | |
54 double rescaleIntercept_; | |
55 double rescaleSlope_; | |
56 bool hasDefaultWindowing_; | |
57 float defaultWindowingCenter_; | |
58 float defaultWindowingWidth_; | |
59 Orthanc::PixelFormat expectedPixelFormat_; | |
980
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
60 bool hasIndexInSeries_; |
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
61 unsigned int indexInSeries_; |
746 | 62 |
63 void ComputeDoseOffsets(const Orthanc::DicomMap& dicom); | |
64 | |
65 Data(const Orthanc::DicomMap& dicom); | |
66 | |
67 CoordinateSystem3D GetFrameGeometry(unsigned int frame) const; | |
68 | |
69 bool IsPlaneWithinSlice(unsigned int frame, | |
70 const CoordinateSystem3D& plane) const; | |
71 | |
72 void ApplyRescale(Orthanc::ImageAccessor& image, | |
73 bool useDouble) const; | |
74 }; | |
75 | |
76 | |
77 Data data_; | |
78 | |
79 | |
80 public: | |
81 DicomInstanceParameters(const DicomInstanceParameters& other) : | |
82 data_(other.data_) | |
83 { | |
84 } | |
85 | |
86 DicomInstanceParameters(const Orthanc::DicomMap& dicom) : | |
87 data_(dicom) | |
88 { | |
89 } | |
90 | |
782
b24c208fa953
VolumeImageReslicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
768
diff
changeset
|
91 DicomInstanceParameters* Clone() const |
b24c208fa953
VolumeImageReslicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
768
diff
changeset
|
92 { |
b24c208fa953
VolumeImageReslicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
768
diff
changeset
|
93 return new DicomInstanceParameters(*this); |
b24c208fa953
VolumeImageReslicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
768
diff
changeset
|
94 } |
b24c208fa953
VolumeImageReslicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
768
diff
changeset
|
95 |
746 | 96 void SetOrthancInstanceIdentifier(const std::string& id) |
97 { | |
98 data_.orthancInstanceId_ = id; | |
99 } | |
100 | |
101 const std::string& GetOrthancInstanceIdentifier() const | |
102 { | |
103 return data_.orthancInstanceId_; | |
104 } | |
105 | |
106 const Orthanc::DicomImageInformation& GetImageInformation() const | |
107 { | |
108 return data_.imageInformation_; | |
109 } | |
110 | |
111 const std::string& GetStudyInstanceUid() const | |
112 { | |
113 return data_.studyInstanceUid_; | |
114 } | |
115 | |
116 const std::string& GetSeriesInstanceUid() const | |
117 { | |
118 return data_.seriesInstanceUid_; | |
119 } | |
120 | |
121 const std::string& GetSopInstanceUid() const | |
122 { | |
123 return data_.sopInstanceUid_; | |
124 } | |
125 | |
126 SopClassUid GetSopClassUid() const | |
127 { | |
128 return data_.sopClassUid_; | |
129 } | |
130 | |
131 double GetThickness() const | |
132 { | |
133 return data_.thickness_; | |
134 } | |
135 | |
136 double GetPixelSpacingX() const | |
137 { | |
138 return data_.pixelSpacingX_; | |
139 } | |
140 | |
141 double GetPixelSpacingY() const | |
142 { | |
143 return data_.pixelSpacingY_; | |
144 } | |
145 | |
146 const CoordinateSystem3D& GetGeometry() const | |
147 { | |
148 return data_.geometry_; | |
149 } | |
150 | |
151 CoordinateSystem3D GetFrameGeometry(unsigned int frame) const | |
152 { | |
153 return data_.GetFrameGeometry(frame); | |
154 } | |
155 | |
156 bool IsPlaneWithinSlice(unsigned int frame, | |
157 const CoordinateSystem3D& plane) const | |
158 { | |
159 return data_.IsPlaneWithinSlice(frame, plane); | |
160 } | |
161 | |
162 bool IsColor() const | |
163 { | |
164 return data_.isColor_; | |
165 } | |
166 | |
167 bool HasRescale() const | |
168 { | |
169 return data_.hasRescale_; | |
170 } | |
171 | |
172 double GetRescaleIntercept() const; | |
173 | |
174 double GetRescaleSlope() const; | |
175 | |
176 bool HasDefaultWindowing() const | |
177 { | |
178 return data_.hasDefaultWindowing_; | |
179 } | |
180 | |
181 float GetDefaultWindowingCenter() const; | |
182 | |
183 float GetDefaultWindowingWidth() const; | |
184 | |
185 Orthanc::PixelFormat GetExpectedPixelFormat() const | |
186 { | |
187 return data_.expectedPixelFormat_; | |
188 } | |
189 | |
1016
78a516d5ead5
making DicomInstanceParameters::ConvertToFloat() public
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
980
diff
changeset
|
190 Orthanc::ImageAccessor* ConvertToFloat(const Orthanc::ImageAccessor& pixelData) const; |
78a516d5ead5
making DicomInstanceParameters::ConvertToFloat() public
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
980
diff
changeset
|
191 |
746 | 192 TextureBaseSceneLayer* CreateTexture(const Orthanc::ImageAccessor& pixelData) const; |
768
55411e7da2f7
LookupTableTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
746
diff
changeset
|
193 |
55411e7da2f7
LookupTableTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
746
diff
changeset
|
194 LookupTableTextureSceneLayer* CreateLookupTableTexture(const Orthanc::ImageAccessor& pixelData) const; |
980
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
195 |
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
196 bool HasIndexInSeries() const |
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
197 { |
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
198 return data_.hasIndexInSeries_; |
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
199 } |
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
200 |
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
201 unsigned int GetIndexInSeries() const; |
746 | 202 }; |
203 } |