| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkBinaryThresholdImageFunction.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 |
DEF |
#ifndef _itkBinaryThresholdImageFunction_txx |
| 18 |
DEF |
#define _itkBinaryThresholdImageFunction_txx |
| 19 |
|
|
| 20 |
|
#include "itkBinaryThresholdImageFunction.h" |
| 21 |
|
|
| 22 |
|
namespace itk |
| 23 |
|
{ |
| 24 |
|
|
| 25 |
|
template <class TInputImage, class TCoordRep> |
| 26 |
|
BinaryThresholdImageFunction<TInputImage,TCoordRep> |
| 27 |
|
::BinaryThresholdImageFunction() |
| 28 |
|
{ |
| 29 |
|
m_Lower = NumericTraits<PixelType>::NonpositiveMin(); |
| 30 |
|
m_Upper = NumericTraits<PixelType>::max(); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
/** |
| 34 |
|
* Values greater than or equal to the value are inside |
| 35 |
|
*/ |
| 36 |
|
template <class TInputImage, class TCoordRep> |
| 37 |
|
void |
| 38 |
|
BinaryThresholdImageFunction<TInputImage,TCoordRep> |
| 39 |
|
::ThresholdAbove(PixelType thresh) |
| 40 |
|
{ |
| 41 |
|
if (m_Lower != thresh |
| 42 |
|
|| m_Upper != NumericTraits<PixelType>::max()) |
| 43 |
|
{ |
| 44 |
|
m_Lower = thresh; |
| 45 |
|
m_Upper = NumericTraits<PixelType>::max(); |
| 46 |
|
this->Modified(); |
| 47 |
|
} |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
/** |
| 51 |
|
* The values less than or equal to the value are inside |
| 52 |
|
*/ |
| 53 |
|
template <class TInputImage, class TCoordRep> |
| 54 |
|
void |
| 55 |
|
BinaryThresholdImageFunction<TInputImage,TCoordRep> |
| 56 |
|
::ThresholdBelow(PixelType thresh) |
| 57 |
|
{ |
| 58 |
|
if (m_Lower != NumericTraits<PixelType>::NonpositiveMin() |
| 59 |
IND |
******|| m_Upper != thresh) |
| 60 |
|
{ |
| 61 |
|
m_Lower = NumericTraits<PixelType>::NonpositiveMin(); |
| 62 |
|
m_Upper = thresh; |
| 63 |
|
this->Modified(); |
| 64 |
|
} |
| 65 |
|
} |
| 66 |
|
|
| 67 |
|
/** |
| 68 |
|
* The values less than or equal to the value are inside |
| 69 |
|
*/ |
| 70 |
|
template <class TInputImage, class TCoordRep> |
| 71 |
|
void |
| 72 |
|
BinaryThresholdImageFunction<TInputImage,TCoordRep> |
| 73 |
|
::ThresholdBetween(PixelType lower, PixelType upper) |
| 74 |
|
{ |
| 75 |
|
if (m_Lower != lower |
| 76 |
|
|| m_Upper != upper) |
| 77 |
|
{ |
| 78 |
|
m_Lower = lower; |
| 79 |
|
m_Upper = upper; |
| 80 |
|
this->Modified(); |
| 81 |
|
} |
| 82 |
|
} |
| 83 |
|
|
| 84 |
|
template <class TInputImage, class TCoordRep> |
| 85 |
|
void |
| 86 |
|
BinaryThresholdImageFunction<TInputImage,TCoordRep> |
| 87 |
|
::PrintSelf(std::ostream& os, Indent indent) const |
| 88 |
|
{ |
| 89 |
|
Superclass::PrintSelf( os, indent ); |
| 90 |
|
|
| 91 |
|
os << indent << "Lower: " << m_Lower << std::endl; |
| 92 |
|
os << indent << "Upper: " << m_Upper << std::endl; |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
} // end namespace itk |
| 96 |
|
|
| 97 |
|
#endif |
| 98 |
|
|