comparison OrthancStone/Sources/Toolbox/DicomInstanceParameters.h @ 1636:d1e0b08b809d

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 10 Nov 2020 16:20:22 +0100
parents 1a714e21ea7c
children d569effcd433
comparison
equal deleted inserted replaced
1635:1a714e21ea7c 1636:d1e0b08b809d
35 public Orthanc::IDynamicObject /* to be used as a payload to SlicesSorter */ 35 public Orthanc::IDynamicObject /* to be used as a payload to SlicesSorter */
36 { 36 {
37 // This class supersedes the deprecated "DicomFrameConverter" 37 // This class supersedes the deprecated "DicomFrameConverter"
38 38
39 private: 39 private:
40 struct Data // Struct to ease the copy constructor 40 struct Data // Plain old struct to ease the copy constructor
41 { 41 {
42 std::string orthancInstanceId_; 42 std::string orthancInstanceId_;
43 std::string studyInstanceUid_; 43 std::string studyInstanceUid_;
44 std::string seriesInstanceUid_; 44 std::string seriesInstanceUid_;
45 std::string sopInstanceUid_; 45 std::string sopInstanceUid_;
64 bool hasIndexInSeries_; 64 bool hasIndexInSeries_;
65 unsigned int indexInSeries_; 65 unsigned int indexInSeries_;
66 std::string doseUnits_; 66 std::string doseUnits_;
67 double doseGridScaling_; 67 double doseGridScaling_;
68 68
69 void ExtractFrameOffsets(const Orthanc::DicomMap& dicom);
70
71 explicit Data(const Orthanc::DicomMap& dicom); 69 explicit Data(const Orthanc::DicomMap& dicom);
72
73 CoordinateSystem3D GetFrameGeometry(unsigned int frame) const;
74
75 bool IsPlaneWithinSlice(unsigned int frame,
76 const CoordinateSystem3D& plane) const;
77
78 void ApplyRescaleAndDoseScaling(Orthanc::ImageAccessor& image,
79 bool useDouble) const;
80
81 double ApplyRescale(double value) const;
82
83 bool ComputeRegularSpacing(double& target) const;
84 }; 70 };
85 71
86 72
87 Data data_; 73 Data data_;
88 74
75 void ApplyRescaleAndDoseScaling(Orthanc::ImageAccessor& image,
76 bool useDouble) const;
89 77
90 public: 78 public:
91 explicit DicomInstanceParameters(const DicomInstanceParameters& other) : 79 explicit DicomInstanceParameters(const DicomInstanceParameters& other) :
92 data_(other.data_) 80 data_(other.data_)
93 { 81 {
171 const CoordinateSystem3D& GetGeometry() const 159 const CoordinateSystem3D& GetGeometry() const
172 { 160 {
173 return data_.geometry_; 161 return data_.geometry_;
174 } 162 }
175 163
176 CoordinateSystem3D GetFrameGeometry(unsigned int frame) const 164 CoordinateSystem3D GetFrameGeometry(unsigned int frame) const;
177 {
178 return data_.GetFrameGeometry(frame);
179 }
180 165
181 bool IsPlaneWithinSlice(unsigned int frame, 166 bool IsPlaneWithinSlice(unsigned int frame,
182 const CoordinateSystem3D& plane) const 167 const CoordinateSystem3D& plane) const;
183 {
184 return data_.IsPlaneWithinSlice(frame, plane);
185 }
186 168
187 bool IsColor() const 169 bool IsColor() const
188 { 170 {
189 return data_.isColor_; 171 return data_.isColor_;
190 } 172 }
238 double GetDoseGridScaling() const 220 double GetDoseGridScaling() const
239 { 221 {
240 return data_.doseGridScaling_; 222 return data_.doseGridScaling_;
241 } 223 }
242 224
243 double ApplyRescale(double value) const 225 double ApplyRescale(double value) const;
244 {
245 return data_.ApplyRescale(value);
246 }
247 226
248 // Required for RT-DOSE 227 // Required for RT-DOSE
249 bool ComputeRegularSpacing(double& target) const 228 bool ComputeRegularSpacing(double& target) const;
250 {
251 return data_.ComputeRegularSpacing(target);
252 }
253 }; 229 };
254 } 230 }