ITK  5.2.0
Insight Toolkit
itkRayCastInterpolateImageFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 #ifndef itkRayCastInterpolateImageFunction_h
19 #define itkRayCastInterpolateImageFunction_h
20 
22 #include "itkTransform.h"
23 #include "itkNumericTraits.h"
24 
25 namespace itk
26 {
40 template <typename TInputImage, typename TCoordRep = double>
41 class ITK_TEMPLATE_EXPORT RayCastInterpolateImageFunction : public InterpolateImageFunction<TInputImage, TCoordRep>
42 {
43 public:
44  ITK_DISALLOW_COPY_AND_MOVE(RayCastInterpolateImageFunction);
45 
51 
53  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
54 
60 
66 
67  using PixelType = typename Superclass::InputPixelType;
68 
69  using SizeType = typename TInputImage::SizeType;
70 
72 
75 
77 
80 
82  itkNewMacro(Self);
83 
85  using OutputType = typename Superclass::OutputType;
86 
88  using InputImageType = typename Superclass::InputImageType;
89 
91  using RealType = typename Superclass::RealType;
92 
94  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
95 
97  using PointType = typename Superclass::PointType;
98 
101 
103  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
104 
115  OutputType
116  Evaluate(const PointType & point) const override;
117 
129  OutputType
130  EvaluateAtContinuousIndex(const ContinuousIndexType & index) const override;
131 
135  itkSetObjectMacro(Transform, TransformType);
136  itkGetModifiableObjectMacro(Transform, TransformType);
138 
140  itkSetObjectMacro(Interpolator, InterpolatorType);
141 
143  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
144 
146  itkSetMacro(FocalPoint, InputPointType);
147  itkGetConstMacro(FocalPoint, InputPointType);
149 
151  itkSetMacro(Threshold, double);
152  itkGetConstMacro(Threshold, double);
154 
158  bool
159  IsInsideBuffer(const PointType &) const override
160  {
161  return true;
162  }
163 
164  bool
165  IsInsideBuffer(const ContinuousIndexType &) const override
166  {
167  return true;
168  }
169 
170  bool
171  IsInsideBuffer(const IndexType &) const override
172  {
173  return true;
174  }
175 
176  SizeType
177  GetRadius() const override
178  {
179  const InputImageType * input = this->GetInputImage();
180  if (!input)
181  {
182  itkExceptionMacro("Input image required!");
183  }
184  return input->GetLargestPossibleRegion().GetSize();
185  }
186 
187 protected:
189  ~RayCastInterpolateImageFunction() override = default;
190 
191  void
192  PrintSelf(std::ostream & os, Indent indent) const override;
193 
196  double m_Threshold;
198 };
199 } // namespace itk
200 
201 #ifndef ITK_MANUAL_INSTANTIATION
202 # include "itkRayCastInterpolateImageFunction.hxx"
203 #endif
204 
205 #endif
itk::RayCastInterpolateImageFunction::InputPointType
typename TransformType::InputPointType InputPointType
Definition: itkRayCastInterpolateImageFunction.h:62
itk::InterpolateImageFunction::SizeType
typename InputImageType::SizeType SizeType
Definition: itkInterpolateImageFunction.h:79
itk::RayCastInterpolateImageFunction::PixelType
typename Superclass::InputPixelType PixelType
Definition: itkRayCastInterpolateImageFunction.h:67
itk::RayCastInterpolateImageFunction
Projective interpolation of an image at specified positions.
Definition: itkRayCastInterpolateImageFunction.h:41
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::InterpolateImageFunction::PointType
typename Superclass::PointType PointType
Definition: itkInterpolateImageFunction.h:72
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::RayCastInterpolateImageFunction::m_FocalPoint
InputPointType m_FocalPoint
Definition: itkRayCastInterpolateImageFunction.h:195
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::RayCastInterpolateImageFunction::IsInsideBuffer
bool IsInsideBuffer(const PointType &) const override
Definition: itkRayCastInterpolateImageFunction.h:159
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::RayCastInterpolateImageFunction::m_Threshold
double m_Threshold
Definition: itkRayCastInterpolateImageFunction.h:196
itk::RayCastInterpolateImageFunction::InterpolatorPointer
typename InterpolatorType::Pointer InterpolatorPointer
Definition: itkRayCastInterpolateImageFunction.h:76
itk::RayCastInterpolateImageFunction::IsInsideBuffer
bool IsInsideBuffer(const ContinuousIndexType &) const override
Definition: itkRayCastInterpolateImageFunction.h:165
itk::InterpolateImageFunction::ContinuousIndexType
typename Superclass::ContinuousIndexType ContinuousIndexType
Definition: itkInterpolateImageFunction.h:82
itk::RayCastInterpolateImageFunction::TransformJacobianType
typename TransformType::JacobianType TransformJacobianType
Definition: itkRayCastInterpolateImageFunction.h:65
itk::InterpolateImageFunction::InputImageType
typename Superclass::InputImageType InputImageType
Definition: itkInterpolateImageFunction.h:66
itk::RayCastInterpolateImageFunction::m_Interpolator
InterpolatorPointer m_Interpolator
Definition: itkRayCastInterpolateImageFunction.h:197
itk::InterpolateImageFunction::OutputType
typename Superclass::OutputType OutputType
Definition: itkInterpolateImageFunction.h:63
itk::RayCastInterpolateImageFunction::IsInsideBuffer
bool IsInsideBuffer(const IndexType &) const override
Definition: itkRayCastInterpolateImageFunction.h:171
itk::Transform::ParametersType
typename Superclass::ParametersType ParametersType
Definition: itkTransform.h:121
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::RayCastInterpolateImageFunction::OutputPointType
typename TransformType::OutputPointType OutputPointType
Definition: itkRayCastInterpolateImageFunction.h:63
itkNumericTraits.h
itk::RayCastInterpolateImageFunction::m_Transform
TransformPointer m_Transform
Definition: itkRayCastInterpolateImageFunction.h:194
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
itk::RayCastInterpolateImageFunction::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkRayCastInterpolateImageFunction.h:61
itkTransform.h
itkInterpolateImageFunction.h
itk::Array2D
Array2D class representing a 2D array with size defined at construction time.
Definition: itkArray2D.h:45
itk::RayCastInterpolateImageFunction::GetRadius
SizeType GetRadius() const override
Definition: itkRayCastInterpolateImageFunction.h:177
itk::InterpolateImageFunction
Base class for all image interpolators.
Definition: itkInterpolateImageFunction.h:45
itk::InterpolateImageFunction::IndexType
typename Superclass::IndexType IndexType
Definition: itkInterpolateImageFunction.h:75
itk::RayCastInterpolateImageFunction::TransformParametersType
typename TransformType::ParametersType TransformParametersType
Definition: itkRayCastInterpolateImageFunction.h:64
itk::InterpolateImageFunction::RealType
typename NumericTraits< typename TInputImage::PixelType >::RealType RealType
Definition: itkInterpolateImageFunction.h:85