ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkAnisotropicDiffusionImageFilter.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 __itkAnisotropicDiffusionImageFilter_h
00019 #define __itkAnisotropicDiffusionImageFilter_h
00020 
00021 #include "itkDenseFiniteDifferenceImageFilter.h"
00022 #include "itkAnisotropicDiffusionFunction.h"
00023 #include "itkNumericTraits.h"
00024 
00025 namespace itk
00026 {
00072 template< class TInputImage, class TOutputImage >
00073 class ITK_EXPORT AnisotropicDiffusionImageFilter:
00074   public DenseFiniteDifferenceImageFilter< TInputImage, TOutputImage >
00075 {
00076 public:
00078   typedef AnisotropicDiffusionImageFilter                               Self;
00079   typedef DenseFiniteDifferenceImageFilter< TInputImage, TOutputImage > Superclass;
00080   typedef SmartPointer< Self >                                          Pointer;
00081   typedef SmartPointer< const Self >                                    ConstPointer;
00082 
00084   itkTypeMacro(AnisotropicDiffusionImageFilter,
00085                DenseFiniteDifferenceImageFilter);
00086 
00088   typedef typename Superclass::InputImageType   InputImageType;
00089   typedef typename Superclass::OutputImageType  OutputImageType;
00090   typedef typename Superclass::UpdateBufferType UpdateBufferType;
00091 
00094   itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
00095 
00098   typedef typename Superclass::PixelType    PixelType;
00099   typedef typename Superclass::TimeStepType TimeStepType;
00100 
00102   itkSetMacro(TimeStep, TimeStepType);
00103   itkGetConstMacro(TimeStep, TimeStepType);
00105 
00108   itkSetMacro(ConductanceParameter, double);
00109   itkGetConstMacro(ConductanceParameter, double);
00111 
00114   itkSetMacro(ConductanceScalingUpdateInterval, unsigned int);
00115   itkGetConstMacro(ConductanceScalingUpdateInterval, unsigned int);
00117 
00120   itkSetMacro(ConductanceScalingParameter, double);
00121   itkGetConstMacro(ConductanceScalingParameter, double);
00123 
00131   void SetFixedAverageGradientMagnitude(double a)
00132   {
00133     m_FixedAverageGradientMagnitude = a;
00134     this->Modified();
00135     m_GradientMagnitudeIsFixed = true;
00136   }
00138 
00139   itkGetConstMacro(FixedAverageGradientMagnitude, double);
00140 protected:
00141   AnisotropicDiffusionImageFilter();
00142   ~AnisotropicDiffusionImageFilter() {}
00143   void PrintSelf(std::ostream & os, Indent indent) const;
00144 
00147   //  virtual bool Halt();
00148 
00150   virtual void InitializeIteration();
00151 
00152   bool m_GradientMagnitudeIsFixed;
00153 private:
00154   AnisotropicDiffusionImageFilter(const Self &); //purposely not implemented
00155   void operator=(const Self &);                  //purposely not implemented
00156 
00157   double       m_ConductanceParameter;
00158   double       m_ConductanceScalingParameter;
00159   unsigned int m_ConductanceScalingUpdateInterval;
00160   double       m_FixedAverageGradientMagnitude;
00161 
00162   TimeStepType m_TimeStep;
00163 };
00164 } // end namspace itk
00165 
00166 #ifndef ITK_MANUAL_INSTANTIATION
00167 #include "itkAnisotropicDiffusionImageFilter.hxx"
00168 #endif
00169 
00170 #endif
00171