ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkOtsuMultipleThresholdsImageFilter.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 __itkOtsuMultipleThresholdsImageFilter_h
19 #define __itkOtsuMultipleThresholdsImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkFixedArray.h"
25 
26 namespace itk
27 {
47 template< class TInputImage, class TOutputImage >
49  public ImageToImageFilter< TInputImage, TOutputImage >
50 {
51 public:
57 
59  itkNewMacro(Self);
60 
63 
65  typedef typename TInputImage::PixelType InputPixelType;
66  typedef typename TOutputImage::PixelType OutputPixelType;
67 
69  typedef typename TInputImage::Pointer InputImagePointer;
70  typedef typename TOutputImage::Pointer OutputImagePointer;
71 
72  typedef typename TInputImage::SizeType InputSizeType;
73  typedef typename TInputImage::IndexType InputIndexType;
74  typedef typename TInputImage::RegionType InputImageRegionType;
75  typedef typename TOutputImage::SizeType OutputSizeType;
76  typedef typename TOutputImage::IndexType OutputIndexType;
77  typedef typename TOutputImage::RegionType OutputImageRegionType;
78 
84 
86  itkStaticConstMacro(InputImageDimension, unsigned int,
87  TInputImage::ImageDimension);
88  itkStaticConstMacro(OutputImageDimension, unsigned int,
89  TOutputImage::ImageDimension);
91 
93  itkSetClampMacro( NumberOfHistogramBins, SizeValueType, 1, NumericTraits< SizeValueType >::max() );
94  itkGetConstMacro(NumberOfHistogramBins, SizeValueType);
96 
98  itkSetClampMacro( NumberOfThresholds, SizeValueType, 1, NumericTraits< SizeValueType >::max() );
99  itkGetConstMacro(NumberOfThresholds, SizeValueType);
101 
103  itkSetClampMacro( LabelOffset, OutputPixelType, NumericTraits< OutputPixelType >::Zero,
105  itkGetConstMacro(LabelOffset, OutputPixelType);
107 
109  const ThresholdVectorType & GetThresholds() const
110  {
111  return m_Thresholds;
112  }
113 
114 #ifdef ITK_USE_CONCEPT_CHECKING
115 
116  itkConceptMacro( OutputComparableCheck,
118  itkConceptMacro( OutputOStreamWritableCheck,
120 
122 #endif
123 protected:
126  void PrintSelf(std::ostream & os, Indent indent) const;
128 
129  void GenerateInputRequestedRegion();
130 
131  void GenerateData();
132 
133 private:
134  OtsuMultipleThresholdsImageFilter(const Self &); //purposely not implemented
135  void operator=(const Self &); //purposely not implemented
136 
141 }; // end of class
142 } // end namespace itk
143 
144 #ifndef ITK_MANUAL_INSTANTIATION
145 #include "itkOtsuMultipleThresholdsImageFilter.hxx"
146 #endif
147 
148 #endif
149