ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkBinaryThresholdSpatialFunction.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 itkBinaryThresholdSpatialFunction_h
19 #define itkBinaryThresholdSpatialFunction_h
20 
21 #include "itkSpatialFunction.h"
22 #include "itkImageBase.h"
23 
24 namespace itk
25 {
41 template< typename TFunction >
42 class ITK_TEMPLATE_EXPORT BinaryThresholdSpatialFunction:
43  public SpatialFunction< bool,
44  TFunction::ImageDimension,
45  typename TFunction::InputType >
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_ASSIGN(BinaryThresholdSpatialFunction);
49 
52  using Superclass = SpatialFunction< bool,
53  TFunction::ImageDimension,
54  typename TFunction::InputType >;
55 
58 
61 
63  itkNewMacro(Self);
64 
67 
69  using InputType = typename TFunction::InputType;
70 
72  using FunctionType = TFunction;
73 
75  using FunctionOutputType = typename TFunction::OutputType;
76 
78  itkSetMacro(LowerThreshold, FunctionOutputType);
79  itkGetConstReferenceMacro(LowerThreshold, FunctionOutputType);
81 
83  itkSetMacro(UpperThreshold, FunctionOutputType);
84  itkGetConstReferenceMacro(UpperThreshold, FunctionOutputType);
86 
88  itkSetObjectMacro(Function, FunctionType);
89  itkGetModifiableObjectMacro(Function, FunctionType);
91 
93  OutputType Evaluate(const InputType & point) const override;
94 
95 protected:
96 
98  ~BinaryThresholdSpatialFunction() override = default;
99  void PrintSelf(std::ostream & os, Indent indent) const override;
100 
103 
104  typename FunctionType::Pointer m_Function;
105 };
106 } // end namespace itk
107 
108 #ifndef ITK_MANUAL_INSTANTIATION
109 #include "itkBinaryThresholdSpatialFunction.hxx"
110 #endif
111 
112 #endif
A spatial functions that returns if the internal spatial function is within user specified thresholds...
typename Superclass::OutputType OutputType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
N-dimensional spatial function class.