ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkLevelSetEquationPropagationTerm.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 __itkLevelSetEquationPropagationTerm_h
00020 #define __itkLevelSetEquationPropagationTerm_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 TPropagationImage = TInput >
00049 class LevelSetEquationPropagationTerm :
00050     public LevelSetEquationTermBase< TInput, TLevelSetContainer >
00051 {
00052 public:
00053   typedef LevelSetEquationPropagationTerm       Self;
00054   typedef SmartPointer< Self >                  Pointer;
00055   typedef SmartPointer< const Self >            ConstPointer;
00056   typedef LevelSetEquationTermBase< TInput, TLevelSetContainer >
00057                                                 Superclass;
00058 
00060   itkNewMacro( Self );
00061 
00063   itkTypeMacro( LevelSetEquationPropagationTerm,
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   typedef typename Superclass::LevelSetDataType           LevelSetDataType;
00082 
00083   typedef typename Superclass::HeavisideType         HeavisideType;
00084   typedef typename Superclass::HeavisideConstPointer HeavisideConstPointer;
00085 
00086   itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);
00087 
00088   typedef TPropagationImage                       PropagationImageType;
00089   typedef typename PropagationImageType::Pointer  PropagationImagePointer;
00090 
00092   typedef ZeroFluxNeumannBoundaryCondition< InputImageType > DefaultBoundaryConditionType;
00093   typedef typename ConstNeighborhoodIterator< InputImageType >::RadiusType RadiusType;
00094   typedef ConstNeighborhoodIterator< InputImageType, DefaultBoundaryConditionType > NeighborhoodType;
00095 
00096   typedef Vector< LevelSetOutputRealType, itkGetStaticConstMacro(ImageDimension) > NeighborhoodScalesType;
00097 
00101   itkSetObjectMacro( PropagationImage, PropagationImageType );
00102   itkGetObjectMacro( PropagationImage, PropagationImageType );
00104 
00106   virtual void Update();
00107 
00109   virtual void InitializeParameters();
00110 
00112   virtual void Initialize( const LevelSetInputIndexType& );
00113 
00115   virtual void UpdatePixel( const LevelSetInputIndexType& iP,
00116                             const LevelSetOutputRealType& oldValue,
00117                             const LevelSetOutputRealType& newValue );
00118 
00119 protected:
00120   LevelSetEquationPropagationTerm();
00121 
00122   virtual ~LevelSetEquationPropagationTerm();
00123 
00124   PropagationImagePointer m_PropagationImage;
00125 
00128   LevelSetOutputRealType PropagationSpeed( const LevelSetInputIndexType& iP ) const;
00129 
00132   virtual LevelSetOutputRealType Value( const LevelSetInputIndexType& iP );
00133   virtual LevelSetOutputRealType Value( const LevelSetInputIndexType& iP,
00134                                         const LevelSetDataType& iData );
00136 
00137 private:
00138   LevelSetEquationPropagationTerm( const Self& ); // purposely not implemented
00139   void operator = ( const Self& ); // purposely not implemented
00140 };
00141 
00142 }
00143 
00144 #ifndef ITK_MANUAL_INSTANTIATION
00145 #include "itkLevelSetEquationPropagationTerm.hxx"
00146 #endif
00147 
00148 #endif
00149