ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkLevelSetEquationLaplacianTerm.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 
00019 #ifndef __itkLevelSetEquationLaplacianTerm_h
00020 #define __itkLevelSetEquationLaplacianTerm_h
00021 
00022 #include "itkLevelSetEquationTermBase.h"
00023 #include "itkZeroFluxNeumannBoundaryCondition.h"
00024 #include "itkConstNeighborhoodIterator.h"
00025 #include "itkVector.h"
00026 #include "vnl/vnl_matrix_fixed.h"
00027 
00028 namespace itk
00029 {
00045 template< class TInput, // Input image or mesh
00046           class TLevelSetContainer >
00047 class LevelSetEquationLaplacianTerm :
00048     public LevelSetEquationTermBase< TInput, TLevelSetContainer >
00049 {
00050 public:
00051   typedef LevelSetEquationLaplacianTerm         Self;
00052   typedef SmartPointer< Self >                  Pointer;
00053   typedef SmartPointer< const Self >            ConstPointer;
00054   typedef LevelSetEquationTermBase< TInput, TLevelSetContainer >
00055                                                 Superclass;
00056 
00058   itkNewMacro( Self );
00059 
00061   itkTypeMacro( LevelSetEquationLaplacianTerm,
00062                 LevelSetEquationTermBase );
00063 
00064   typedef typename Superclass::InputImageType     InputImageType;
00065   typedef typename Superclass::InputImagePointer  InputImagePointer;
00066   typedef typename Superclass::InputPixelType     InputPixelType;
00067   typedef typename Superclass::InputPixelRealType InputPixelRealType;
00068 
00069   typedef typename Superclass::LevelSetContainerType      LevelSetContainerType;
00070   typedef typename Superclass::LevelSetContainerPointer   LevelSetContainerPointer;
00071   typedef typename Superclass::LevelSetType               LevelSetType;
00072   typedef typename Superclass::LevelSetPointer            LevelSetPointer;
00073   typedef typename Superclass::LevelSetOutputPixelType    LevelSetOutputPixelType;
00074   typedef typename Superclass::LevelSetOutputRealType     LevelSetOutputRealType;
00075   typedef typename Superclass::LevelSetInputIndexType     LevelSetInputIndexType;
00076   typedef typename Superclass::LevelSetGradientType       LevelSetGradientType;
00077   typedef typename Superclass::LevelSetHessianType        LevelSetHessianType;
00078   typedef typename Superclass::LevelSetIdentifierType     LevelSetIdentifierType;
00079 
00080   typedef typename Superclass::HeavisideType         HeavisideType;
00081   typedef typename Superclass::HeavisideConstPointer HeavisideConstPointer;
00082 
00083   typedef typename Superclass::LevelSetDataType LevelSetDataType;
00084 
00085   itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);
00086 
00088   typedef ZeroFluxNeumannBoundaryCondition< InputImageType > DefaultBoundaryConditionType;
00089   typedef typename ConstNeighborhoodIterator< InputImageType >::RadiusType RadiusType;
00090   typedef ConstNeighborhoodIterator< InputImageType, DefaultBoundaryConditionType > NeighborhoodType;
00091 
00092   typedef Vector< LevelSetOutputRealType, itkGetStaticConstMacro(ImageDimension) > NeighborhoodScalesType;
00093 
00095   virtual void Update();
00096 
00098   virtual void InitializeParameters();
00099 
00101   virtual void Initialize( const LevelSetInputIndexType& );
00102 
00104   virtual void UpdatePixel( const LevelSetInputIndexType& iP,
00105                             const LevelSetOutputRealType& oldValue,
00106                             const LevelSetOutputRealType& newValue );
00107 
00108 protected:
00109   LevelSetEquationLaplacianTerm();
00110 
00111   virtual ~LevelSetEquationLaplacianTerm();
00112 
00115   LevelSetOutputRealType LaplacianSpeed( const LevelSetInputIndexType& iP ) const;
00116 
00119   virtual LevelSetOutputRealType Value( const LevelSetInputIndexType& iP );
00120 
00123   virtual LevelSetOutputRealType Value( const LevelSetInputIndexType& iP,
00124                                         const LevelSetDataType& iData );
00125 
00126 private:
00127   LevelSetEquationLaplacianTerm( const Self& ); // purposely not implemented
00128   void operator = ( const Self& ); // purposely not implemented
00129 };
00130 
00131 }
00132 #ifndef ITK_MANUAL_INSTANTIATION
00133 #include "itkLevelSetEquationLaplacianTerm.hxx"
00134 #endif
00135 #endif
00136