NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkMinimumImageFunction.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef __itkMinimumImageFunction_h
16 #define __itkMinimumImageFunction_h
17 
18 #include "itkImageFunction.h"
19 #include "itkNumericTraits.h"
20 
21 namespace itk
22 {
39 template< class TInputImage, class TCoordRep = float >
40 class ITK_EXPORT MinimumImageFunction:
41  public ImageFunction< TInputImage,
42  typename NumericTraits< typename TInputImage::PixelType >::RealType,
43  TCoordRep >
44 {
45 public:
48  typedef ImageFunction< TInputImage,
49  typename NumericTraits< typename TInputImage::PixelType >::RealType,
50  TCoordRep > Superclass;
51 
52  typedef SmartPointer< Self > Pointer;
53  typedef SmartPointer< const Self > ConstPointer;
54 
56  itkTypeMacro(MinimumImageFunction, ImageFunction);
57 
59  itkNewMacro(Self);
60 
62  typedef TInputImage InputImageType;
63 
65  typedef typename Superclass::OutputType OutputType;
66 
68  typedef typename Superclass::IndexType IndexType;
69 
71  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
72 
74  typedef typename Superclass::PointType PointType;
75 
77  itkStaticConstMacro(ImageDimension, unsigned int,
78  InputImageType::ImageDimension);
79 
81  typedef typename NumericTraits< typename InputImageType::PixelType >::RealType
83 
85  virtual RealType EvaluateAtIndex(const IndexType & index) const;
86 
88  virtual RealType Evaluate(const PointType & point) const
89  {
90  IndexType index;
91 
92  this->ConvertPointToNearestIndex(point, index);
93  return this->EvaluateAtIndex(index);
94  }
95 
97  const ContinuousIndexType & cindex) const
98  {
99  IndexType index;
100 
101  this->ConvertContinuousIndexToNearestIndex(cindex, index);
102  return this->EvaluateAtIndex(index);
103  }
104 
107  itkSetMacro(NeighborhoodRadius, unsigned int);
108  itkGetConstReferenceMacro(NeighborhoodRadius, unsigned int);
109 
110 protected:
113  void PrintSelf(std::ostream & os, Indent indent) const;
114 
115 private:
116  MinimumImageFunction(const Self &); //purposely not implemented
117  void operator=(const Self &); //purposely not implemented
118 
119  unsigned int m_NeighborhoodRadius;
120 };
121 } // end namespace itk
122 
123 #ifndef ITK_MANUAL_INSTANTIATION
124 #include "itkMinimumImageFunction.txx"
125 #endif
126 
127 #endif
ImageFunction< TInputImage, typename NumericTraits< typename TInputImage::PixelType >::RealType, TCoordRep > Superclass
Definition: itkMinimumImageFunction.h:50
Superclass::PointType PointType
Definition: itkMinimumImageFunction.h:74
SmartPointer< const Self > ConstPointer
Definition: itkMinimumImageFunction.h:53
virtual RealType Evaluate(const PointType &point) const
Definition: itkMinimumImageFunction.h:88
Calculate the minimum value in the neighborhood of a pixel.
Definition: itkMinimumImageFunction.h:40
Superclass::OutputType OutputType
Definition: itkMinimumImageFunction.h:65
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
virtual RealType EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const
Definition: itkMinimumImageFunction.h:96
~MinimumImageFunction()
Definition: itkMinimumImageFunction.h:112
SmartPointer< Self > Pointer
Definition: itkMinimumImageFunction.h:52
Superclass::IndexType IndexType
Definition: itkMinimumImageFunction.h:68
NumericTraits< typename InputImageType::PixelType >::RealType RealType
Definition: itkMinimumImageFunction.h:82
GLuint index
Definition: glew.h:1798
TInputImage InputImageType
Definition: itkMinimumImageFunction.h:59
MinimumImageFunction Self
Definition: itkMinimumImageFunction.h:47
Superclass::ContinuousIndexType ContinuousIndexType
Definition: itkMinimumImageFunction.h:71