ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkNeighborhoodBinaryThresholdImageFunction.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 itkNeighborhoodBinaryThresholdImageFunction_h
19 #define itkNeighborhoodBinaryThresholdImageFunction_h
20 
22 
23 namespace itk
24 {
41 template< typename TInputImage, typename TCoordRep = float >
43  public BinaryThresholdImageFunction< TInputImage, TCoordRep >
44 {
45 public:
46 
52 
55 
57  itkNewMacro(Self);
58 
60  typedef TInputImage InputImageType;
61 
64 
66  typedef typename Superclass::IndexType IndexType;
67 
70 
72  typedef typename Superclass::PointType PointType;
73 
75  typedef typename Superclass::PixelType PixelType;
76 
78  itkStaticConstMacro(ImageDimension, unsigned int,
79  InputImageType::ImageDimension);
80 
82  typedef typename InputImageType::SizeType InputSizeType;
83 
85  itkSetMacro(Radius, InputSizeType);
86 
88  itkGetConstReferenceMacro(Radius, InputSizeType);
89 
91  virtual bool EvaluateAtIndex(const IndexType & index) const ITK_OVERRIDE;
92 
94  virtual bool Evaluate(const PointType & point) const ITK_OVERRIDE
95  {
96  IndexType index;
97 
98  this->ConvertPointToNearestIndex(point, index);
99  return this->EvaluateAtIndex(index);
100  }
101 
103  const ContinuousIndexType & cindex) const ITK_OVERRIDE
104  {
105  IndexType index;
106 
107  this->ConvertContinuousIndexToNearestIndex(cindex, index);
108  return this->EvaluateAtIndex(index);
109  }
110 
111 protected:
114  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
115 
116 private:
117  NeighborhoodBinaryThresholdImageFunction(const Self &) ITK_DELETE_FUNCTION;
118  void operator=(const Self &) ITK_DELETE_FUNCTION;
119 
121 };
122 } // end namespace itk
123 
124 #ifndef ITK_MANUAL_INSTANTIATION
125 #include "itkNeighborhoodBinaryThresholdImageFunction.hxx"
126 #endif
127 
128 /*
129 #ifndef ITK_MANUAL_INSTANTIATION
130 #include "itkNeighborhoodBinaryThresholdImageFunction.hxx"
131 #endif
132 */
133 
134 #endif
Light weight base class for most itk classes.
void ConvertPointToNearestIndex(const PointType &point, IndexType &index) const
virtual bool EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const override
Superclass::ContinuousIndexType ContinuousIndexType
virtual bool EvaluateAtIndex(const IndexType &index) const override
BinaryThresholdImageFunction< TInputImage, TCoordRep > Superclass
Determine whether all the pixels in the specified neighborhood meet a threshold criteria.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Returns true is the value of an image lies within a range of thresholds This ImageFunction returns tr...
void ConvertContinuousIndexToNearestIndex(const ContinuousIndexType &cindex, IndexType &index) const
void PrintSelf(std::ostream &os, Indent indent) const override
virtual bool Evaluate(const PointType &point) const override