00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkBinaryThresholdSpatialFunction_h
00018 #define _itkBinaryThresholdSpatialFunction_h
00019
00020 #include "itkSpatialFunction.h"
00021 #include "itkImageBase.h"
00022
00023 namespace itk
00024 {
00025
00040 template <typename TFunction>
00041 class ITK_EXPORT BinaryThresholdSpatialFunction :
00042 public SpatialFunction< bool,
00043 ::itk::GetImageDimension<TFunction>::ImageDimension,
00044 ITK_TYPENAME TFunction::InputType >
00045 {
00046 public:
00048 typedef BinaryThresholdSpatialFunction Self;
00049 typedef SpatialFunction< bool,
00050 ::itk::GetImageDimension<TFunction>::ImageDimension,
00051 ITK_TYPENAME TFunction::InputType > Superclass;
00052 typedef SmartPointer<Self> Pointer;
00053 typedef SmartPointer<const Self> ConstPointer;
00054
00056 itkTypeMacro(BinaryThresholdSpatialFunction, SpatialFunction);
00057
00059 itkNewMacro( Self );
00060
00062 typedef typename Superclass::OutputType OutputType;
00063
00065 typedef typename TFunction::InputType InputType;
00066
00068 typedef TFunction FunctionType;
00069
00071 typedef typename TFunction::OutputType FunctionOutputType;
00072
00074 itkSetMacro( LowerThreshold, FunctionOutputType );
00075 itkGetConstReferenceMacro( LowerThreshold, FunctionOutputType );
00076
00078 itkSetMacro( UpperThreshold, FunctionOutputType );
00079 itkGetConstReferenceMacro( UpperThreshold, FunctionOutputType );
00080
00082 itkSetObjectMacro( Function, FunctionType );
00083 itkGetConstObjectMacro( Function, FunctionType );
00084
00086 virtual OutputType Evaluate( const InputType& point ) const;
00087
00088 protected:
00089
00090 BinaryThresholdSpatialFunction();
00091 ~BinaryThresholdSpatialFunction();
00092 void PrintSelf(std::ostream& os, Indent indent) const;
00093
00094 FunctionOutputType m_LowerThreshold;
00095 FunctionOutputType m_UpperThreshold;
00096 typename FunctionType::Pointer m_Function;
00097
00098 private:
00099 BinaryThresholdSpatialFunction( const Self& );
00100 void operator=( const Self& );
00101
00102 };
00103
00104 }
00105
00106 #ifndef ITK_MANUAL_INSTANTIATION
00107 #include "itkBinaryThresholdSpatialFunction.txx"
00108 #endif
00109
00110 #endif