ITK  6.0.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  * 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 #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 TCoordinate = double>
41 class ITK_TEMPLATE_EXPORT RayCastInterpolateImageFunction : public InterpolateImageFunction<TInputImage, TCoordinate>
42 {
43 public:
44  ITK_DISALLOW_COPY_AND_MOVE(RayCastInterpolateImageFunction);
45 
51 
53  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
54 
60 
64  using TransformParametersType = typename TransformType::ParametersType;
66 
67  using PixelType = typename Superclass::InputPixelType;
68 
69  using SizeType = typename TInputImage::SizeType;
70 
72 
75 
77 
79  itkOverrideGetNameOfClassMacro(RayCastInterpolateImageFunction);
80 
82  itkNewMacro(Self);
83 
85  using typename Superclass::OutputType;
86 
88  using typename Superclass::InputImageType;
89 
91  using typename Superclass::RealType;
92 
94  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
95 
97  using typename Superclass::PointType;
98 
100  using typename Superclass::IndexType;
101 
103  using 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);
140  itkSetObjectMacro(Interpolator, InterpolatorType);
141 
143  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
144 
146  itkSetMacro(FocalPoint, InputPointType);
147  itkGetConstMacro(FocalPoint, InputPointType);
151  itkSetMacro(Threshold, double);
152  itkGetConstMacro(Threshold, double);
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 
194  TransformPointer m_Transform{};
195  InputPointType m_FocalPoint{};
196  double m_Threshold{};
197  InterpolatorPointer m_Interpolator{};
198 
199 private:
200  class RayCastHelper;
201 };
202 } // namespace itk
203 
204 
212 {
213 public:
224  enum class TraversalDirection : uint8_t
225  {
226  UNDEFINED_DIRECTION = 0,
231  };
232 };
233 
234 #ifndef ITK_MANUAL_INSTANTIATION
235 # include "itkRayCastInterpolateImageFunction.hxx"
236 #endif
237 
238 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::RayCastInterpolateImageFunction::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkRayCastInterpolateImageFunction.h:61
itk::RayCastInterpolateImageFunction::InterpolatorPointer
typename InterpolatorType::Pointer InterpolatorPointer
Definition: itkRayCastInterpolateImageFunction.h:76
RayCastHelperEnums
Contains all enum classes used by RayCastHelper class.
Definition: itkRayCastInterpolateImageFunction.h:211
itk::RayCastInterpolateImageFunction
Projective interpolation of an image at specified positions.
Definition: itkRayCastInterpolateImageFunction.h:41
itk::RayCastInterpolateImageFunction::InputPointType
typename TransformType::InputPointType InputPointType
Definition: itkRayCastInterpolateImageFunction.h:62
itk::ImageFunction< TInputImage, NumericTraits< TInputImage::PixelType >::RealType, TCoordinate >::InputImageType
TInputImage InputImageType
Definition: itkImageFunction.h:75
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::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::FunctionBase< Point< TCoordinate, TInputImage::ImageDimension >, NumericTraits< TInputImage::PixelType >::RealType >::OutputType
NumericTraits< TInputImage::PixelType >::RealType OutputType
Definition: itkFunctionBase.h:62
itk::RayCastInterpolateImageFunction::GetRadius
SizeType GetRadius() const override
Definition: itkRayCastInterpolateImageFunction.h:177
RayCastHelperEnums::TraversalDirection::UNDEFINED_DIRECTION
Undefined.
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::point
*par Constraints *The filter requires an image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
itk::InterpolateImageFunction::SizeType
typename InputImageType::SizeType SizeType
Definition: itkInterpolateImageFunction.h:79
itk::RayCastInterpolateImageFunction::TransformJacobianType
typename TransformType::JacobianType TransformJacobianType
Definition: itkRayCastInterpolateImageFunction.h:65
itk::RayCastInterpolateImageFunction::OutputPointType
typename TransformType::OutputPointType OutputPointType
Definition: itkRayCastInterpolateImageFunction.h:63
RayCastHelperEnums::TraversalDirection::LAST_DIRECTION
itk::RayCastInterpolateImageFunction::IsInsideBuffer
bool IsInsideBuffer(const ContinuousIndexType &) const override
Definition: itkRayCastInterpolateImageFunction.h:165
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::RayCastInterpolateImageFunction::TransformParametersType
typename TransformType::ParametersType TransformParametersType
Definition: itkRayCastInterpolateImageFunction.h:64
itk::RayCastInterpolateImageFunction::PixelType
typename Superclass::InputPixelType PixelType
Definition: itkRayCastInterpolateImageFunction.h:67
itk::ContinuousIndex< TCoordinate, Self::ImageDimension >
itkNumericTraits.h
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
RayCastHelperEnums::TraversalDirection::TRANSVERSE_IN_Y
y
itk::RayCastInterpolateImageFunction::IsInsideBuffer
bool IsInsideBuffer(const PointType &) const override
Definition: itkRayCastInterpolateImageFunction.h:159
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
itkTransform.h
itkInterpolateImageFunction.h
itk::Array2D
Array2D class representing a 2D array.
Definition: itkArray2D.h:42
RayCastHelperEnums::TraversalDirection::TRANSVERSE_IN_Z
z
RayCastHelperEnums::TraversalDirection::TRANSVERSE_IN_X
x
TraversalDirection
itk::InterpolateImageFunction
Base class for all image interpolators.
Definition: itkInterpolateImageFunction.h:45
itk::ImageFunction< TInputImage, NumericTraits< TInputImage::PixelType >::RealType, TCoordinate >::IndexType
typename InputImageType::IndexType IndexType
Definition: itkImageFunction.h:94
itk::RayCastInterpolateImageFunction::IsInsideBuffer
bool IsInsideBuffer(const IndexType &) const override
Definition: itkRayCastInterpolateImageFunction.h:171