ITK  4.3.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 itkDisplacementFieldJacobianDeterminantFilter.h in ITKv4"
28 #endif
29 
30 
31 namespace itk
32 {
51 template< class TInputImage >
52 class ITK_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(void);
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  void PrintSelf(std::ostream & os, Indent indent) const;
104 
105 private:
106  OtsuThresholdImageCalculator(const Self &); //purposely not implemented
107  void operator=(const Self &); //purposely not implemented
108 
114 };
115 } // end namespace itk
116 
117 #ifndef ITK_MANUAL_INSTANTIATION
118 #include "itkOtsuThresholdImageCalculator.hxx"
119 #endif
120 
121 #endif
122