itkThresholdImageFilter.h
Go to the documentation of this file.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 #ifdef ITK_USE_CONCEPT_CHECKING
00063
00065 itkConceptMacro(PixelTypeComparableCheck,
00066 (Concept::Comparable<PixelType>));
00067 itkConceptMacro(PixelTypeOStreamWritableCheck,
00068 (Concept::OStreamWritable<PixelType>));
00069
00071 #endif
00072
00075 itkSetMacro(OutsideValue,PixelType);
00076
00078 itkGetMacro(OutsideValue,PixelType);
00079
00081 void ThresholdAbove(const PixelType &thresh);
00082
00084 void ThresholdBelow(const PixelType &thresh);
00085
00087 void ThresholdOutside(const PixelType &lower, const PixelType &upper);
00088
00090 itkSetMacro(Lower, PixelType);
00091 itkGetMacro(Lower, PixelType);
00093
00095 itkSetMacro(Upper, PixelType);
00096 itkGetMacro(Upper, PixelType);
00098
00100 typedef TImage InputImageType;
00101 typedef typename InputImageType::ConstPointer InputImagePointer;
00102 typedef typename InputImageType::RegionType InputImageRegionType;
00103 typedef typename InputImageType::PixelType InputImagePixelType;
00104
00106 typedef TImage OutputImageType;
00107 typedef typename OutputImageType::Pointer OutputImagePointer;
00108 typedef typename OutputImageType::RegionType OutputImageRegionType;
00109 typedef typename OutputImageType::PixelType OutputImagePixelType;
00110
00111 protected:
00112 ThresholdImageFilter();
00113 ~ThresholdImageFilter() {};
00114 void PrintSelf(std::ostream& os, Indent indent) const;
00115
00126 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00127 int threadId );
00128
00129 private:
00130 ThresholdImageFilter(const Self&);
00131 void operator=(const Self&);
00132
00133 PixelType m_OutsideValue;
00134 PixelType m_Lower;
00135 PixelType m_Upper;
00136 };
00137
00138
00139 }
00140
00141 #ifndef ITK_MANUAL_INSTANTIATION
00142 #include "itkThresholdImageFilter.txx"
00143 #endif
00144
00145 #endif
00146