ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkNeighborhoodOperatorImageFunction.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 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:
42  public ImageFunction< TInputImage, TOutput >
43 {
44 public:
45 
48 
51 
55 
57  itkNewMacro(Self);
58 
60  using InputImageType = TInputImage;
61  using InputPixelType = typename InputImageType::PixelType;
62  using IndexType = typename Superclass::IndexType;
63  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
64 
67 
69  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
70 
72 
74  using PointType = typename Superclass::PointType;
75 
77  //virtual void SetInputImage( InputImageType * ptr );
78 
82  void SetOperator(const NeighborhoodType & p) const
83  {
84  m_Operator = p;
85  this->Modified();
86  }
88 
91  TOutput Evaluate(const PointType &) const override
92  {
93  std::cout << "NeighborhoodOperatorImageFunction::Evaluate(): Not implemented!" << std::endl;
94  TOutput out;
95  out = 0;
96  return out;
97  }
99 
101  TOutput EvaluateAtIndex(const IndexType & index) const override;
102 
106  const ContinuousIndexType &) const override
107  {
108  std::cout << "NeighborhoodOperatorImageFunction::EvaluateAtContinuousIndex():Not implemented!" << std::endl;
109  TOutput out;
110  out = 0;
111  return out;
112  }
114 
115 protected:
118 
119  ~NeighborhoodOperatorImageFunction() override = default;
120 
121  void operator=(const Self &){}
122  void PrintSelf(std::ostream & os, Indent indent) const override;
123 
124 private:
125 
127 };
128 } // end namespace itk
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 #include "itkNeighborhoodOperatorImageFunction.hxx"
132 #endif
133 
134 /*
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "itkNeighborhoodOperatorImageFunction.hxx"
137 #endif
138 */
139 
140 #endif
TOutput Evaluate(const PointType &) const override
Light weight base class for most itk classes.
TOutput EvaluateAtContinuousIndex(const ContinuousIndexType &) const override
Compute the convolution of a neighborhood operator with the image at a specific location in space...
typename Superclass::ContinuousIndexType ContinuousIndexType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void SetOperator(const NeighborhoodType &p) const
Evaluates a function of an image at specified position.