00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __itkThresholdImageFilter_h
00021 #define __itkThresholdImageFilter_h
00022
00023 #include "itkInPlaceImageFilter.h"
00024
00025 #include "itkConceptChecking.h"
00026
00027 namespace itk
00028 {
00029
00042 template <class TImage>
00043 class ITK_EXPORT ThresholdImageFilter:public InPlaceImageFilter<TImage,TImage>
00044 {
00045 public:
00047 typedef ThresholdImageFilter Self;
00048 typedef InPlaceImageFilter<TImage,TImage> Superclass;
00049 typedef SmartPointer<Self> Pointer;
00050 typedef SmartPointer<const Self> ConstPointer;
00051
00053 itkNewMacro(Self);
00054
00056 itkTypeMacro(ThresholdImageFilter, InPlaceImageFilter);
00057
00059 typedef typename TImage::PixelType PixelType;
00060
00062 itkConceptMacro(PixelTypeComparable, (Concept::Comparable<PixelType>));
00063
00066 itkSetMacro(OutsideValue,PixelType);
00067
00069 itkGetMacro(OutsideValue,PixelType);
00070
00072 void ThresholdAbove(const PixelType &thresh);
00073
00075 void ThresholdBelow(const PixelType &thresh);
00076
00078 void ThresholdOutside(const PixelType &lower, const PixelType &upper);
00079
00081 itkSetMacro(Lower, PixelType);
00082 itkGetMacro(Lower, PixelType);
00083
00085 itkSetMacro(Upper, PixelType);
00086 itkGetMacro(Upper, PixelType);
00087
00089 typedef TImage InputImageType;
00090 typedef typename InputImageType::ConstPointer InputImagePointer;
00091 typedef typename InputImageType::RegionType InputImageRegionType;
00092 typedef typename InputImageType::PixelType InputImagePixelType;
00093
00095 typedef TImage OutputImageType;
00096 typedef typename OutputImageType::Pointer OutputImagePointer;
00097 typedef typename OutputImageType::RegionType OutputImageRegionType;
00098 typedef typename OutputImageType::PixelType OutputImagePixelType;
00099
00100 protected:
00101 ThresholdImageFilter();
00102 ~ThresholdImageFilter() {};
00103 void PrintSelf(std::ostream& os, Indent indent) const;
00104
00115 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00116 int threadId );
00117
00118 private:
00119 ThresholdImageFilter(const Self&);
00120 void operator=(const Self&);
00121
00122 PixelType m_OutsideValue;
00123 PixelType m_Lower;
00124 PixelType m_Upper;
00125 };
00126
00127
00128 }
00129
00130 #ifndef ITK_MANUAL_INSTANTIATION
00131 #include "itkThresholdImageFilter.txx"
00132 #endif
00133
00134 #endif