ITK  6.0.0
Insight Toolkit
itkBinaryThresholdSpatialFunction.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 itkBinaryThresholdSpatialFunction_h
19#define itkBinaryThresholdSpatialFunction_h
20
21#include "itkSpatialFunction.h"
22#include "itkImageBase.h"
23
24namespace itk
25{
41template <typename TFunction>
42class ITK_TEMPLATE_EXPORT BinaryThresholdSpatialFunction
43 : public SpatialFunction<bool, TFunction::ImageDimension, typename TFunction::InputType>
44{
45public:
46 ITK_DISALLOW_COPY_AND_MOVE(BinaryThresholdSpatialFunction);
47
51
54
56 itkOverrideGetNameOfClassMacro(BinaryThresholdSpatialFunction);
57
59 itkNewMacro(Self);
60
62 using typename Superclass::OutputType;
63
65 using InputType = typename TFunction::InputType;
66
68 using FunctionType = TFunction;
69
71 using FunctionOutputType = typename TFunction::OutputType;
72
74 itkSetMacro(LowerThreshold, FunctionOutputType);
75 itkGetConstReferenceMacro(LowerThreshold, FunctionOutputType);
79 itkSetMacro(UpperThreshold, FunctionOutputType);
80 itkGetConstReferenceMacro(UpperThreshold, FunctionOutputType);
84 itkSetObjectMacro(Function, FunctionType);
85 itkGetModifiableObjectMacro(Function, FunctionType);
90 Evaluate(const InputType & point) const override;
91
92protected:
94 ~BinaryThresholdSpatialFunction() override = default;
95 void
96 PrintSelf(std::ostream & os, Indent indent) const override;
97
100
101 typename FunctionType::Pointer m_Function{};
102};
103} // end namespace itk
104
105#ifndef ITK_MANUAL_INSTANTIATION
106# include "itkBinaryThresholdSpatialFunction.hxx"
107#endif
108
109#endif
A spatial functions that returns if the internal spatial function is within user specified thresholds...
~BinaryThresholdSpatialFunction() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
OutputType Evaluate(const InputType &point) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:50
static constexpr T NonpositiveMin()
static constexpr T max(const T &)
N-dimensional spatial function class.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter 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