ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkPhysicalCentralDifferenceImageFunction.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 itkPhysicalCentralDifferenceImageFunction_h
19#define itkPhysicalCentralDifferenceImageFunction_h
20
21#include "itkImageFunction.h"
22#include "itkCovariantVector.h"
23#include "itkImageBase.h"
25
26namespace itk
27{
28
42template <typename TInputImage, typename TCoordRep = float>
44 : public ImageFunction<TInputImage, CovariantVector<double, TInputImage::ImageDimension>, TCoordRep>
45{
46public:
47 ITK_DISALLOW_COPY_AND_MOVE(PhysicalCentralDifferenceImageFunction);
48
50 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
51
57
59 itkOverrideGetNameOfClassMacro(PhysicalCentralDifferenceImageFunction);
60
62 itkNewMacro(Self);
63
65 using InputImageType = TInputImage;
66
69
72
75
78
81
86 void
87 SetInputImage(const InputImageType * ptr) override
88 {
90 if (m_Interpolator.IsNotNull())
91 {
92 m_Interpolator->SetInputImage(ptr);
93 }
94 }
95
101 OutputType
102 EvaluateAtIndex(const IndexType & index) const override
103 {
104 PointType point;
105 m_Interpolator->GetInputImage()->TransformIndexToPhysicalPoint(index, point);
106 return this->Evaluate(point);
107 }
108
115 OutputType
116 EvaluateAtContinuousIndex(const ContinuousIndexType & cindex) const override
117 {
118 PointType point;
119 m_Interpolator->GetInputImage()->TransformContinuousIndexToPhysicalPoint(cindex, point);
120 return this->Evaluate(point);
121 }
122
129 OutputType
130 Evaluate(const PointType & point) const override;
131
132protected:
135 void
136 PrintSelf(std::ostream & os, Indent indent) const override;
137
138private:
140};
141
142} // end namespace itk
143
144#ifndef ITK_MANUAL_INSTANTIATION
145# include "itkPhysicalCentralDifferenceImageFunction.hxx"
146#endif
147
148#endif
virtual void SetInputImage(const InputImageType *ptr)
Control indentation during Print() invocation.
Definition itkIndent.h:53
Linearly interpolate an image at specified positions.
OutputType Evaluate(const PointType &point) const override
ImageFunction< TInputImage, CovariantVector< double, Self::ImageDimension >, TCoordRep > Superclass
void PrintSelf(std::ostream &os, Indent indent) const override
~PhysicalCentralDifferenceImageFunction() override=default
LinearInterpolateImageFunction< TInputImage, TCoordRep > InterpolateImageFunctionType
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const override
OutputType EvaluateAtIndex(const IndexType &index) const override
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....