ITK  5.0.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:
56  ITK_DISALLOW_COPY_AND_ASSIGN(LevelSetEquationAdvectionTerm);
58 
63 
65  itkNewMacro( Self );
66 
68  itkTypeMacro( LevelSetEquationAdvectionTerm,
70 
71  using InputImageType = typename Superclass::InputImageType;
72  using InputImagePointer = typename Superclass::InputImagePointer;
73  using InputPixelType = typename Superclass::InputPixelType;
74  using InputPixelRealType = typename Superclass::InputPixelRealType;
75 
76  using LevelSetContainerType = typename Superclass::LevelSetContainerType;
77  using LevelSetContainerPointer = typename Superclass::LevelSetContainerPointer;
78  using LevelSetType = typename Superclass::LevelSetType;
79  using LevelSetPointer = typename Superclass::LevelSetPointer;
80  using LevelSetOutputPixelType = typename Superclass::LevelSetOutputPixelType;
81  using LevelSetOutputRealType = typename Superclass::LevelSetOutputRealType;
82  using LevelSetInputIndexType = typename Superclass::LevelSetInputIndexType;
83  using LevelSetGradientType = typename Superclass::LevelSetGradientType;
84  using LevelSetHessianType = typename Superclass::LevelSetHessianType;
85  using LevelSetIdentifierType = typename Superclass::LevelSetIdentifierType;
86  using LevelSetDataType = typename Superclass::LevelSetDataType;
87 
88  using HeavisideType = typename Superclass::HeavisideType;
89  using HeavisideConstPointer = typename Superclass::HeavisideConstPointer;
90 
91  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
92 
94 
97 
98 
99  void SetAdvectionImage( AdvectionImageType* iImage );
100  itkGetModifiableObjectMacro(AdvectionImage, AdvectionImageType );
101 
102  itkSetMacro( DerivativeSigma, LevelSetOutputRealType );
103  itkGetMacro( DerivativeSigma, LevelSetOutputRealType );
104 
109 
111 
113  void Update() override;
114 
116  void InitializeParameters() override;
117 
119  void Initialize( const LevelSetInputIndexType& ) override;
120 
122  void UpdatePixel( const LevelSetInputIndexType& iP,
123  const LevelSetOutputRealType& oldValue,
124  const LevelSetOutputRealType& newValue ) override;
125 
126 protected:
128 
129  ~LevelSetEquationAdvectionTerm() override = default;
130 
132 
135  VectorType AdvectionSpeed( const LevelSetInputIndexType& iP ) const;
136 
139  LevelSetOutputRealType Value( const LevelSetInputIndexType& iP ) override;
141  const LevelSetDataType& iData ) override;
143 
144  LevelSetOutputRealType m_NeighborhoodScales[ImageDimension];
145 
146 private:
148 
150 
151  void GenerateAdvectionImage();
152 };
153 
154 }
155 
156 #ifndef ITK_MANUAL_INSTANTIATION
157 #include "itkLevelSetEquationAdvectionTerm.hxx"
158 #endif
159 
160 #endif
typename Superclass::LevelSetIdentifierType LevelSetIdentifierType
typename Superclass::LevelSetOutputPixelType LevelSetOutputPixelType
typename Superclass::LevelSetContainerType LevelSetContainerType
typename Superclass::HeavisideType HeavisideType
Light weight base class for most itk classes.
typename Superclass::LevelSetPointer LevelSetPointer
typename ConstNeighborhoodIterator< InputImageType >::RadiusType RadiusType
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename Superclass::InputImageType InputImageType
typename Superclass::LevelSetType LevelSetType
Abstract class to represents a term in the level-set evolution PDE.
typename Superclass::LevelSetHessianType LevelSetHessianType
typename Superclass::LevelSetInputIndexType LevelSetInputIndexType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
typename AdvectionImageType::Pointer AdvectionImagePointer
typename Superclass::HeavisideConstPointer HeavisideConstPointer
typename Superclass::LevelSetOutputRealType LevelSetOutputRealType
typename Superclass::InputPixelType InputPixelType
typename Superclass::InputPixelRealType InputPixelRealType
typename Superclass::LevelSetGradientType LevelSetGradientType
typename Superclass::RadiusType RadiusType
typename Superclass::LevelSetContainerPointer LevelSetContainerPointer
typename Superclass::InputImagePointer InputImagePointer
Derived class to represents an advection term in the level-set evolution PDE.
typename Superclass::LevelSetDataType LevelSetDataType
Templated n-dimensional image class.
Definition: itkImage.h:75