ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkThreeDCircularProjectionGeometry.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright RTK Consortium
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18
19#ifndef rtkThreeDCircularProjectionGeometry_h
20#define rtkThreeDCircularProjectionGeometry_h
21
22#include "RTKExport.h"
24
25namespace rtk
26{
50
52{
53public:
54 ITK_DISALLOW_COPY_AND_MOVE(ThreeDCircularProjectionGeometry);
55
60
68
70 itkNewMacro(Self);
71
76 void
77 AddProjection(double sid,
78 double sdd,
79 double gantryAngle,
80 double projOffsetX = 0.,
81 double projOffsetY = 0.,
82 double outOfPlaneAngle = 0.,
83 double inPlaneAngle = 0.,
84 double sourceOffsetX = 0.,
85 double sourceOffsetY = 0.);
86
88 virtual void
90 double sdd,
91 double gantryAngle,
92 double projOffsetX = 0.,
93 double projOffsetY = 0.,
94 double outOfPlaneAngle = 0.,
95 double inPlaneAngle = 0.,
96 double sourceOffsetX = 0.,
97 double sourceOffsetY = 0.);
98
109 bool
110 AddProjection(const PointType & sourcePosition,
111 const PointType & detectorPosition,
112 const VectorType & detectorRowVector,
113 const VectorType & detectorColumnVector);
114
115
146 bool
148
150 void
151 Clear() override;
152
155 const std::vector<double> &
157 {
158 return this->m_GantryAngles;
159 }
160 const std::vector<double> &
162 {
163 return this->m_OutOfPlaneAngles;
164 }
165 const std::vector<double> &
167 {
168 return this->m_InPlaneAngles;
169 }
170 const std::vector<double> &
172 {
173 return this->m_SourceToIsocenterDistances;
174 }
175 const std::vector<double> &
177 {
178 return this->m_SourceOffsetsX;
179 }
180 const std::vector<double> &
182 {
183 return this->m_SourceOffsetsY;
184 }
185 const std::vector<double> &
187 {
188 return this->m_SourceToDetectorDistances;
189 }
190 const std::vector<double> &
192 {
193 return this->m_ProjectionOffsetsX;
194 }
195 const std::vector<double> &
197 {
198 return this->m_ProjectionOffsetsY;
199 }
200
204 const std::vector<double> &
206 {
207 return this->m_SourceAngles;
208 }
209
212 std::vector<double>
214
217 static std::multimap<double, unsigned int>
218 GetSortedAngles(const std::vector<double> & angles);
219
222 static std::map<double, unsigned int>
223 GetUniqueSortedAngles(const std::vector<double> & angles);
224
226 std::vector<double>
227 GetAngularGapsWithNext(const std::vector<double> & angles) const;
228
231 std::vector<double>
232 GetAngularGaps(const std::vector<double> & angles);
233
237 ComputeRotationHomogeneousMatrix(double angleX, double angleY, double angleZ);
238
241 ComputeTranslationHomogeneousMatrix(double transX, double transY);
243 ComputeTranslationHomogeneousMatrix(double transX, double transY, double transZ);
244
249
252 const std::vector<TwoDHomogeneousMatrixType> &
257 TwoDHomogeneousMatrixType
258 GetProjectionTranslationMatrix(const unsigned int i) const
259 {
260 return this->m_ProjectionTranslationMatrices[i];
261 }
262
263 const std::vector<ThreeDHomogeneousMatrixType> &
265 {
266 return this->m_RotationMatrices;
267 }
268 ThreeDHomogeneousMatrixType
269 GetRotationMatrix(const unsigned int i) const
270 {
271 return this->m_RotationMatrices[i];
272 }
273
274 const std::vector<ThreeDHomogeneousMatrixType> &
276 {
277 return this->m_SourceTranslationMatrices;
278 }
279 ThreeDHomogeneousMatrixType
280 GetSourceTranslationMatrices(const unsigned int i) const
281 {
282 return this->m_SourceTranslationMatrices[i];
283 }
284
285 const std::vector<Superclass::MatrixType> &
287 {
288 return this->m_MagnificationMatrices;
289 }
290 Superclass::MatrixType
291 GetMagnificationMatrices(const unsigned int i) const
292 {
293 return this->m_MagnificationMatrices[i];
294 }
295
297 const std::vector<double> &
299 {
300 return this->m_CollimationUInf;
301 }
302 const std::vector<double> &
304 {
305 return this->m_CollimationUSup;
306 }
307 const std::vector<double> &
309 {
310 return this->m_CollimationVInf;
311 }
312 const std::vector<double> &
314 {
315 return this->m_CollimationVSup;
316 }
317
320 void
321 SetCollimationOfLastProjection(double uinf, double usup, double vinf, double vsup);
322
326 GetSourcePosition(unsigned int i) const;
327
335
343
345 static double
347
349 static double
351
353 static double
355
360 double
361 ToUntiltedCoordinateAtIsocenter(unsigned int noProj, double tiltedCoord) const;
362
365 itkGetConstMacro(RadiusCylindricalDetector, double);
366 itkSetMacro(RadiusCylindricalDetector, double);
367
369 itkGetConstMacro(VerifyAnglesTolerance, double);
370 itkSetMacro(VerifyAnglesTolerance, double);
371
372 itkGetConstMacro(FixAnglesTolerance, double);
373 itkSetMacro(FixAnglesTolerance, double);
374
375protected:
378
379 virtual void
385 virtual void
387 {
388 this->m_RotationMatrices.push_back(m);
389 this->Modified();
390 }
391 virtual void
393 {
394 this->m_SourceTranslationMatrices.push_back(m);
395 this->Modified();
396 }
397 virtual void
399 {
400 this->m_MagnificationMatrices.push_back(m);
401 this->Modified();
402 }
403
420 bool
421 VerifyAngles(double outOfPlaneAngleRAD,
422 double gantryAngleRAD,
423 double inPlaneAngleRAD,
424 const Matrix3x3Type & referenceMatrix) const;
425
444 bool
445 FixAngles(double & outOfPlaneAngleRAD,
446 double & gantryAngleRAD,
447 double & inPlaneAngleRAD,
448 const Matrix3x3Type & referenceMatrix) const;
449
452 InternalClone() const override;
453
456 std::vector<double> m_GantryAngles;
457 std::vector<double> m_OutOfPlaneAngles;
458 std::vector<double> m_InPlaneAngles;
459 std::vector<double> m_SourceAngles;
460 std::vector<double> m_SourceToIsocenterDistances;
461 std::vector<double> m_SourceOffsetsX;
462 std::vector<double> m_SourceOffsetsY;
463 std::vector<double> m_SourceToDetectorDistances;
464 std::vector<double> m_ProjectionOffsetsX;
465 std::vector<double> m_ProjectionOffsetsY;
466
469
477 std::vector<double> m_CollimationUInf;
478 std::vector<double> m_CollimationUSup;
479 std::vector<double> m_CollimationVInf;
480 std::vector<double> m_CollimationVSup;
481
483 std::vector<TwoDHomogeneousMatrixType> m_ProjectionTranslationMatrices;
484 std::vector<Superclass::MatrixType> m_MagnificationMatrices;
485 std::vector<ThreeDHomogeneousMatrixType> m_RotationMatrices;
486 std::vector<ThreeDHomogeneousMatrixType> m_SourceTranslationMatrices;
487
490 double m_FixAnglesTolerance{ 1e-6 };
491};
492} // namespace rtk
493
494
495#endif // __rtkThreeDCircularProjectionGeometry_h
SmartPointer< Self > Pointer
A templated class holding a M x N size Matrix.
Definition itkMatrix.h:71
virtual void Modified() const
A templated class holding a geometric point in n-Dimensional space.
Definition itkPoint.h:54
Implements transparent reference counting.
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
typename itk::Matrix< double, TDimension, TDimension+1 > MatrixType
bool FixAngles(double &outOfPlaneAngleRAD, double &gantryAngleRAD, double &inPlaneAngleRAD, const Matrix3x3Type &referenceMatrix) const
void SetCollimationOfLastProjection(double uinf, double usup, double vinf, double vsup)
static std::map< double, unsigned int > GetUniqueSortedAngles(const std::vector< double > &angles)
bool AddProjection(const PointType &sourcePosition, const PointType &detectorPosition, const VectorType &detectorRowVector, const VectorType &detectorColumnVector)
Add a REG23-based geometry set to the RTK projections list.
static double ConvertAngleBetweenMinusAndPlusPIRadians(double a)
const std::vector< double > & GetSourceOffsetsX() const
static Superclass::MatrixType ComputeProjectionMagnificationMatrix(double sdd, double sid)
static ThreeDHomogeneousMatrixType ComputeTranslationHomogeneousMatrix(double transX, double transY, double transZ)
void AddProjection(double sid, double sdd, double gantryAngle, double projOffsetX=0., double projOffsetY=0., double outOfPlaneAngle=0., double inPlaneAngle=0., double sourceOffsetX=0., double sourceOffsetY=0.)
const std::vector< double > & GetSourceToDetectorDistances() const
virtual void AddMagnificationMatrix(const Superclass::MatrixType &m)
const std::vector< double > & GetCollimationVInf() const
TwoDHomogeneousMatrixType GetProjectionTranslationMatrix(const unsigned int i) const
const std::vector< double > & GetCollimationUSup() const
double ToUntiltedCoordinateAtIsocenter(unsigned int noProj, double tiltedCoord) const
const std::vector< double > & GetInPlaneAngles() const
const std::vector< ThreeDHomogeneousMatrixType > & GetRotationMatrices() const
itk::LightObject::Pointer InternalClone() const override
const std::vector< double > & GetSourceOffsetsY() const
static ThreeDHomogeneousMatrixType ComputeRotationHomogeneousMatrix(double angleX, double angleY, double angleZ)
Superclass::MatrixType GetMagnificationMatrices(const unsigned int i) const
virtual void AddProjectionTranslationMatrix(const TwoDHomogeneousMatrixType &m)
const std::vector< TwoDHomogeneousMatrixType > & GetProjectionTranslationMatrices() const
virtual void AddRotationMatrix(const ThreeDHomogeneousMatrixType &m)
~ThreeDCircularProjectionGeometry() override=default
std::vector< ThreeDHomogeneousMatrixType > m_RotationMatrices
std::vector< ThreeDHomogeneousMatrixType > m_SourceTranslationMatrices
bool AddProjection(const HomogeneousProjectionMatrixType &pMat)
const std::vector< double > & GetCollimationUInf() const
HomogeneousVectorType GetSourcePosition(unsigned int i) const
static TwoDHomogeneousMatrixType ComputeTranslationHomogeneousMatrix(double transX, double transY)
std::vector< double > GetTiltAngles() const
ThreeDHomogeneousMatrixType GetRotationMatrix(const unsigned int i) const
const std::vector< double > & GetGantryAngles() const
static double ConvertAngleBetween0And360Degrees(double a)
const std::vector< double > & GetSourceAngles() const
static double ConvertAngleBetween0And2PIRadians(double a)
virtual void AddProjectionInRadians(double sid, double sdd, double gantryAngle, double projOffsetX=0., double projOffsetY=0., double outOfPlaneAngle=0., double inPlaneAngle=0., double sourceOffsetX=0., double sourceOffsetY=0.)
const std::vector< double > & GetProjectionOffsetsX() const
ThreeDHomogeneousMatrixType GetProjectionCoordinatesToFixedSystemMatrix(unsigned int i) const
const std::vector< double > & GetSourceToIsocenterDistances() const
const std::vector< ThreeDHomogeneousMatrixType > & GetSourceTranslationMatrices() const
static std::multimap< double, unsigned int > GetSortedAngles(const std::vector< double > &angles)
std::vector< Superclass::MatrixType > m_MagnificationMatrices
const std::vector< double > & GetProjectionOffsetsY() const
std::vector< TwoDHomogeneousMatrixType > m_ProjectionTranslationMatrices
ThreeDHomogeneousMatrixType GetSourceTranslationMatrices(const unsigned int i) const
virtual void AddSourceTranslationMatrix(const ThreeDHomogeneousMatrixType &m)
bool VerifyAngles(double outOfPlaneAngleRAD, double gantryAngleRAD, double inPlaneAngleRAD, const Matrix3x3Type &referenceMatrix) const
std::vector< double > GetAngularGapsWithNext(const std::vector< double > &angles) const
ThreeDHomogeneousMatrixType GetProjectionCoordinatesToDetectorSystemMatrix(unsigned int i) const
const std::vector< double > & GetOutOfPlaneAngles() const
std::vector< double > GetAngularGaps(const std::vector< double > &angles)
const std::vector< double > & GetCollimationVSup() const
const std::vector< Superclass::MatrixType > & GetMagnificationMatrices() const
#define itkSetMacro(name, type)