itkOtsuThresholdImageFilter.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 #ifndef __itkOtsuThresholdImageFilter_h
00018 #define __itkOtsuThresholdImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkFixedArray.h"
00022
00023 namespace itk {
00024
00041 template<class TInputImage, class TOutputImage>
00042 class ITK_EXPORT OtsuThresholdImageFilter :
00043 public ImageToImageFilter<TInputImage, TOutputImage>
00044 {
00045 public:
00047 typedef OtsuThresholdImageFilter Self;
00048 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00049 typedef SmartPointer<Self> Pointer;
00050 typedef SmartPointer<const Self> ConstPointer;
00051
00053 itkNewMacro(Self);
00054
00056 itkTypeMacro(OtsuThresholdImageFilter, ImageToImageFilter);
00057
00059 typedef typename TInputImage::PixelType InputPixelType;
00060 typedef typename TOutputImage::PixelType OutputPixelType;
00061
00063 typedef typename TInputImage::Pointer InputImagePointer;
00064 typedef typename TOutputImage::Pointer OutputImagePointer;
00065
00066 typedef typename TInputImage::SizeType InputSizeType;
00067 typedef typename TInputImage::IndexType InputIndexType;
00068 typedef typename TInputImage::RegionType InputImageRegionType;
00069 typedef typename TOutputImage::SizeType OutputSizeType;
00070 typedef typename TOutputImage::IndexType OutputIndexType;
00071 typedef typename TOutputImage::RegionType OutputImageRegionType;
00072
00073
00075 itkStaticConstMacro(InputImageDimension, unsigned int,
00076 TInputImage::ImageDimension );
00077 itkStaticConstMacro(OutputImageDimension, unsigned int,
00078 TOutputImage::ImageDimension );
00080
00083 itkSetMacro(OutsideValue,OutputPixelType);
00084
00086 itkGetMacro(OutsideValue,OutputPixelType);
00087
00090 itkSetMacro(InsideValue,OutputPixelType);
00091
00093 itkGetMacro(InsideValue,OutputPixelType);
00094
00096 itkSetClampMacro( NumberOfHistogramBins, unsigned long, 1,
00097 NumericTraits<unsigned long>::max() );
00098 itkGetMacro( NumberOfHistogramBins, unsigned long );
00100
00102 itkGetMacro(Threshold,InputPixelType);
00103
00104 #ifdef ITK_USE_CONCEPT_CHECKING
00105
00106 itkConceptMacro(OutputEqualityComparableCheck,
00107 (Concept::EqualityComparable<OutputPixelType>));
00108 itkConceptMacro(InputOStreamWritableCheck,
00109 (Concept::OStreamWritable<InputPixelType>));
00110 itkConceptMacro(OutputOStreamWritableCheck,
00111 (Concept::OStreamWritable<OutputPixelType>));
00112
00114 #endif
00115 protected:
00116 OtsuThresholdImageFilter();
00117 ~OtsuThresholdImageFilter(){};
00118 void PrintSelf(std::ostream& os, Indent indent) const;
00120
00121 void GenerateInputRequestedRegion();
00122 void GenerateData ();
00123
00124 private:
00125 OtsuThresholdImageFilter(const Self&);
00126 void operator=(const Self&);
00127
00128 InputPixelType m_Threshold;
00129 OutputPixelType m_InsideValue;
00130 OutputPixelType m_OutsideValue;
00131 unsigned long m_NumberOfHistogramBins;
00132
00133 };
00134
00135 }
00136
00137 #ifndef ITK_MANUAL_INSTANTIATION
00138 #include "itkOtsuThresholdImageFilter.txx"
00139 #endif
00140
00141 #endif
00142