ITK  4.6.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 >
42  public ImageFunction< TInputImage, TOutput >
43 {
44 public:
45 
48 
51 
55 
57  itkNewMacro(Self);
58 
60  typedef TInputImage InputImageType;
61  typedef typename InputImageType::PixelType InputPixelType;
62  typedef typename Superclass::IndexType IndexType;
64 
67 
69  itkStaticConstMacro(ImageDimension, unsigned int,
70  InputImageType::ImageDimension);
71 
73 
75  typedef typename Superclass::PointType PointType;
76 
78  //virtual void SetInputImage( InputImageType * ptr );
79 
83  void SetOperator(const NeighborhoodType & p) const
84  {
85  m_Operator = p;
86  this->Modified();
87  }
89 
92  virtual TOutput Evaluate(const PointType &) const
93  {
94  std::cout << "NeighborhoodOperatorImageFunction::Evaluate(): Not implemented!" << std::endl;
95  TOutput out;
96  out = 0;
97  return out;
98  }
100 
102  virtual TOutput EvaluateAtIndex(const IndexType & index) const;
103 
106  virtual TOutput EvaluateAtContinuousIndex(
107  const ContinuousIndexType &) const
108  {
109  std::cout << "NeighborhoodOperatorImageFunction::EvaluateAtContinuousIndex():Not implemented!" << std::endl;
110  TOutput out;
111  out = 0;
112  return out;
113  }
115 
116 protected:
119 
121 
122  void operator=(const Self &){}
123  void PrintSelf(std::ostream & os, Indent indent) const;
124 
125 private:
126 
128 };
129 } // end namespace itk
130 
131 #ifndef ITK_MANUAL_INSTANTIATION
132 #include "itkNeighborhoodOperatorImageFunction.hxx"
133 #endif
134 
135 /*
136 #ifndef ITK_MANUAL_INSTANTIATION
137 #include "itkNeighborhoodOperatorImageFunction.hxx"
138 #endif
139 */
140 
141 #endif
Light weight base class for most itk classes.
Point< float, itkGetStaticConstMacro(ImageDimension) > PointType
virtual TOutput EvaluateAtIndex(const IndexType &index) const
virtual TOutput EvaluateAtContinuousIndex(const ContinuousIndexType &) const
Compute the convolution of a neighborhood operator with the image at a specific location in space...
Neighborhood< TOutput, itkGetStaticConstMacro(ImageDimension) > NeighborhoodType
virtual void Modified() const
ContinuousIndex< float, itkGetStaticConstMacro(ImageDimension) > ContinuousIndexType
virtual TOutput Evaluate(const PointType &) const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void SetOperator(const NeighborhoodType &p) const
void PrintSelf(std::ostream &os, Indent indent) const
Evaluates a function of an image at specified position.