KWStyle - itkBinaryThresholdSpatialFunction.txx
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkBinaryThresholdSpatialFunction.txx.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:33 $
7   Version:   $Revision: 1.4 $
8
9   Copyright (c) Insight Software Consortium. All rights reserved.
10   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notices for more information.
15
16 =========================================================================*/
17 #ifndef __itkBinaryThresholdSpatialFunction_txx
18 #define __itkBinaryThresholdSpatialFunction_txx
19
20 #include "itkBinaryThresholdSpatialFunction.h"
21
22 namespace itk
23 {
24
25 template <typename TFunction>
26 BinaryThresholdSpatialFunction<TFunction>
27 ::BinaryThresholdSpatialFunction()
28 {
29   m_LowerThreshold = NumericTraits<FunctionOutputType>::NonpositiveMin();
30   m_UpperThreshold = NumericTraits<FunctionOutputType>::max();
31   m_Function = NULL;
32
33 }
34
35 template <typename TFunction>
36 BinaryThresholdSpatialFunction<TFunction>
37 ::~BinaryThresholdSpatialFunction()
38 {
39
40 }
41
42 template <typename TFunction>
43 void
44 BinaryThresholdSpatialFunction<TFunction>
45 ::PrintSelf(std::ostream& os, Indent indent) const
46 {
47   Superclass::PrintSelf(os,indent);
48   os << indent << " m_LowerThreshold: " << m_LowerThreshold << std::endl;
49   os << indent << " m_UpperThreshold: " << m_UpperThreshold << std::endl;
50   os << indent << " m_Function: " << m_Function.GetPointer() << std::endl;
51
52 }
53
54 template <typename TFunction>
55 typename BinaryThresholdSpatialFunction<TFunction>
56 ::OutputType
57 BinaryThresholdSpatialFunction<TFunction>
58 ::Evaluate( const InputType& point ) const
59 {
60   FunctionOutputType value = m_Function->Evaluate( point );
61   if ( m_LowerThreshold <= value && value <= m_UpperThreshold )
62     {
63     return true;
64     }
65   return false;
66 }
67
68 // end namespace itk
69
70 #endif
71

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:00PM
© Kitware Inc.