ITK  4.13.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:
50  typedef SpatialFunction< bool,
51  TFunction::ImageDimension,
52  typename TFunction::InputType > Superclass;
53 
56 
59 
61  itkNewMacro(Self);
62 
64  typedef typename Superclass::OutputType OutputType;
65 
67  typedef typename TFunction::InputType InputType;
68 
70  typedef TFunction FunctionType;
71 
73  typedef typename TFunction::OutputType FunctionOutputType;
74 
76  itkSetMacro(LowerThreshold, FunctionOutputType);
77  itkGetConstReferenceMacro(LowerThreshold, FunctionOutputType);
79 
81  itkSetMacro(UpperThreshold, FunctionOutputType);
82  itkGetConstReferenceMacro(UpperThreshold, FunctionOutputType);
84 
86  itkSetObjectMacro(Function, FunctionType);
87  itkGetModifiableObjectMacro(Function, FunctionType);
89 
91  virtual OutputType Evaluate(const InputType & point) const ITK_OVERRIDE;
92 
93 protected:
94 
96  ~BinaryThresholdSpatialFunction() ITK_OVERRIDE;
97  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
98 
99  FunctionOutputType m_LowerThreshold;
100  FunctionOutputType m_UpperThreshold;
101 
102  typename FunctionType::Pointer m_Function;
103 
104 private:
105  ITK_DISALLOW_COPY_AND_ASSIGN(BinaryThresholdSpatialFunction);
106 };
107 } // end namespace itk
108 
109 #ifndef ITK_MANUAL_INSTANTIATION
110 #include "itkBinaryThresholdSpatialFunction.hxx"
111 #endif
112 
113 #endif
A spatial functions that returns if the internal spatial function is within user specified thresholds...
Superclass::OutputType OutputType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
N-dimensional spatial function class.
SpatialFunction< bool, TFunction::ImageDimension, typename TFunction::InputType > Superclass