ITK  5.0.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 >
42 class ITK_TEMPLATE_EXPORT NeighborhoodBinaryThresholdImageFunction:
43  public BinaryThresholdImageFunction< TInputImage, TCoordRep >
44 {
45 public:
46  ITK_DISALLOW_COPY_AND_ASSIGN(NeighborhoodBinaryThresholdImageFunction);
47 
53 
56 
58  itkNewMacro(Self);
59 
61  using InputImageType = TInputImage;
62 
64  using OutputType = typename Superclass::OutputType;
65 
67  using IndexType = typename Superclass::IndexType;
68 
70  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
71 
73  using PointType = typename Superclass::PointType;
74 
76  using PixelType = typename Superclass::PixelType;
77 
79  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
80 
83 
85  itkSetMacro(Radius, InputSizeType);
86 
88  itkGetConstReferenceMacro(Radius, InputSizeType);
89 
91  bool EvaluateAtIndex(const IndexType & index) const override;
92 
94  bool Evaluate(const PointType & point) const override
95  {
96  IndexType index;
97 
98  this->ConvertPointToNearestIndex(point, index);
99  return this->EvaluateAtIndex(index);
100  }
101 
103  const ContinuousIndexType & cindex) const override
104  {
105  IndexType index;
106 
107  this->ConvertContinuousIndexToNearestIndex(cindex, index);
108  return this->EvaluateAtIndex(index);
109  }
110 
111 protected:
113  ~NeighborhoodBinaryThresholdImageFunction() override = default;
114  void PrintSelf(std::ostream & os, Indent indent) const override;
115 
116 private:
118 };
119 } // end namespace itk
120 
121 #ifndef ITK_MANUAL_INSTANTIATION
122 #include "itkNeighborhoodBinaryThresholdImageFunction.hxx"
123 #endif
124 
125 /*
126 #ifndef ITK_MANUAL_INSTANTIATION
127 #include "itkNeighborhoodBinaryThresholdImageFunction.hxx"
128 #endif
129 */
130 
131 #endif
bool EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const override
Light weight base class for most itk classes.
typename Superclass::ContinuousIndexType ContinuousIndexType
typename Superclass::InputImageType InputImageType
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...