ITK  4.2.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 >
43  public SpatialFunction< bool,
44  ::itk::GetImageDimension< TFunction >::ImageDimension,
45  typename TFunction::InputType >
46 {
47 public:
50  typedef SpatialFunction< bool,
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  itkGetConstObjectMacro(Function, FunctionType);
89 
91  virtual OutputType Evaluate(const InputType & point) const;
92 
93 protected:
94 
97  void PrintSelf(std::ostream & os, Indent indent) const;
98 
101 
102  typename FunctionType::Pointer m_Function;
103 private:
104  BinaryThresholdSpatialFunction(const Self &); //purposely not implemented
105  void operator=(const Self &); //purposely not implemented
106 };
107 } // end namespace itk
108 
109 #ifndef ITK_MANUAL_INSTANTIATION
110 #include "itkBinaryThresholdSpatialFunction.hxx"
111 #endif
112 
113 #endif
114