ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkCovarianceImageFunction.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 __itkCovarianceImageFunction_h
19 #define __itkCovarianceImageFunction_h
20 
21 #include "itkImageFunction.h"
22 #include "itkNumericTraits.h"
23 
24 namespace itk
25 {
44 template< typename TInputImage, typename TCoordRep = float >
46  public ImageFunction< TInputImage,
47  vnl_matrix<
48  typename NumericTraits< typename TInputImage::PixelType::ValueType >::RealType >,
49  TCoordRep >
50 {
51 public:
52 
55  typedef ImageFunction< TInputImage,
56  vnl_matrix<
58  TCoordRep > Superclass;
59 
62 
65 
67  itkNewMacro(Self);
68 
70  typedef TInputImage InputImageType;
71 
74 
76  typedef typename Superclass::IndexType IndexType;
77 
80 
82  typedef typename Superclass::PointType PointType;
83 
85  itkStaticConstMacro(ImageDimension, unsigned int,
86  InputImageType::ImageDimension);
87 
89  typedef vnl_matrix<
92 
94  virtual RealType EvaluateAtIndex(const IndexType & index) const;
95 
97  virtual RealType Evaluate(const PointType & point) const
98  {
99  IndexType index;
100 
101  this->ConvertPointToNearestIndex(point, index);
102  return this->EvaluateAtIndex(index);
103  }
104 
106  const ContinuousIndexType & cindex) const
107  {
108  IndexType index;
109 
110  this->ConvertContinuousIndexToNearestIndex(cindex, index);
111  return this->EvaluateAtIndex(index);
112  }
113 
116  itkSetMacro(NeighborhoodRadius, unsigned int);
117  itkGetConstReferenceMacro(NeighborhoodRadius, unsigned int);
119 
120 protected:
123  void PrintSelf(std::ostream & os, Indent indent) const;
124 
125 private:
126  CovarianceImageFunction(const Self &); //purposely not implemented
127  void operator=(const Self &); //purposely not implemented
128 
129  unsigned int m_NeighborhoodRadius;
130 };
131 } // end namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 #include "itkCovarianceImageFunction.hxx"
135 #endif
136 
137 #endif
virtual RealType EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const
virtual RealType EvaluateAtIndex(const IndexType &index) const
Light weight base class for most itk classes.
Point< TCoordRep, itkGetStaticConstMacro(ImageDimension) > PointType
Superclass::ContinuousIndexType ContinuousIndexType
Calculate the covariance matrix in the neighborhood of a pixel in a Vector image. ...
void operator=(const Self &)
void PrintSelf(std::ostream &os, Indent indent) const
virtual RealType Evaluate(const PointType &point) const
SmartPointer< const Self > ConstPointer
InputImageType::IndexType IndexType
ContinuousIndex< TCoordRep, itkGetStaticConstMacro(ImageDimension) > ContinuousIndexType
static const unsigned int ImageDimension
Control indentation during Print() invocation.
Definition: itkIndent.h:49
vnl_matrix< typename NumericTraits< typename InputImageType::PixelType::ValueType >::RealType > RealType
Define additional traits for native types such as int or float.
Evaluates a function of an image at specified position.
ImageFunction< TInputImage, vnl_matrix< typename NumericTraits< typename TInputImage::PixelType::ValueType >::RealType >, TCoordRep > Superclass