ITK  4.2.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 
63 
67  typedef float InternalRealType;
68  typedef Image< InternalRealType,
69  itkGetStaticConstMacro(ImageDimension) > RealImageType;
70 
76 
82 
85 
88 
90  typedef typename TOutputImage::Pointer OutputImagePointer;
91 
93  typedef TOutputImage OutputImageType;
94  typedef typename OutputImageType::PixelType OutputPixelType;
95 
96 
100 
102  itkNewMacro(Self);
103 
107 
109  void SetSigma(RealType sigma);
110 
114  void SetNormalizeAcrossScale(bool normalizeInScaleSpace);\
115  itkGetConstMacro(NormalizeAcrossScale, bool);
117 
118 protected:
121  void PrintSelf(std::ostream & os, Indent indent) const;
122 
124  void GenerateData(void);
125 
126  // Override since the filter produces the entire dataset
127  void EnlargeOutputRequestedRegion(DataObject *output);
128 
129 private:
130  LaplacianRecursiveGaussianImageFilter(const Self &); //purposely not
131  // implemented
132  void operator=(const Self &); //purposely not
133  // implemented
134 
135  // special binary functor to perform A+B*ConstValue
136  //
137  // Where A is the cumulativeImage, B is the last filter, and
138  // ConstValue is the spacing scalling
140  {
141  public:
143 
144  AddMultConstFunctor( void ) : m_Value( NumericTraits<PixelType>::One ) {}
145 
146  bool operator!=( const Self &other ) const { return !(*this==other); }
147  bool operator==( const Self &other ) const { return m_Value == other.m_Value; }
148 
149  inline InternalRealType operator()( const InternalRealType &a, const InternalRealType &b ) const
150  {
151  return static_cast<InternalRealType>( a + b*m_Value );
152  }
153 
155  };
156 
157  GaussianFilterPointer m_SmoothingFilters[ImageDimension - 1];
159 
162 };
163 } // end namespace itk
164 
165 #ifndef ITK_MANUAL_INSTANTIATION
166 #include "itkLaplacianRecursiveGaussianImageFilter.hxx"
167 #endif
168 
169 #endif
170