ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkLaplacianRecursiveGaussianImageFilter.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 __itkLaplacianRecursiveGaussianImageFilter_h
19 #define __itkLaplacianRecursiveGaussianImageFilter_h
20 
22 #include "itkImage.h"
23 #include "itkCommand.h"
24 
25 namespace itk
26 {
42 template< typename TInputImage,
43  typename TOutputImage = TInputImage >
45  public ImageToImageFilter< TInputImage, TOutputImage >
46 {
47 public:
53 
55  typedef TInputImage InputImageType;
56  typedef typename InputImageType::PixelType PixelType;
57 
59  itkStaticConstMacro(ImageDimension, unsigned int,
60  TInputImage::ImageDimension);
61 
62  itkStaticConstMacro(NumberOfSmoothingFilters ,unsigned int, ImageDimension - 1);
63 
65 
69  typedef float InternalRealType;
70  typedef Image< InternalRealType,
71  itkGetStaticConstMacro(ImageDimension) > RealImageType;
72 
78 
84 
87 
90 
92  typedef typename TOutputImage::Pointer OutputImagePointer;
93 
95  typedef TOutputImage OutputImageType;
96  typedef typename OutputImageType::PixelType OutputPixelType;
97 
98 
102 
104  itkNewMacro(Self);
105 
109 
111  void SetSigma(RealType sigma);
112  RealType GetSigma() const;
114 
118  void SetNormalizeAcrossScale(bool normalizeInScaleSpace);\
119  itkGetConstMacro(NormalizeAcrossScale, bool);
121 
122 protected:
125  void PrintSelf(std::ostream & os, Indent indent) const;
126 
128  void GenerateData(void);
129 
130  // Override since the filter produces the entire dataset
131  void EnlargeOutputRequestedRegion(DataObject *output);
132 
133 private:
134  LaplacianRecursiveGaussianImageFilter(const Self &); //purposely not
135  // implemented
136  void operator=(const Self &); //purposely not
137  // implemented
138 
139  // special binary functor to perform A+B*ConstValue
140  //
141  // Where A is the cumulativeImage, B is the last filter, and
142  // ConstValue is the spacing scalling
144  {
145  public:
147 
148  AddMultConstFunctor( void ) : m_Value( NumericTraits<PixelType>::One ) {}
149 
150  bool operator!=( const Self &other ) const { return !(*this==other); }
151  bool operator==( const Self &other ) const { return m_Value == other.m_Value; }
152 
153  inline InternalRealType operator()( const InternalRealType &a, const InternalRealType &b ) const
154  {
155  return static_cast<InternalRealType>( a + b*m_Value );
156  }
157 
159  };
160 
161  GaussianFilterPointer m_SmoothingFilters[NumberOfSmoothingFilters];
163 
166 };
167 } // end namespace itk
168 
169 #ifndef ITK_MANUAL_INSTANTIATION
170 #include "itkLaplacianRecursiveGaussianImageFilter.hxx"
171 #endif
172 
173 #endif
174