Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
itkNewOtsuThresholdImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkNewOtsuThresholdImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2006/03/16 19:59:56 $
7  Version: $Revision: 1.1.2.1 $
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 itkNewOtsuThresholdImageFilter_h
18 #define itkNewOtsuThresholdImageFilter_h
19 
20 #include "itkImageToImageFilter.h"
21 #include "itkFixedArray.h"
22 
23 namespace itk
24 {
25 
41 template<class TInputImage, class TOutputImage>
43  public ImageToImageFilter<TInputImage, TOutputImage>
44 {
45 public:
48  typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
49  typedef SmartPointer<Self> Pointer;
50  typedef SmartPointer<const Self> ConstPointer;
51 
53  itkNewMacro(Self);
54 
56  itkTypeMacro(NewOtsuThresholdImageFilter, ImageToImageFilter);
57 
59  typedef typename TInputImage::PixelType InputPixelType;
60  typedef typename TOutputImage::PixelType OutputPixelType;
61 
63  typedef typename TInputImage::Pointer InputImagePointer;
64  typedef typename TOutputImage::Pointer OutputImagePointer;
65 
66  typedef typename TInputImage::SizeType InputSizeType;
67  typedef typename TInputImage::IndexType InputIndexType;
68  typedef typename TInputImage::RegionType InputImageRegionType;
69  typedef typename TOutputImage::SizeType OutputSizeType;
70  typedef typename TOutputImage::IndexType OutputIndexType;
71  typedef typename TOutputImage::RegionType OutputImageRegionType;
72 
73 
75  itkStaticConstMacro(InputImageDimension, unsigned int,
76  TInputImage::ImageDimension );
77  itkStaticConstMacro(OutputImageDimension, unsigned int,
78  TOutputImage::ImageDimension );
79 
82  itkSetMacro(OutsideValue,OutputPixelType);
83 
85  itkGetMacro(OutsideValue,OutputPixelType);
86 
89  itkSetMacro(InsideValue,OutputPixelType);
90 
92  itkGetMacro(InsideValue,OutputPixelType);
93 
95  itkSetClampMacro( NumberOfHistogramBins, unsigned long, 1,
96  NumericTraits<unsigned long>::max() );
97  itkGetMacro( NumberOfHistogramBins, unsigned long );
98 
99  itkSetMacro ( Omega, double);
100  itkGetMacro ( Omega, double);
101 
103  itkGetMacro(Threshold,InputPixelType);
104 
105 
106 protected:
109  void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
110 
111  void GenerateInputRequestedRegion() ITK_OVERRIDE;
112  void GenerateData () ITK_OVERRIDE;
113 
114 private:
115  NewOtsuThresholdImageFilter(const Self&); //purposely not implemented
116  void operator=(const Self&); //purposely not implemented
117 
118  InputPixelType m_Threshold;
119  OutputPixelType m_InsideValue;
120  OutputPixelType m_OutsideValue;
121  unsigned long m_NumberOfHistogramBins;
122  double m_Omega;
123 };
124 
125 }
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "itkNewOtsuThresholdImageFilter.txx"
129 #endif
130 
131 #endif
Threshold an image using the Otsu Threshold.
itkGetMacro(OutsideValue, OutputPixelType)
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
itkSetMacro(OutsideValue, OutputPixelType)
Simplified inverse ITK transforms.
itkSetClampMacro(NumberOfHistogramBins, unsigned long, 1, NumericTraits< unsigned long >::max())
void GenerateData() ITK_OVERRIDE
void GenerateInputRequestedRegion() ITK_OVERRIDE
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension)
itkTypeMacro(NewOtsuThresholdImageFilter, ImageToImageFilter)
ImageToImageFilter< TInputImage, TOutputImage > Superclass