ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkOtsuThresholdImageCalculator.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkOtsuThresholdImageCalculator_h
19 #define itkOtsuThresholdImageCalculator_h
20 
21 #include "itkObject.h"
22 #include "itkObjectFactory.h"
23 #include "itkNumericTraits.h"
24 #include "itkIntTypes.h"
25 
26 #ifndef ITKV3_COMPATIBILITY
27 #error "This file is only valid when ITKV3_COMPATIBILITY is turned on. Users are encouraged to convert to itk::OtsuThresholdCalculator in ITKv4"
28 #endif
29 
30 
31 namespace itk
32 {
51 template< typename TInputImage >
52 class ITK_TEMPLATE_EXPORT OtsuThresholdImageCalculator:public Object
53 {
54 public:
57  typedef Object Superclass;
60 
62  itkNewMacro(Self);
63 
66 
68  typedef TInputImage ImageType;
69 
71  typedef typename TInputImage::Pointer ImagePointer;
72 
74  typedef typename TInputImage::ConstPointer ImageConstPointer;
75 
77  typedef typename TInputImage::PixelType PixelType;
78 
80  typedef typename TInputImage::RegionType RegionType;
81 
83  itkSetConstObjectMacro(Image, ImageType);
84 
86  void Compute();
87 
89  itkGetConstMacro(Threshold, PixelType);
90 
92  itkSetClampMacro( NumberOfHistogramBins, SizeValueType, 1,
94  itkGetConstMacro(NumberOfHistogramBins, SizeValueType);
96 
98  void SetRegion(const RegionType & region);
99 
100 protected:
103  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
104 
105 private:
106  ITK_DISALLOW_COPY_AND_ASSIGN(OtsuThresholdImageCalculator);
107 
113 };
114 } // end namespace itk
115 
116 #ifndef ITK_MANUAL_INSTANTIATION
117 #include "itkOtsuThresholdImageCalculator.hxx"
118 #endif
119 
120 #endif
Light weight base class for most itk classes.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
Computes the Otsu&#39;s threshold for an image.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
Base class for most ITK classes.
Definition: itkObject.h:59
Templated n-dimensional image class.
Definition: itkImage.h:75