ITK  5.2.0
Insight Toolkit
itkScatterMatrixImageFunction.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 itkScatterMatrixImageFunction_h
19 #define itkScatterMatrixImageFunction_h
20 
21 #include "itkImageFunction.h"
22 #include "itkNumericTraits.h"
23 
24 namespace itk
25 {
44 template <typename TInputImage, typename TCoordRep = float>
45 class ITK_TEMPLATE_EXPORT ScatterMatrixImageFunction
46  : public ImageFunction<TInputImage,
47  vnl_matrix<typename NumericTraits<typename TInputImage::PixelType::ValueType>::RealType>,
48  TCoordRep>
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_MOVE(ScatterMatrixImageFunction);
52 
55  using Superclass =
56  ImageFunction<TInputImage,
57  vnl_matrix<typename NumericTraits<typename TInputImage::PixelType::ValueType>::RealType>,
58  TCoordRep>;
59 
62 
65 
67  itkNewMacro(Self);
68 
70  using InputImageType = TInputImage;
71 
73  using OutputType = typename Superclass::OutputType;
74 
76  using IndexType = typename Superclass::IndexType;
77 
79  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
80 
82  using PointType = typename Superclass::PointType;
83 
85  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
86 
88  using RealType = vnl_matrix<typename NumericTraits<typename InputImageType::PixelType::ValueType>::RealType>;
89 
91  RealType
92  EvaluateAtIndex(const IndexType & index) const override;
93 
95  RealType
96  Evaluate(const PointType & point) const override
97  {
98  IndexType index;
99 
100  this->ConvertPointToNearestIndex(point, index);
101  return this->EvaluateAtIndex(index);
102  }
103 
104  RealType
105  EvaluateAtContinuousIndex(const ContinuousIndexType & cindex) const override
106  {
107  IndexType index;
108 
109  this->ConvertContinuousIndexToNearestIndex(cindex, index);
110  return this->EvaluateAtIndex(index);
111  }
112 
115  itkSetMacro(NeighborhoodRadius, unsigned int);
116  itkGetConstReferenceMacro(NeighborhoodRadius, unsigned int);
118 
119 protected:
121  ~ScatterMatrixImageFunction() override = default;
122  void
123  PrintSelf(std::ostream & os, Indent indent) const override;
124 
125 private:
126  unsigned int m_NeighborhoodRadius;
127 };
128 } // end namespace itk
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 # include "itkScatterMatrixImageFunction.hxx"
132 #endif
133 
134 #endif
itk::ScatterMatrixImageFunction
Calculate the scatter matrix in the neighborhood of a pixel in a Vector image.
Definition: itkScatterMatrixImageFunction.h:45
itkImageFunction.h
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::ScatterMatrixImageFunction::RealType
vnl_matrix< typename NumericTraits< typename InputImageType::PixelType::ValueType >::RealType > RealType
Definition: itkScatterMatrixImageFunction.h:88
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ScatterMatrixImageFunction::OutputType
typename Superclass::OutputType OutputType
Definition: itkScatterMatrixImageFunction.h:73
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ScatterMatrixImageFunction::EvaluateAtContinuousIndex
RealType EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const override
Definition: itkScatterMatrixImageFunction.h:105
itk::ScatterMatrixImageFunction::ContinuousIndexType
typename Superclass::ContinuousIndexType ContinuousIndexType
Definition: itkScatterMatrixImageFunction.h:79
itk::ScatterMatrixImageFunction::Evaluate
RealType Evaluate(const PointType &point) const override
Definition: itkScatterMatrixImageFunction.h:96
itk::ImageFunction
Evaluates a function of an image at specified position.
Definition: itkImageFunction.h:55
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ScatterMatrixImageFunction::InputImageType
TInputImage InputImageType
Definition: itkScatterMatrixImageFunction.h:70
itk::ScatterMatrixImageFunction::PointType
typename Superclass::PointType PointType
Definition: itkScatterMatrixImageFunction.h:82
itk::ScatterMatrixImageFunction::IndexType
typename Superclass::IndexType IndexType
Definition: itkScatterMatrixImageFunction.h:76
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkNumericTraits.h
itk::ScatterMatrixImageFunction::m_NeighborhoodRadius
unsigned int m_NeighborhoodRadius
Definition: itkScatterMatrixImageFunction.h:126