RTK  2.5.0
Reconstruction Toolkit
rtkProjectionGeometry.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 rtkProjectionGeometry_h
20 #define rtkProjectionGeometry_h
21 
22 #include <itkImageBase.h>
23 
24 #include <vector>
25 
26 #include "rtkMacro.h"
27 
28 namespace rtk
29 {
30 
43 template <unsigned int TDimension = 3>
44 class ITK_TEMPLATE_EXPORT ProjectionGeometry : public itk::DataObject
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_MOVE(ProjectionGeometry);
48 
53 
55  itkNewMacro(Self);
56 
61 
63 
70  const std::vector<MatrixType> &
71  GetMatrices() const
72  {
73  return this->m_Matrices;
74  }
75 
77  MatrixType
78  GetMatrix(const unsigned int i) const
79  {
80  if (i >= this->m_Matrices.size())
81  {
82  itkExceptionMacro(<< "Requested matrix index " << i << " is out of bound.");
83  }
84  return this->m_Matrices[i];
85  }
87 
89  virtual void
90  Clear();
91 
92 protected:
93  ProjectionGeometry() = default;
94  ~ProjectionGeometry() override = default;
95 
96  void
97  PrintSelf(std::ostream & os, itk::Indent indent) const override;
98 
100  virtual void
102  {
103  this->m_Matrices.push_back(m);
104  this->Modified();
105  }
107 
108 private:
110  std::vector<MatrixType> m_Matrices;
111 };
112 } // namespace rtk
113 
114 #include "rtkProjectionGeometry.hxx"
115 
116 #endif // rtkProjectionGeometry_h
typename itk::Matrix< double, TDimension, TDimension+1 > MatrixType
typename itk::ImageBase< TDimension >::PointType PointType
class ITK_FORWARD_EXPORT DataObject
typename itk::ImageBase< TDimension >::SpacingType SpacingType
const std::vector< MatrixType > & GetMatrices() const
A templated class holding a vector of M x (M+1) matrices.
std::vector< MatrixType > m_Matrices
typename itk::ImageBase< TDimension >::SizeType SizeType
MatrixType GetMatrix(const unsigned int i) const
virtual void AddMatrix(const MatrixType &m)