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
25namespace itk
26{
40template <typename TInputImage, typename TCoordRep = double>
41class ITK_TEMPLATE_EXPORT RayCastInterpolateImageFunction : public InterpolateImageFunction<TInputImage, TCoordRep>
42{
43public:
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
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
116 Evaluate(const PointType & point) const override;
117
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
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
187protected:
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
199private:
200 class RayCastHelper;
201};
202} // namespace itk
203
204
212{
213public:
224 enum class TraversalDirection : uint8_t
225 {
226 UNDEFINED_DIRECTION = 0,
227 TRANSVERSE_IN_X,
228 TRANSVERSE_IN_Y,
229 TRANSVERSE_IN_Z,
230 LAST_DIRECTION
231 };
232};
233
234#ifndef ITK_MANUAL_INSTANTIATION
235# include "itkRayCastInterpolateImageFunction.hxx"
236#endif
237
238#endif
Contains all enum classes used by RayCastHelper class.
Array2D class representing a 2D array.
Definition: itkArray2D.h:43
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Base class for all image interpolators.
Light weight base class for most itk classes.
Class to hold and manage different parameter types used during optimization.
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:54
Projective interpolation of an image at specified positions.
typename TransformType::ParametersType TransformParametersType
typename TransformType::JacobianType TransformJacobianType
~RayCastInterpolateImageFunction() override=default
typename InterpolatorType::Pointer InterpolatorPointer
bool IsInsideBuffer(const ContinuousIndexType &) const override
bool IsInsideBuffer(const PointType &) const override
OutputType Evaluate(const PointType &point) const override
Interpolate the image at a point position.
typename TransformType::InputPointType InputPointType
typename TransformType::OutputPointType OutputPointType
void PrintSelf(std::ostream &os, Indent indent) const override
bool IsInsideBuffer(const IndexType &) const override
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:84
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:63
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter 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