Mercurial > hg > orthanc-stone
annotate Framework/Toolbox/DicomInstanceParameters.h @ 1106:c7388dfcd555
Added tag toa2019102801 for changeset 640feb146fa8
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 28 Oct 2019 11:14:05 +0100 |
parents | 5a18e6a395bc |
children | 7681f3943748 |
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_; |
1091
5a18e6a395bc
Added DoseUnit tag retrieval to DicomInstanceParameters
Benjamin Golinvaux <bgo@osimis.io>
parents:
1016
diff
changeset
|
62 std::string doseUnits_; |
746 | 63 |
64 void ComputeDoseOffsets(const Orthanc::DicomMap& dicom); | |
65 | |
66 Data(const Orthanc::DicomMap& dicom); | |
67 | |
68 CoordinateSystem3D GetFrameGeometry(unsigned int frame) const; | |
69 | |
70 bool IsPlaneWithinSlice(unsigned int frame, | |
71 const CoordinateSystem3D& plane) const; | |
72 | |
73 void ApplyRescale(Orthanc::ImageAccessor& image, | |
74 bool useDouble) const; | |
75 }; | |
76 | |
77 | |
78 Data data_; | |
79 | |
80 | |
81 public: | |
82 DicomInstanceParameters(const DicomInstanceParameters& other) : | |
83 data_(other.data_) | |
84 { | |
85 } | |
86 | |
87 DicomInstanceParameters(const Orthanc::DicomMap& dicom) : | |
88 data_(dicom) | |
89 { | |
90 } | |
91 | |
782
b24c208fa953
VolumeImageReslicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
768
diff
changeset
|
92 DicomInstanceParameters* Clone() const |
b24c208fa953
VolumeImageReslicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
768
diff
changeset
|
93 { |
b24c208fa953
VolumeImageReslicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
768
diff
changeset
|
94 return new DicomInstanceParameters(*this); |
b24c208fa953
VolumeImageReslicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
768
diff
changeset
|
95 } |
b24c208fa953
VolumeImageReslicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
768
diff
changeset
|
96 |
746 | 97 void SetOrthancInstanceIdentifier(const std::string& id) |
98 { | |
99 data_.orthancInstanceId_ = id; | |
100 } | |
101 | |
102 const std::string& GetOrthancInstanceIdentifier() const | |
103 { | |
104 return data_.orthancInstanceId_; | |
105 } | |
106 | |
107 const Orthanc::DicomImageInformation& GetImageInformation() const | |
108 { | |
109 return data_.imageInformation_; | |
110 } | |
111 | |
112 const std::string& GetStudyInstanceUid() const | |
113 { | |
114 return data_.studyInstanceUid_; | |
115 } | |
116 | |
117 const std::string& GetSeriesInstanceUid() const | |
118 { | |
119 return data_.seriesInstanceUid_; | |
120 } | |
121 | |
122 const std::string& GetSopInstanceUid() const | |
123 { | |
124 return data_.sopInstanceUid_; | |
125 } | |
126 | |
127 SopClassUid GetSopClassUid() const | |
128 { | |
129 return data_.sopClassUid_; | |
130 } | |
131 | |
132 double GetThickness() const | |
133 { | |
134 return data_.thickness_; | |
135 } | |
136 | |
137 double GetPixelSpacingX() const | |
138 { | |
139 return data_.pixelSpacingX_; | |
140 } | |
141 | |
142 double GetPixelSpacingY() const | |
143 { | |
144 return data_.pixelSpacingY_; | |
145 } | |
146 | |
147 const CoordinateSystem3D& GetGeometry() const | |
148 { | |
149 return data_.geometry_; | |
150 } | |
151 | |
152 CoordinateSystem3D GetFrameGeometry(unsigned int frame) const | |
153 { | |
154 return data_.GetFrameGeometry(frame); | |
155 } | |
156 | |
157 bool IsPlaneWithinSlice(unsigned int frame, | |
158 const CoordinateSystem3D& plane) const | |
159 { | |
160 return data_.IsPlaneWithinSlice(frame, plane); | |
161 } | |
162 | |
163 bool IsColor() const | |
164 { | |
165 return data_.isColor_; | |
166 } | |
167 | |
168 bool HasRescale() const | |
169 { | |
170 return data_.hasRescale_; | |
171 } | |
172 | |
173 double GetRescaleIntercept() const; | |
174 | |
175 double GetRescaleSlope() const; | |
176 | |
177 bool HasDefaultWindowing() const | |
178 { | |
179 return data_.hasDefaultWindowing_; | |
180 } | |
181 | |
182 float GetDefaultWindowingCenter() const; | |
183 | |
184 float GetDefaultWindowingWidth() const; | |
185 | |
186 Orthanc::PixelFormat GetExpectedPixelFormat() const | |
187 { | |
188 return data_.expectedPixelFormat_; | |
189 } | |
190 | |
1016
78a516d5ead5
making DicomInstanceParameters::ConvertToFloat() public
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
980
diff
changeset
|
191 Orthanc::ImageAccessor* ConvertToFloat(const Orthanc::ImageAccessor& pixelData) const; |
78a516d5ead5
making DicomInstanceParameters::ConvertToFloat() public
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
980
diff
changeset
|
192 |
746 | 193 TextureBaseSceneLayer* CreateTexture(const Orthanc::ImageAccessor& pixelData) const; |
768
55411e7da2f7
LookupTableTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
746
diff
changeset
|
194 |
55411e7da2f7
LookupTableTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
746
diff
changeset
|
195 LookupTableTextureSceneLayer* CreateLookupTableTexture(const Orthanc::ImageAccessor& pixelData) const; |
980
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
196 |
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
197 bool HasIndexInSeries() const |
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
198 { |
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
199 return data_.hasIndexInSeries_; |
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 |
8e497a4e3d96
DicomInstanceParameters::GetIndexInSeries()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
782
diff
changeset
|
202 unsigned int GetIndexInSeries() const; |
1091
5a18e6a395bc
Added DoseUnit tag retrieval to DicomInstanceParameters
Benjamin Golinvaux <bgo@osimis.io>
parents:
1016
diff
changeset
|
203 |
5a18e6a395bc
Added DoseUnit tag retrieval to DicomInstanceParameters
Benjamin Golinvaux <bgo@osimis.io>
parents:
1016
diff
changeset
|
204 const std::string& GetDoseUnits() const |
5a18e6a395bc
Added DoseUnit tag retrieval to DicomInstanceParameters
Benjamin Golinvaux <bgo@osimis.io>
parents:
1016
diff
changeset
|
205 { |
5a18e6a395bc
Added DoseUnit tag retrieval to DicomInstanceParameters
Benjamin Golinvaux <bgo@osimis.io>
parents:
1016
diff
changeset
|
206 return data_.doseUnits_; |
5a18e6a395bc
Added DoseUnit tag retrieval to DicomInstanceParameters
Benjamin Golinvaux <bgo@osimis.io>
parents:
1016
diff
changeset
|
207 } |
746 | 208 }; |
209 } |