ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkAdaptiveHistogramEqualizationImageFilter.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 itkAdaptiveHistogramEqualizationImageFilter_h
19 #define itkAdaptiveHistogramEqualizationImageFilter_h
20 
23 #include "itkImage.h"
24 
25 namespace itk
26 {
70 template< typename TImageType , typename TKernel = Neighborhood<bool, TImageType::ImageDimension> >
72  public MovingHistogramImageFilter< TImageType,
73  TImageType,
74  TKernel,
75  typename Function::AdaptiveEqualizationHistogram< typename TImageType::PixelType,
76  typename TImageType::PixelType > >
77 
78 {
79 public:
84  typedef MovingHistogramImageFilter< TImageType,
85  TImageType,
86  TKernel,
87  typename Function::AdaptiveEqualizationHistogram< typename TImageType::PixelType,
88  typename TImageType::PixelType > >
92 
93  itkStaticConstMacro(ImageDimension, unsigned int,
94  TImageType::ImageDimension);
95 
97  itkNewMacro(Self);
98 
101 
103  typedef TImageType ImageType;
104  typedef typename ImageType::PixelType InputPixelType;
105  typedef typename ImageType::SizeType ImageSizeType;
106 
110  itkSetMacro(Alpha, float);
111  itkGetConstMacro(Alpha, float);
113 
118  itkSetMacro(Beta, float);
119  itkGetConstMacro(Beta, float);
121 
122 #ifndef ITK_FUTURE_LEGACY_REMOVE
123 
127  virtual void SetUseLookupTable( const bool _arg )
128  {
129  itkDebugMacro("setting UseLookupTable to " << _arg );
130  itkGenericLegacyReplaceBodyMacro( "UseLookupTable", "", "nothing" );
131  if (this->m_UseLookupTable != _arg)
132  {
133  this->m_UseLookupTable = _arg;
134  this->Modified();
135  }
136  }
137  itkGetConstMacro(UseLookupTable, bool);
138  itkBooleanMacro(UseLookupTable);
139 #endif
140 
141 
142  virtual void ConfigureHistogram( typename Superclass::HistogramType &h) ITK_OVERRIDE
143  {
144  h.SetAlpha( this->m_Alpha );
145  h.SetBeta( this->m_Beta );
146  h.SetMinimum( this->m_InputMinimum );
147  h.SetMaximum( this->m_InputMaximum );
148 
149  typename Superclass::HistogramType::RealType kernelSize = 1;
150  for ( unsigned int i = 0; i < ImageDimension; i++ )
151  {
152  kernelSize *= ( 2 * this->GetRadius()[i] + 1 );
153  }
154  h.SetKernelSize(kernelSize);
155  }
156 
157 protected:
159  {
160  m_Alpha = .3;
161  m_Beta = .3;
162  this->SetRadius(5);
163  m_UseLookupTable = false;
164  }
165 
167  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
168 
172  void BeforeThreadedGenerateData() ITK_OVERRIDE;
173 
174 private:
175  AdaptiveHistogramEqualizationImageFilter(const Self &) ITK_DELETE_FUNCTION;
176  void operator=(const Self &) ITK_DELETE_FUNCTION;
177 
179  float m_Alpha;
180 
182  float m_Beta;
183 
186 
190 
191 };
192 } // end namespace itk
193 
194 #ifndef ITK_MANUAL_INSTANTIATION
195 #include "itkAdaptiveHistogramEqualizationImageFilter.hxx"
196 #endif
197 
198 #endif
virtual const RadiusType & GetRadius() const
Implements a generic moving histogram algorithm.
TInputImage::PixelType InputPixelType
Base class for all process objects that output image data.
MovingHistogramImageFilter< TImageType, TImageType, TKernel, typename Function::AdaptiveEqualizationHistogram< typename TImageType::PixelType, typename TImageType::PixelType > > Superclass
virtual void ConfigureHistogram(typename Superclass::HistogramType &h) override
virtual void Modified() const
Base class for filters that take an image as input and produce an image as output.
void PrintSelf(std::ostream &os, Indent indent) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual void SetRadius(const RadiusType &radius) override