RTK  1.4.0
Reconstruction Toolkit
rtkProjectionsRegionConstIteratorRayBased.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  * http://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 rtkProjectionsRegionConstIteratorRayBased_h
20 #define rtkProjectionsRegionConstIteratorRayBased_h
21 
23 
25 
26 namespace rtk
27 {
46 template< typename TImage >
48 template< typename TImage >
50 template< typename TImage >
52 
53 template< typename TImage >
55  public itk::ImageConstIteratorWithIndex< TImage >
56 {
57 public:
61 
68  typedef typename Superclass::OffsetValueType OffsetValueType;
69  typedef typename Superclass::RegionType RegionType;
71  typedef typename Superclass::IndexValueType IndexValueType;
72 
75 
82  const RegionType & region,
83  const ThreeDCircularProjectionGeometry *geometry,
84  const MatrixType &postMat);
85 
86  static Self *
87  New(const TImage *ptr,
88  const RegionType & region,
89  const ThreeDCircularProjectionGeometry *geometry,
90  const MatrixType &postMat);
91 
92  static Self *
93  New(const TImage *ptr,
94  const RegionType & region,
95  const ThreeDCircularProjectionGeometry *geometry,
96  const HomogeneousMatrixType &postMat);
97 
98  static Self *
99  New(const TImage *ptr,
100  const RegionType & region,
101  const ThreeDCircularProjectionGeometry *geometry);
102 
110  Self & operator++();
111 
116  void Next() {++*this;}
117 
122  const PointType &GetSourcePosition()
123  {
124  return this->m_SourcePosition;
125  }
126  const PointType &GetPixelPosition()
127  {
128  return this->m_PixelPosition;
129  }
130  const PointType &GetSourceToPixel()
131  {
132  return this->m_SourceToPixel;
133  }
135 
138  const PointType GetDirection()
139  {
140  return m_SourceToPixel / m_SourceToPixel.GetNorm();
141  }
142 
143 protected:
145  virtual void NewProjection() = 0;
146 
149  virtual void NewPixel() = 0;
150 
153  PointType m_SourcePosition;
154  PointType m_PixelPosition;
155  PointType m_SourceToPixel;
156 };
157 } // end namespace itk
158 
159 #ifndef ITK_MANUAL_INSTANTIATION
160 #include "rtkProjectionsRegionConstIteratorRayBased.hxx"
161 #endif
162 
163 #endif
static Self * New(const TImage *ptr, const RegionType &region, const ThreeDCircularProjectionGeometry *geometry, const MatrixType &postMat)
Projection geometry for a source and a 2-D flat panel.
ProjectionsRegionConstIteratorRayBased(const TImage *ptr, const RegionType &region, const ThreeDCircularProjectionGeometry *geometry, const MatrixType &postMat)
Implements a ray-based iterator for a point source and a flat panel.
Implements a ray-based iterator for a parallel beam and a flat panel.
Implements a ray-based iterator for a point source and a cylindrical panel.
ThreeDCircularProjectionGeometry::ConstPointer m_Geometry
Iterate over a projection stack with corresponding ray information.