ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkCurvatureFlowImageFilter.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 __itkCurvatureFlowImageFilter_h
00019 #define __itkCurvatureFlowImageFilter_h
00020 
00021 #include "itkDenseFiniteDifferenceImageFilter.h"
00022 #include "itkCurvatureFlowFunction.h"
00023 
00024 namespace itk
00025 {
00089 template< class TInputImage, class TOutputImage >
00090 class ITK_EXPORT CurvatureFlowImageFilter:
00091   public DenseFiniteDifferenceImageFilter< TInputImage, TOutputImage >
00092 {
00093 public:
00095   typedef CurvatureFlowImageFilter                                      Self;
00096   typedef DenseFiniteDifferenceImageFilter< TInputImage, TOutputImage > Superclass;
00097   typedef SmartPointer< Self >                                          Pointer;
00098   typedef SmartPointer< const Self >                                    ConstPointer;
00099 
00101   itkNewMacro(Self);
00102 
00104   itkTypeMacro(CurvatureFlowImageFilter,
00105                DenseFiniteDifferenceImageFilter);
00106 
00108   typedef typename Superclass::InputImageType InputImageType;
00109 
00111   typedef typename Superclass::OutputImageType OutputImageType;
00112   typedef typename OutputImageType::Pointer    OutputImagePointer;
00113 
00115   typedef typename Superclass::FiniteDifferenceFunctionType
00116   FiniteDifferenceFunctionType;
00117 
00119   typedef CurvatureFlowFunction< OutputImageType >
00120   CurvatureFlowFunctionType;
00121 
00124   itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
00125 
00128   typedef typename Superclass::PixelType PixelType;
00129 
00131   typedef typename Superclass::TimeStepType TimeStepType;
00132 
00134   itkSetMacro(TimeStep, TimeStepType);
00135 
00137   itkGetConstMacro(TimeStep, TimeStepType);
00138 
00139 #ifdef ITK_USE_CONCEPT_CHECKING
00140 
00141   itkConceptMacro( DoubleConvertibleToOutputCheck,
00142                    ( Concept::Convertible< double, PixelType > ) );
00143   itkConceptMacro( OutputConvertibleToDoubleCheck,
00144                    ( Concept::Convertible< PixelType, double > ) );
00145   itkConceptMacro( OutputDivisionOperatorsCheck,
00146                    ( Concept::DivisionOperators< PixelType > ) );
00147   itkConceptMacro( DoubleOutputMultiplyOperatorCheck,
00148                    ( Concept::MultiplyOperator< double, PixelType, PixelType > ) );
00149   itkConceptMacro( IntOutputMultiplyOperatorCheck,
00150                    ( Concept::MultiplyOperator< int, PixelType, PixelType > ) );
00151   itkConceptMacro( OutputLessThanDoubleCheck,
00152                    ( Concept::LessThanComparable< PixelType, double > ) );
00153   itkConceptMacro( OutputDoubleAdditiveOperatorsCheck,
00154                    ( Concept::AdditiveOperators< PixelType, double > ) );
00155 
00157 #endif
00158 protected:
00159   CurvatureFlowImageFilter();
00160   ~CurvatureFlowImageFilter() {}
00161   void PrintSelf(std::ostream & os, Indent indent) const;
00163 
00166   virtual bool Halt()
00167   {
00168     if ( this->GetElapsedIterations() == this->GetNumberOfIterations() )
00169       {
00170       return true;
00171       }
00172     else
00173       {
00174       return false;
00175       }
00176   }
00178 
00181   virtual void InitializeIteration();
00182 
00186   virtual void EnlargeOutputRequestedRegion(DataObject *);
00187 
00191   virtual void GenerateInputRequestedRegion();
00192 
00193 private:
00194   CurvatureFlowImageFilter(const Self &); //purposely not implemented
00195   void operator=(const Self &);           //purposely not implemented
00196 
00197   TimeStepType m_TimeStep;
00198 };
00199 } // end namspace itk
00200 
00201 #ifndef ITK_MANUAL_INSTANTIATION
00202 #include "itkCurvatureFlowImageFilter.hxx"
00203 #endif
00204 
00205 #endif
00206