ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkExtrapolateImageFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkExtrapolateImageFunction_h
19 #define itkExtrapolateImageFunction_h
20 
21 #include "itkImageFunction.h"
22 
23 namespace itk
24 {
42 template< typename TInputImage, typename TCoordRep = float >
44  public ImageFunction< TInputImage,
45  typename NumericTraits< typename TInputImage::PixelType >::RealType, TCoordRep >
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_ASSIGN(ExtrapolateImageFunction);
49 
52  using Superclass = ImageFunction< TInputImage,
54  TCoordRep >;
57 
60 
63 
66 
68  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
69 
71  using PointType = typename Superclass::PointType;
72 
74  using IndexType = typename Superclass::IndexType;
75 
78 
81 
87  OutputType Evaluate(const PointType & point) const override
88  {
89  ContinuousIndexType index;
90 
91  this->GetInputImage()->TransformPhysicalPointToContinuousIndex(point, index);
92  return ( this->EvaluateAtContinuousIndex(index) );
93  }
94 
101  const ContinuousIndexType & index) const override = 0;
102 
109  const IndexType & index) const override = 0;
110 
111 protected:
112  ExtrapolateImageFunction()= default;
113  ~ExtrapolateImageFunction() override = default;
114  void PrintSelf(std::ostream & os, Indent indent) const override
115  { Superclass::PrintSelf(os, indent); }
116 };
117 } // end namespace itk
118 
119 #endif
OutputType EvaluateAtIndex(const IndexType &index) const override=0
typename NumericTraits< typename TInputImage::PixelType >::RealType RealType
typename Superclass::IndexType IndexType
Light weight base class for most itk classes.
typename Superclass::OutputType OutputType
typename Superclass::InputImageType InputImageType
ContinuousIndex< TCoordRep, Self::ImageDimension > ContinuousIndexType
Define numeric traits for std::vector.
static constexpr unsigned int ImageDimension
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override=0
~ExtrapolateImageFunction() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
void PrintSelf(std::ostream &os, Indent indent) const override
TInputImage InputImageType
typename Superclass::ContinuousIndexType ContinuousIndexType
Point< TCoordRep, Self::ImageDimension > PointType
Base class for all image extrapolaters.
typename Superclass::PointType PointType
typename InputImageType::IndexType IndexType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
OutputType Evaluate(const PointType &point) const override
Evaluates a function of an image at specified position.
static constexpr unsigned int ImageDimension