ITK  5.2.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  * 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 itkVectorNearestNeighborInterpolateImageFunction_h
19 #define itkVectorNearestNeighborInterpolateImageFunction_h
20 
22 
23 namespace itk
24 {
42 template <typename TInputImage, typename TCoordRep = double>
44 {
45 public:
46  ITK_DISALLOW_COPY_AND_MOVE(VectorNearestNeighborInterpolateImageFunction);
47 
53 
55  itkNewMacro(Self);
56 
59 
62  using PixelType = typename Superclass::PixelType;
63  using ValueType = typename Superclass::ValueType;
64  using RealType = typename Superclass::RealType;
65 
67  static constexpr unsigned int Dimension = Superclass::Dimension;
68 
70  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
71 
73  using IndexType = typename Superclass::IndexType;
74 
77 
80 
90  EvaluateAtContinuousIndex(const ContinuousIndexType & index) const override
91  {
92  IndexType nindex;
93 
94  this->ConvertContinuousIndexToNearestIndex(index, nindex);
95  return static_cast<OutputType>(this->GetInputImage()->GetPixel(nindex));
96  }
97 
98 protected:
101  void
102  PrintSelf(std::ostream & os, Indent indent) const override
103  {
104  Superclass::PrintSelf(os, indent);
105  }
106 };
107 } // end namespace itk
108 
109 #endif
itk::VectorInterpolateImageFunction::IndexType
typename Superclass::IndexType IndexType
Definition: itkVectorInterpolateImageFunction.h:80
itk::VectorNearestNeighborInterpolateImageFunction::~VectorNearestNeighborInterpolateImageFunction
~VectorNearestNeighborInterpolateImageFunction() override=default
itk::VectorInterpolateImageFunction::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkVectorInterpolateImageFunction.h:143
itk::VectorInterpolateImageFunction::Dimension
static constexpr unsigned int Dimension
Definition: itkVectorInterpolateImageFunction.h:54
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::VectorInterpolateImageFunction
Base class for all vector image interpolators.
Definition: itkVectorInterpolateImageFunction.h:47
itk::ImageFunction< TInputImage, NumericTraits< TInputImage::PixelType >::RealType, TCoordRep >::ConvertContinuousIndexToNearestIndex
void ConvertContinuousIndexToNearestIndex(const ContinuousIndexType &cindex, IndexType &index) const
Definition: itkImageFunction.h:205
itk::VectorInterpolateImageFunction::PixelType
typename InputImageType::PixelType PixelType
Definition: itkVectorInterpolateImageFunction.h:72
itk::VectorInterpolateImageFunction::ContinuousIndexType
typename Superclass::ContinuousIndexType ContinuousIndexType
Definition: itkVectorInterpolateImageFunction.h:83
itk::VectorInterpolateImageFunction::InputImageType
typename Superclass::InputImageType InputImageType
Definition: itkVectorInterpolateImageFunction.h:71
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::VectorInterpolateImageFunction::OutputType
typename Superclass::OutputType OutputType
Definition: itkVectorInterpolateImageFunction.h:86
itk::VectorNearestNeighborInterpolateImageFunction::EvaluateAtContinuousIndex
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
Definition: itkVectorNearestNeighborInterpolateImageFunction.h:90
itkVectorInterpolateImageFunction.h
itk::VectorNearestNeighborInterpolateImageFunction::Dimension
static constexpr unsigned int Dimension
Definition: itkVectorNearestNeighborInterpolateImageFunction.h:67
itk::VectorInterpolateImageFunction::RealType
typename NumericTraits< ValueType >::RealType RealType
Definition: itkVectorInterpolateImageFunction.h:74
itk::VectorNearestNeighborInterpolateImageFunction
Nearest neighbor interpolate a vector image at specified positions.
Definition: itkVectorNearestNeighborInterpolateImageFunction.h:43
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::VectorNearestNeighborInterpolateImageFunction::ImageDimension
static constexpr unsigned int ImageDimension
Definition: itkVectorNearestNeighborInterpolateImageFunction.h:70
itk::VectorNearestNeighborInterpolateImageFunction::VectorNearestNeighborInterpolateImageFunction
VectorNearestNeighborInterpolateImageFunction()=default
itk::VectorNearestNeighborInterpolateImageFunction::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkVectorNearestNeighborInterpolateImageFunction.h:102
itk::VectorInterpolateImageFunction::ValueType
typename PixelType::ValueType ValueType
Definition: itkVectorInterpolateImageFunction.h:73
itk::ImageFunction< TInputImage, NumericTraits< TInputImage::PixelType >::RealType, TCoordRep >::GetInputImage
const InputImageType * GetInputImage() const
Definition: itkImageFunction.h:108
itk::VectorInterpolateImageFunction::ImageDimension
static constexpr unsigned int ImageDimension
Definition: itkVectorInterpolateImageFunction.h:57