ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkSiddonJacobsRayCastInterpolateImageFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software 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 Calculate DRR from a CT dataset using incremental ray-tracing algorithm
20 The algorithm was initially proposed by Robert Siddon and improved by
21 Filip Jacobs etc.
22 
23 -------------------------------------------------------------------------
24 References:
25 
26 R. L. Siddon, "Fast calculation of the exact radiological path for a
27 threedimensional CT array," Medical Physics 12, 252-55 (1985).
28 
29 F. Jacobs, E. Sundermann, B. De Sutter, M. Christiaens, and I. Lemahieu,
30 "A fast algorithm to calculate the exact radiological path through a pixel
31 or voxel space," Journal of Computing and Information Technology ?
32 CIT 6, 89-94 (1998).
33 
34 =========================================================================*/
35 #ifndef itkSiddonJacobsRayCastInterpolateImageFunction_h
36 #define itkSiddonJacobsRayCastInterpolateImageFunction_h
37 
39 #include "itkTransform.h"
40 #include "itkVector.h"
41 #include "itkEuler3DTransform.h"
42 
43 namespace itk
44 {
45 
56 template <typename TInputImage, typename TCoordRep = float >
58  public InterpolateImageFunction<TInputImage,TCoordRep>
59 {
60 public:
61  ITK_DISALLOW_COPY_AND_ASSIGN(SiddonJacobsRayCastInterpolateImageFunction);
62 
68 
70  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
71 
72 
74 
80 
82 
83  using SizeType = typename TInputImage::SizeType;
84 
86 
89 
91 
92 
95 
97  itkNewMacro(Self);
98 
101 
104 
107 
109  using RealType = typename Superclass::RealType;
110 
112  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
113 
116 
119 
122 
123 
134  OutputType Evaluate( const PointType& point ) const override;
135 
148  const ContinuousIndexType &index ) const override;
149 
150  virtual void Initialize(void);
151 
153  itkSetObjectMacro( Transform, TransformType );
154 
156  itkGetConstObjectMacro( Transform, TransformType );
157 
159  itkSetMacro(FocalPointToIsocenterDistance, double);
160  itkGetMacro(FocalPointToIsocenterDistance, double);
162 
164  itkSetMacro(ProjectionAngle, double);
165  itkGetMacro(ProjectionAngle, double);
167 
169  itkSetMacro(Threshold, double);
170  itkGetMacro(Threshold, double);
172 
176  inline bool IsInsideBuffer( const PointType & ) const override
177  {
178  return true;
179  }
180  bool IsInsideBuffer( const ContinuousIndexType & ) const override
181  {
182  return true;
183  }
184  bool IsInsideBuffer( const IndexType & ) const override
185  {
186  return true;
187  }
189 
190 protected:
192 
194 
195  void PrintSelf(std::ostream& os, Indent indent) const override;
196 
198  TransformPointer m_Transform; // Displacement of the volume
199  // Overall inverse transform used to calculate the ray position in the input space
201 
202  // The threshold above which voxels along the ray path are integrated
203  double m_Threshold;
204  double m_FocalPointToIsocenterDistance; // Focal point to isocenter distance
205  double m_ProjectionAngle; // Linac gantry rotation angle in radians
206 
207 private:
208  void ComputeInverseTransform( void ) const;
209  TransformPointer m_GantryRotTransform; // Gantry rotation transform
210  TransformPointer m_CamShiftTransform; // Camera shift transform camRotTransform
211  TransformPointer m_CamRotTransform; // Camera rotation transform
212  TransformPointer m_ComposedTransform; // Composed transform
213  PointType m_SourcePoint; // Coordinate of the source in the standard Z projection geometry
214  PointType m_SourceWorld; // Coordinate of the source in the world coordinate system
215 };
216 
217 } // namespace itk
218 
219 #ifndef ITK_MANUAL_INSTANTIATION
220 #include "itkSiddonJacobsRayCastInterpolateImageFunction.hxx"
221 #endif
222 
223 #endif
Light weight base class for most itk classes.
void PrintSelf(std::ostream &os, Indent indent) const override
typename Superclass::JacobianType JacobianType
typename Superclass::ContinuousIndexType ContinuousIndexType
typename Superclass::OutputType OutputType
typename NumericTraits< typename TInputImage::PixelType >::RealType RealType
static constexpr unsigned int ImageDimension
typename Superclass::IndexType IndexType
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
SmartPointer< Self > Pointer
typename Superclass::OutputPointType OutputPointType
Projective interpolation of an image at specified positions.
typename Superclass::ParametersType ParametersType
Base class for all image interpolaters.
Euler3DTransform of a vector space (e.g. space coordinates)
typename Superclass::PointType PointType
typename Superclass::InputImageType InputImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
TransformPointer m_Transform
Transformation used to calculate the new focal point position.
OutputType Evaluate(const PointType &point) const override
Interpolate the image at a point position.
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
typename Superclass::InputPointType InputPointType