ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkLevelSetEquationAdvectionTerm.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef itkLevelSetEquationAdvectionTerm_h
20 #define itkLevelSetEquationAdvectionTerm_h
21 
25 #include "itkVector.h"
26 #include "vnl/vnl_matrix_fixed.h"
27 
28 namespace itk
29 {
50 template< typename TInput, // Input image or mesh
51  typename TLevelSetContainer >
52 class ITK_TEMPLATE_EXPORT LevelSetEquationAdvectionTerm :
53  public LevelSetEquationTermBase< TInput, TLevelSetContainer >
54 {
55 public:
61 
63  itkNewMacro( Self );
64 
66  itkTypeMacro( LevelSetEquationAdvectionTerm,
68 
69  typedef typename Superclass::InputImageType InputImageType;
70  typedef typename Superclass::InputImagePointer InputImagePointer;
71  typedef typename Superclass::InputPixelType InputPixelType;
72  typedef typename Superclass::InputPixelRealType InputPixelRealType;
73 
74  typedef typename Superclass::LevelSetContainerType LevelSetContainerType;
75  typedef typename Superclass::LevelSetContainerPointer LevelSetContainerPointer;
76  typedef typename Superclass::LevelSetType LevelSetType;
77  typedef typename Superclass::LevelSetPointer LevelSetPointer;
78  typedef typename Superclass::LevelSetOutputPixelType LevelSetOutputPixelType;
79  typedef typename Superclass::LevelSetOutputRealType LevelSetOutputRealType;
80  typedef typename Superclass::LevelSetInputIndexType LevelSetInputIndexType;
81  typedef typename Superclass::LevelSetGradientType LevelSetGradientType;
82  typedef typename Superclass::LevelSetHessianType LevelSetHessianType;
83  typedef typename Superclass::LevelSetIdentifierType LevelSetIdentifierType;
84  typedef typename Superclass::LevelSetDataType LevelSetDataType;
85 
86  typedef typename Superclass::HeavisideType HeavisideType;
87  typedef typename Superclass::HeavisideConstPointer HeavisideConstPointer;
88 
89  itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);
90 
92 
95 
96 
97  void SetAdvectionImage( AdvectionImageType* iImage );
98  itkGetModifiableObjectMacro(AdvectionImage, AdvectionImageType );
99 
100  itkSetMacro( DerivativeSigma, LevelSetOutputRealType );
101  itkGetMacro( DerivativeSigma, LevelSetOutputRealType );
102 
107 
109 
111  virtual void Update() ITK_OVERRIDE;
112 
114  virtual void InitializeParameters() ITK_OVERRIDE;
115 
117  virtual void Initialize( const LevelSetInputIndexType& ) ITK_OVERRIDE;
118 
120  virtual void UpdatePixel( const LevelSetInputIndexType& iP,
121  const LevelSetOutputRealType& oldValue,
122  const LevelSetOutputRealType& newValue ) ITK_OVERRIDE;
123 
124 protected:
126 
127  virtual ~LevelSetEquationAdvectionTerm() ITK_OVERRIDE;
128 
129  AdvectionImagePointer m_AdvectionImage;
130 
133  VectorType AdvectionSpeed( const LevelSetInputIndexType& iP ) const;
134 
137  virtual LevelSetOutputRealType Value( const LevelSetInputIndexType& iP ) ITK_OVERRIDE;
138  virtual LevelSetOutputRealType Value( const LevelSetInputIndexType& iP,
139  const LevelSetDataType& iData ) ITK_OVERRIDE;
141 
142  LevelSetOutputRealType m_NeighborhoodScales[ImageDimension];
143 
144 private:
145  ITK_DISALLOW_COPY_AND_ASSIGN(LevelSetEquationAdvectionTerm);
146 
147  LevelSetOutputRealType m_DerivativeSigma;
148 
149  bool m_AutoGenerateAdvectionImage;
150 
151  void GenerateAdvectionImage();
152 };
153 
154 }
155 
156 #ifndef ITK_MANUAL_INSTANTIATION
157 #include "itkLevelSetEquationAdvectionTerm.hxx"
158 #endif
159 
160 #endif
Light weight base class for most itk classes.
Vector< LevelSetOutputRealType, itkGetStaticConstMacro(ImageDimension) > NeighborhoodScalesType
ZeroFluxNeumannBoundaryCondition< InputImageType > DefaultBoundaryConditionType
ConstNeighborhoodIterator< InputImageType, DefaultBoundaryConditionType > NeighborhoodType
Superclass::LevelSetGradientType LevelSetGradientType
Superclass::LevelSetIdentifierType LevelSetIdentifierType
Superclass::LevelSetOutputPixelType LevelSetOutputPixelType
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Superclass::LevelSetOutputRealType LevelSetOutputRealType
ConstNeighborhoodIterator< InputImageType >::RadiusType RadiusType
Superclass::InputPixelRealType InputPixelRealType
Abstract class to represents a term in the level-set evolution PDE.
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
Superclass::LevelSetContainerPointer LevelSetContainerPointer
Image< VectorType, itkGetStaticConstMacro(ImageDimension) > AdvectionImageType
LevelSetEquationTermBase< TInput, TLevelSetContainer > Superclass
Superclass::LevelSetContainerType LevelSetContainerType
Superclass::HeavisideConstPointer HeavisideConstPointer
Superclass::LevelSetHessianType LevelSetHessianType
Superclass::LevelSetInputIndexType LevelSetInputIndexType
Derived class to represents an advection term in the level-set evolution PDE.
Templated n-dimensional image class.
Definition: itkImage.h:75