ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkRecursiveGaussianImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkRecursiveGaussianImageFilter_h
00019 #define __itkRecursiveGaussianImageFilter_h
00020 
00021 #include "itkRecursiveSeparableImageFilter.h"
00022 
00023 namespace itk
00024 {
00061 template< typename TInputImage, typename TOutputImage = TInputImage >
00062 class ITK_EXPORT RecursiveGaussianImageFilter:
00063   public RecursiveSeparableImageFilter< TInputImage, TOutputImage >
00064 {
00065 public:
00067   typedef RecursiveGaussianImageFilter                               Self;
00068   typedef RecursiveSeparableImageFilter< TInputImage, TOutputImage > Superclass;
00069   typedef SmartPointer< Self >                                       Pointer;
00070   typedef SmartPointer< const Self >                                 ConstPointer;
00071 
00072   typedef typename Superclass::RealType       RealType;
00073   typedef typename Superclass::ScalarRealType ScalarRealType;
00074 
00076   itkNewMacro(Self);
00077 
00079   itkTypeMacro(RecursiveGaussianImageFilter, RecursiveSeparableImageFilter);
00080 
00083   itkGetConstMacro(Sigma, ScalarRealType);
00084   itkSetMacro(Sigma, ScalarRealType);
00086 
00090   typedef  enum { ZeroOrder, FirstOrder, SecondOrder } OrderEnumType;
00091 
00093   typedef TOutputImage OutputImageType;
00094 
00134   itkSetMacro(NormalizeAcrossScale, bool);
00135   itkGetConstMacro(NormalizeAcrossScale, bool);
00136 
00143   itkSetMacro(Order, OrderEnumType);
00144   itkGetConstMacro(Order, OrderEnumType);
00146 
00148   void SetZeroOrder();
00149 
00151   void SetFirstOrder();
00152 
00154   void SetSecondOrder();
00155 
00156 protected:
00157   RecursiveGaussianImageFilter();
00158   virtual ~RecursiveGaussianImageFilter() {}
00159   void PrintSelf(std::ostream & os, Indent indent) const;
00160 
00165   virtual void SetUp(ScalarRealType spacing);
00166 
00167 private:
00168   RecursiveGaussianImageFilter(const Self &); //purposely not implemented
00169   void operator=(const Self &);               //purposely not implemented
00170 
00172   void ComputeNCoefficients(ScalarRealType sigmad,
00173                             ScalarRealType A1, ScalarRealType B1, ScalarRealType W1, ScalarRealType L1,
00174                             ScalarRealType A2, ScalarRealType B2, ScalarRealType W2, ScalarRealType L2,
00175                             ScalarRealType & N0, ScalarRealType & N1,
00176                             ScalarRealType & N2, ScalarRealType & N3,
00177                             ScalarRealType & SN, ScalarRealType & DN, ScalarRealType & EN);
00178 
00180   void ComputeDCoefficients(ScalarRealType sigmad,
00181                             ScalarRealType W1, ScalarRealType L1, ScalarRealType W2, ScalarRealType L2,
00182                             ScalarRealType & SD, ScalarRealType & DD, ScalarRealType & ED);
00183 
00186   void ComputeRemainingCoefficients(bool symmetric);
00187 
00189   ScalarRealType m_Sigma;
00190 
00192   bool m_NormalizeAcrossScale;
00193 
00194   OrderEnumType m_Order;
00195 };
00196 } // end namespace itk
00197 
00198 #ifndef ITK_MANUAL_INSTANTIATION
00199 #include "itkRecursiveGaussianImageFilter.hxx"
00200 #endif
00201 
00202 #endif
00203