ITK  5.2.0
Insight Toolkit
itkLevelSetEquationAdvectionTerm.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 : public LevelSetEquationTermBase<TInput, TLevelSetContainer>
53 {
54 public:
55  ITK_DISALLOW_COPY_AND_MOVE(LevelSetEquationAdvectionTerm);
57 
62 
64  itkNewMacro(Self);
65 
68 
69  using InputImageType = typename Superclass::InputImageType;
70  using InputImagePointer = typename Superclass::InputImagePointer;
71  using InputPixelType = typename Superclass::InputPixelType;
72  using InputPixelRealType = typename Superclass::InputPixelRealType;
73 
74  using LevelSetContainerType = typename Superclass::LevelSetContainerType;
75  using LevelSetContainerPointer = typename Superclass::LevelSetContainerPointer;
76  using LevelSetType = typename Superclass::LevelSetType;
77  using LevelSetPointer = typename Superclass::LevelSetPointer;
78  using LevelSetOutputPixelType = typename Superclass::LevelSetOutputPixelType;
79  using LevelSetOutputRealType = typename Superclass::LevelSetOutputRealType;
80  using LevelSetInputIndexType = typename Superclass::LevelSetInputIndexType;
81  using LevelSetGradientType = typename Superclass::LevelSetGradientType;
82  using LevelSetHessianType = typename Superclass::LevelSetHessianType;
83  using LevelSetIdentifierType = typename Superclass::LevelSetIdentifierType;
84  using LevelSetDataType = typename Superclass::LevelSetDataType;
85 
86  using HeavisideType = typename Superclass::HeavisideType;
87  using HeavisideConstPointer = typename Superclass::HeavisideConstPointer;
88 
89  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
90 
92 
95 
96 
97  void
98  SetAdvectionImage(AdvectionImageType * iImage);
99  itkGetModifiableObjectMacro(AdvectionImage, AdvectionImageType);
100 
101  itkSetMacro(DerivativeSigma, LevelSetOutputRealType);
102  itkGetMacro(DerivativeSigma, LevelSetOutputRealType);
103 
108 
110 
112  void
113  Update() override;
114 
116  void
117  InitializeParameters() override;
118 
120  void
121  Initialize(const LevelSetInputIndexType &) override;
122 
124  void
125  UpdatePixel(const LevelSetInputIndexType & iP,
126  const LevelSetOutputRealType & oldValue,
127  const LevelSetOutputRealType & newValue) override;
128 
129 protected:
131 
132  ~LevelSetEquationAdvectionTerm() override = default;
133 
135 
138  VectorType
139  AdvectionSpeed(const LevelSetInputIndexType & iP) const;
140 
144  Value(const LevelSetInputIndexType & iP) override;
146  Value(const LevelSetInputIndexType & iP, const LevelSetDataType & iData) override;
148 
149  LevelSetOutputRealType m_NeighborhoodScales[ImageDimension];
150 
151 private:
153 
155 
156  void
157  GenerateAdvectionImage();
158 };
159 
160 } // namespace itk
161 
162 #ifndef ITK_MANUAL_INSTANTIATION
163 # include "itkLevelSetEquationAdvectionTerm.hxx"
164 #endif
165 
166 #endif
itk::LevelSetEquationAdvectionTerm::m_AdvectionImage
AdvectionImagePointer m_AdvectionImage
Definition: itkLevelSetEquationAdvectionTerm.h:134
itk::LevelSetEquationAdvectionTerm::m_AutoGenerateAdvectionImage
bool m_AutoGenerateAdvectionImage
Definition: itkLevelSetEquationAdvectionTerm.h:154
itk::ConstNeighborhoodIterator::RadiusType
typename Superclass::RadiusType RadiusType
Definition: itkConstNeighborhoodIterator.h:71
itkConstNeighborhoodIterator.h
itk::LevelSetEquationAdvectionTerm::LevelSetContainerPointer
typename Superclass::LevelSetContainerPointer LevelSetContainerPointer
Definition: itkLevelSetEquationAdvectionTerm.h:75
itk::LevelSetEquationAdvectionTerm::LevelSetContainerType
typename Superclass::LevelSetContainerType LevelSetContainerType
Definition: itkLevelSetEquationAdvectionTerm.h:74
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::LevelSetEquationAdvectionTerm::HeavisideConstPointer
typename Superclass::HeavisideConstPointer HeavisideConstPointer
Definition: itkLevelSetEquationAdvectionTerm.h:87
itk::SmartPointer< Self >
itk::LevelSetEquationAdvectionTerm::LevelSetOutputPixelType
typename Superclass::LevelSetOutputPixelType LevelSetOutputPixelType
Definition: itkLevelSetEquationAdvectionTerm.h:78
itk::LevelSetEquationAdvectionTerm::LevelSetIdentifierType
typename Superclass::LevelSetIdentifierType LevelSetIdentifierType
Definition: itkLevelSetEquationAdvectionTerm.h:83
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::LevelSetEquationAdvectionTerm::VectorType
LevelSetGradientType VectorType
Definition: itkLevelSetEquationAdvectionTerm.h:91
itk::LevelSetEquationAdvectionTerm::InputImagePointer
typename Superclass::InputImagePointer InputImagePointer
Definition: itkLevelSetEquationAdvectionTerm.h:70
itk::LevelSetEquationAdvectionTerm::LevelSetInputIndexType
typename Superclass::LevelSetInputIndexType LevelSetInputIndexType
Definition: itkLevelSetEquationAdvectionTerm.h:80
itk::LevelSetEquationAdvectionTerm::LevelSetPointer
typename Superclass::LevelSetPointer LevelSetPointer
Definition: itkLevelSetEquationAdvectionTerm.h:77
itk::LevelSetEquationAdvectionTerm::LevelSetType
typename Superclass::LevelSetType LevelSetType
Definition: itkLevelSetEquationAdvectionTerm.h:76
itk::LevelSetEquationAdvectionTerm::LevelSetGradientType
typename Superclass::LevelSetGradientType LevelSetGradientType
Definition: itkLevelSetEquationAdvectionTerm.h:81
itk::LevelSetEquationAdvectionTerm::InputPixelRealType
typename Superclass::InputPixelRealType InputPixelRealType
Definition: itkLevelSetEquationAdvectionTerm.h:72
itk::LevelSetEquationTermBase
Abstract class to represents a term in the level-set evolution PDE.
Definition: itkLevelSetEquationTermBase.h:49
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ConstNeighborhoodIterator
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Definition: itkConstNeighborhoodIterator.h:51
itk::LevelSetEquationAdvectionTerm::AdvectionImagePointer
typename AdvectionImageType::Pointer AdvectionImagePointer
Definition: itkLevelSetEquationAdvectionTerm.h:94
itkVector.h
itk::LevelSetEquationAdvectionTerm::InputImageType
typename Superclass::InputImageType InputImageType
Definition: itkLevelSetEquationAdvectionTerm.h:69
itk::LevelSetEquationAdvectionTerm::m_DerivativeSigma
LevelSetOutputRealType m_DerivativeSigma
Definition: itkLevelSetEquationAdvectionTerm.h:152
itk::LevelSetEquationAdvectionTerm::InputPixelType
typename Superclass::InputPixelType InputPixelType
Definition: itkLevelSetEquationAdvectionTerm.h:71
itk::LevelSetEquationAdvectionTerm::RadiusType
typename ConstNeighborhoodIterator< InputImageType >::RadiusType RadiusType
Definition: itkLevelSetEquationAdvectionTerm.h:106
itk::LevelSetEquationAdvectionTerm::LevelSetOutputRealType
typename Superclass::LevelSetOutputRealType LevelSetOutputRealType
Definition: itkLevelSetEquationAdvectionTerm.h:79
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::LevelSetEquationAdvectionTerm
Derived class to represents an advection term in the level-set evolution PDE.
Definition: itkLevelSetEquationAdvectionTerm.h:52
itkLevelSetEquationTermBase.h
itk::ZeroFluxNeumannBoundaryCondition< InputImageType >
itk::LevelSetEquationAdvectionTerm::LevelSetHessianType
typename Superclass::LevelSetHessianType LevelSetHessianType
Definition: itkLevelSetEquationAdvectionTerm.h:82
itkZeroFluxNeumannBoundaryCondition.h
itk::LevelSetEquationAdvectionTerm::LevelSetDataType
typename Superclass::LevelSetDataType LevelSetDataType
Definition: itkLevelSetEquationAdvectionTerm.h:84
itk::LevelSetEquationAdvectionTerm::HeavisideType
typename Superclass::HeavisideType HeavisideType
Definition: itkLevelSetEquationAdvectionTerm.h:86