ITK  6.0.0
Insight Toolkit
itkNeighborhoodOperatorImageFunction.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 itkNeighborhoodOperatorImageFunction_h
19 #define itkNeighborhoodOperatorImageFunction_h
20 
21 #include "itkImageFunction.h"
22 #include "itkNeighborhood.h"
23 
24 namespace itk
25 {
40 template <typename TInputImage, typename TOutput>
41 class ITK_TEMPLATE_EXPORT NeighborhoodOperatorImageFunction : public ImageFunction<TInputImage, TOutput>
42 {
43 public:
44 
47 
50 
54 
56  itkNewMacro(Self);
57 
59  using InputImageType = TInputImage;
60  using InputPixelType = typename InputImageType::PixelType;
61  using typename Superclass::IndexType;
62  using typename Superclass::ContinuousIndexType;
63 
65  itkOverrideGetNameOfClassMacro(NeighborhoodOperatorImageFunction);
66 
68  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
69 
71 
73  using typename Superclass::PointType;
74 
76  // virtual void SetInputImage( InputImageType * ptr );
77 
81  void
82  SetOperator(const NeighborhoodType & p) const
83  {
84  m_Operator = p;
85  this->Modified();
86  }
91  TOutput
92  Evaluate(const PointType &) const override
93  {
94  std::cout << "NeighborhoodOperatorImageFunction::Evaluate(): Not implemented!" << std::endl;
95  TOutput out = 0;
96  return out;
97  }
101  TOutput
102  EvaluateAtIndex(const IndexType & index) const override;
103 
106  TOutput
108  {
109  std::cout << "NeighborhoodOperatorImageFunction::EvaluateAtContinuousIndex():Not implemented!" << std::endl;
110  TOutput out = 0;
111  return out;
112  }
115 protected:
118 
119  ~NeighborhoodOperatorImageFunction() override = default;
120 
121  void
122  operator=(const Self &)
123  {}
124  void
125  PrintSelf(std::ostream & os, Indent indent) const override;
126 
127 private:
128  mutable NeighborhoodType m_Operator{};
129 };
130 } // end namespace itk
131 
132 #ifndef ITK_MANUAL_INSTANTIATION
133 # include "itkNeighborhoodOperatorImageFunction.hxx"
134 #endif
135 
136 /*
137 #ifndef ITK_MANUAL_INSTANTIATION
138 #include "itkNeighborhoodOperatorImageFunction.hxx"
139 #endif
140 */
141 
142 #endif
itk::NeighborhoodOperatorImageFunction::Evaluate
TOutput Evaluate(const PointType &) const override
Definition: itkNeighborhoodOperatorImageFunction.h:92
itkImageFunction.h
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::Neighborhood< TOutput, Self::ImageDimension >
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::NeighborhoodOperatorImageFunction::EvaluateAtContinuousIndex
TOutput EvaluateAtContinuousIndex(const ContinuousIndexType &) const override
Definition: itkNeighborhoodOperatorImageFunction.h:107
itkNeighborhood.h
itk::NeighborhoodOperatorImageFunction::InputImageType
TInputImage InputImageType
Definition: itkNeighborhoodOperatorImageFunction.h:59
itk::NeighborhoodOperatorImageFunction::SetOperator
void SetOperator(const NeighborhoodType &p) const
Definition: itkNeighborhoodOperatorImageFunction.h:82
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
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:55
itk::NeighborhoodOperatorImageFunction
Compute the convolution of a neighborhood operator with the image at a specific location in space,...
Definition: itkNeighborhoodOperatorImageFunction.h:41
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::NeighborhoodOperatorImageFunction::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkNeighborhoodOperatorImageFunction.h:60
itk::ContinuousIndex< float, Self::ImageDimension >
itk::NeighborhoodOperatorImageFunction::operator=
void operator=(const Self &)
Definition: itkNeighborhoodOperatorImageFunction.h:122
itk::NeighborhoodOperatorImageFunction::NeighborhoodOperatorImageFunction
NeighborhoodOperatorImageFunction(const Self &)
Definition: itkNeighborhoodOperatorImageFunction.h:117
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53