ITK  4.13.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 >
44 class ITK_TEMPLATE_EXPORT LaplacianRecursiveGaussianImageFilter:
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:
124  virtual ~LaplacianRecursiveGaussianImageFilter() ITK_OVERRIDE {}
125  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
126 
128  void GenerateData(void) ITK_OVERRIDE;
129 
130  // Override since the filter produces the entire dataset
131  void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
132 
133 private:
134  ITK_DISALLOW_COPY_AND_ASSIGN(LaplacianRecursiveGaussianImageFilter);
135 
136  // special binary functor to perform A+B*ConstValue
137  //
138  // Where A is the cumulativeImage, B is the last filter, and
139  // ConstValue is the spacing scalling
141  {
142  public:
143  typedef AddMultConstFunctor Self;
144 
145  AddMultConstFunctor( void ) : m_Value( NumericTraits<PixelType>::OneValue() ) {}
146 
147  bool operator!=( const Self &other ) const { return !(*this==other); }
148  bool operator==( const Self &other ) const { return m_Value == other.m_Value; }
149 
151  {
152  return static_cast<InternalRealType>( a + b*m_Value );
153  }
154 
156  };
157 
158  GaussianFilterPointer m_SmoothingFilters[NumberOfSmoothingFilters];
160 
163 };
164 } // end namespace itk
165 
166 #ifndef ITK_MANUAL_INSTANTIATION
167 #include "itkLaplacianRecursiveGaussianImageFilter.hxx"
168 #endif
169 
170 #endif
Base class for computing IIR convolution with an approximation of a Gaussian kernel.
Computes the Laplacian of Gaussian (LoG) of an image.
Base class for all process objects that output image data.
RecursiveGaussianImageFilter< RealImageType, RealImageType > GaussianFilterType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
A Command subclass that calls a pointer to a member function.
Definition: itkCommand.h:84
RecursiveGaussianImageFilter< InputImageType, RealImageType > DerivativeFilterType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
Image< InternalRealType, itkGetStaticConstMacro(ImageDimension) > RealImageType
Base class for all data objects in ITK.
Templated n-dimensional image class.
Definition: itkImage.h:75
InternalRealType operator()(const InternalRealType &a, const InternalRealType &b) const