ITK  6.0.0
Insight Toolkit
itkVectorNearestNeighborInterpolateImageFunction.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 itkVectorNearestNeighborInterpolateImageFunction_h
19#define itkVectorNearestNeighborInterpolateImageFunction_h
20
22
23namespace itk
24{
42template <typename TInputImage, typename TCoordRep = double>
44 : public VectorInterpolateImageFunction<TInputImage, TCoordRep>
45{
46public:
47 ITK_DISALLOW_COPY_AND_MOVE(VectorNearestNeighborInterpolateImageFunction);
48
54
56 itkNewMacro(Self);
57
59 itkOverrideGetNameOfClassMacro(VectorNearestNeighborInterpolateImageFunction);
60
62 using typename Superclass::InputImageType;
63 using typename Superclass::PixelType;
64 using typename Superclass::ValueType;
65 using typename Superclass::RealType;
66
68 static constexpr unsigned int Dimension = Superclass::Dimension;
69
71 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
72
74 using typename Superclass::IndexType;
75
77 using typename Superclass::ContinuousIndexType;
78
80 using typename Superclass::OutputType;
81
91 EvaluateAtContinuousIndex(const ContinuousIndexType & index) const override
92 {
93 IndexType nindex;
94
95 this->ConvertContinuousIndexToNearestIndex(index, nindex);
96 return static_cast<OutputType>(this->GetInputImage()->GetPixel(nindex));
97 }
98
99protected:
102};
103} // end namespace itk
104
105#endif
Light weight base class for most itk classes.
Base class for all vector image interpolators.
Nearest neighbor interpolate a vector image at specified positions.
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....