ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkLevelSetEquationCurvatureTerm.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 __itkLevelSetEquationCurvatureTerm_h
00020 #define __itkLevelSetEquationCurvatureTerm_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 {
00046 template< class TInput, // Input image or mesh
00047           class TLevelSetContainer >
00048 class LevelSetEquationCurvatureTerm :
00049     public LevelSetEquationTermBase< TInput, TLevelSetContainer >
00050 {
00051 public:
00052   typedef LevelSetEquationCurvatureTerm         Self;
00053   typedef SmartPointer< Self >                  Pointer;
00054   typedef SmartPointer< const Self >            ConstPointer;
00055   typedef LevelSetEquationTermBase< TInput, TLevelSetContainer >
00056                                                 Superclass;
00058 
00060   itkNewMacro( Self );
00061 
00063   itkTypeMacro( LevelSetEquationCurvatureTerm,
00064                 LevelSetEquationTermBase );
00065 
00066   typedef typename Superclass::InputImageType     InputImageType;
00067   typedef typename Superclass::InputImagePointer  InputImagePointer;
00068   typedef typename Superclass::InputPixelType     InputPixelType;
00069   typedef typename Superclass::InputPixelRealType InputPixelRealType;
00070 
00071   typedef typename Superclass::LevelSetContainerType      LevelSetContainerType;
00072   typedef typename Superclass::LevelSetContainerPointer   LevelSetContainerPointer;
00073   typedef typename Superclass::LevelSetType               LevelSetType;
00074   typedef typename Superclass::LevelSetPointer            LevelSetPointer;
00075   typedef typename Superclass::LevelSetOutputPixelType    LevelSetOutputPixelType;
00076   typedef typename Superclass::LevelSetOutputRealType     LevelSetOutputRealType;
00077   typedef typename Superclass::LevelSetInputIndexType     LevelSetInputIndexType;
00078   typedef typename Superclass::LevelSetGradientType       LevelSetGradientType;
00079   typedef typename Superclass::LevelSetHessianType        LevelSetHessianType;
00080   typedef typename Superclass::LevelSetIdentifierType     LevelSetIdentifierType;
00081 
00082   typedef typename Superclass::HeavisideType         HeavisideType;
00083   typedef typename Superclass::HeavisideConstPointer HeavisideConstPointer;
00084 
00085   typedef typename Superclass::LevelSetDataType LevelSetDataType;
00086 
00087   itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);
00088 
00090   typedef ZeroFluxNeumannBoundaryCondition< InputImageType > DefaultBoundaryConditionType;
00091   typedef typename ConstNeighborhoodIterator< InputImageType >::RadiusType RadiusType;
00092   typedef ConstNeighborhoodIterator< InputImageType, DefaultBoundaryConditionType > NeighborhoodType;
00093 
00094   typedef Vector< LevelSetOutputRealType, itkGetStaticConstMacro(ImageDimension) > NeighborhoodScalesType;
00095 
00097   virtual void Update();
00098 
00100   virtual void InitializeParameters();
00101 
00103   virtual void Initialize( const LevelSetInputIndexType& );
00104 
00106   virtual void UpdatePixel( const LevelSetInputIndexType& iP,
00107                             const LevelSetOutputRealType& oldValue,
00108                             const LevelSetOutputRealType& newValue );
00109 
00110 protected:
00111   LevelSetEquationCurvatureTerm();
00112 
00113   virtual ~LevelSetEquationCurvatureTerm();
00114 
00117   virtual LevelSetOutputRealType Value( const LevelSetInputIndexType& iP );
00118 
00121   virtual LevelSetOutputRealType Value( const LevelSetInputIndexType& iP, const LevelSetDataType& iData );
00122 
00123   LevelSetOutputRealType  m_NeighborhoodScales[ImageDimension];
00124 
00125 private:
00126   LevelSetEquationCurvatureTerm( const Self& ); // purposely not implemented
00127   void operator = ( const Self& ); // purposely not implemented
00128 };
00129 
00130 }
00131 
00132 #ifndef ITK_MANUAL_INSTANTIATION
00133 #include "itkLevelSetEquationCurvatureTerm.hxx"
00134 #endif
00135 
00136 #endif
00137