ITK  6.0.0
Insight Toolkit
itkNeighborhoodBinaryThresholdImageFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 TCoordinate = float>
43  : public BinaryThresholdImageFunction<TInputImage, TCoordinate>
44 {
45 public:
46  ITK_DISALLOW_COPY_AND_MOVE(NeighborhoodBinaryThresholdImageFunction);
47 
53 
55  itkOverrideGetNameOfClassMacro(NeighborhoodBinaryThresholdImageFunction);
56 
58  itkNewMacro(Self);
59 
61  using InputImageType = TInputImage;
62 
64  using typename Superclass::OutputType;
65 
67  using typename Superclass::IndexType;
68 
70  using typename Superclass::ContinuousIndexType;
71 
73  using typename Superclass::PointType;
74 
76  using 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
92  EvaluateAtIndex(const IndexType & index) const override;
93 
95  bool
96  Evaluate(const PointType & point) const override
97  {
98  IndexType index;
99 
100  this->ConvertPointToNearestIndex(point, index);
101  return this->EvaluateAtIndex(index);
102  }
103 
104  bool
105  EvaluateAtContinuousIndex(const ContinuousIndexType & cindex) const override
106  {
107  IndexType index;
108 
109  this->ConvertContinuousIndexToNearestIndex(cindex, index);
110  return this->EvaluateAtIndex(index);
111  }
112 
113 protected:
115  ~NeighborhoodBinaryThresholdImageFunction() override = default;
116  void
117  PrintSelf(std::ostream & os, Indent indent) const override;
118 
119 private:
120  InputSizeType m_Radius{};
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
itkBinaryThresholdImageFunction.h
itk::NeighborhoodBinaryThresholdImageFunction::Evaluate
bool Evaluate(const PointType &point) const override
Definition: itkNeighborhoodBinaryThresholdImageFunction.h:96
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::NeighborhoodBinaryThresholdImageFunction::InputImageType
TInputImage InputImageType
Definition: itkNeighborhoodBinaryThresholdImageFunction.h:61
itk::NeighborhoodBinaryThresholdImageFunction::InputSizeType
typename InputImageType::SizeType InputSizeType
Definition: itkNeighborhoodBinaryThresholdImageFunction.h:82
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::point
*par Constraints *The filter requires an image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
itk::BinaryThresholdImageFunction
Returns true is the value of an image lies within a range of thresholds This ImageFunction returns tr...
Definition: itkBinaryThresholdImageFunction.h:44
itk::NeighborhoodBinaryThresholdImageFunction::EvaluateAtContinuousIndex
bool EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const override
Definition: itkNeighborhoodBinaryThresholdImageFunction.h:105
itk::NeighborhoodBinaryThresholdImageFunction
Determine whether all the pixels in the specified neighborhood meet a threshold criteria.
Definition: itkNeighborhoodBinaryThresholdImageFunction.h:42
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ContinuousIndex< TCoordinate, Self::ImageDimension >
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::ImageFunction< TInputImage, bool, TCoordinate >::IndexType
typename InputImageType::IndexType IndexType
Definition: itkImageFunction.h:94