ITK  5.3.0
Insight Toolkit
itkLevelSetEquationChanAndVeseInternalTerm.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 itkLevelSetEquationChanAndVeseInternalTerm_h
20 #define itkLevelSetEquationChanAndVeseInternalTerm_h
21 
23 
24 namespace itk
25 {
46 template <typename TInput, // Input image or mesh
47  typename TLevelSetContainer>
48 class ITK_TEMPLATE_EXPORT LevelSetEquationChanAndVeseInternalTerm
49  : public LevelSetEquationTermBase<TInput, TLevelSetContainer>
50 {
51 public:
52  ITK_DISALLOW_COPY_AND_MOVE(LevelSetEquationChanAndVeseInternalTerm);
54 
59 
61  itkNewMacro(Self);
62 
65 
66  using typename Superclass::InputImageType;
67  using typename Superclass::InputImagePointer;
68  using typename Superclass::InputPixelType;
69  using typename Superclass::InputPixelRealType;
70 
71  using typename Superclass::LevelSetContainerType;
72  using typename Superclass::LevelSetContainerPointer;
73  using typename Superclass::LevelSetType;
74  using typename Superclass::LevelSetPointer;
75  using typename Superclass::LevelSetOutputPixelType;
76  using typename Superclass::LevelSetOutputRealType;
77  using typename Superclass::LevelSetInputIndexType;
78  using typename Superclass::LevelSetGradientType;
79  using typename Superclass::LevelSetHessianType;
80  using typename Superclass::LevelSetIdentifierType;
81 
82  using typename Superclass::HeavisideType;
83  using typename Superclass::HeavisideConstPointer;
84 
85  using typename Superclass::LevelSetDataType;
86 
87  using typename Superclass::DomainMapImageFilterType;
88  using typename Superclass::CacheImageType;
89 
90  itkSetMacro(Mean, InputPixelRealType);
91  itkGetMacro(Mean, InputPixelRealType);
92 
94  void
95  Update() override;
96 
98  void
99  InitializeParameters() override;
100 
102  void
103  Initialize(const LevelSetInputIndexType & inputIndex) override;
104 
106  virtual void
107  ComputeProduct(const LevelSetInputIndexType & inputIndex, LevelSetOutputRealType & prod);
108 
111  virtual void
112  ComputeProductTerm(const LevelSetInputIndexType &, LevelSetOutputRealType &)
113  {}
114 
116  void
117  UpdatePixel(const LevelSetInputIndexType & inputIndex,
118  const LevelSetOutputRealType & oldValue,
119  const LevelSetOutputRealType & newValue) override;
120 
121 protected:
123 
124  ~LevelSetEquationChanAndVeseInternalTerm() override = default;
125 
128  LevelSetOutputRealType
129  Value(const LevelSetInputIndexType & inputIndex) override;
130 
133  LevelSetOutputRealType
134  Value(const LevelSetInputIndexType & inputIndex, const LevelSetDataType & data) override;
135 
137  void
138  Accumulate(const InputPixelType & inputPixel, const LevelSetOutputRealType & heavisideValue);
139 
140  InputPixelRealType m_Mean;
141  InputPixelRealType m_TotalValue;
142  LevelSetOutputRealType m_TotalH;
143 };
144 
145 } // namespace itk
146 #ifndef ITK_MANUAL_INSTANTIATION
147 # include "itkLevelSetEquationChanAndVeseInternalTerm.hxx"
148 #endif
149 
150 #endif
itk::LevelSetEquationChanAndVeseInternalTerm::m_TotalValue
InputPixelRealType m_TotalValue
Definition: itkLevelSetEquationChanAndVeseInternalTerm.h:141
itk::LevelSetEquationChanAndVeseInternalTerm::ComputeProductTerm
virtual void ComputeProductTerm(const LevelSetInputIndexType &, LevelSetOutputRealType &)
Definition: itkLevelSetEquationChanAndVeseInternalTerm.h:112
itk::SmartPointer< Self >
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetInputIndexType
typename LevelSetContainerType::InputIndexType LevelSetInputIndexType
Definition: itkLevelSetEquationTermBase.h:76
itk::LevelSetEquationChanAndVeseInternalTerm::m_TotalH
LevelSetOutputRealType m_TotalH
Definition: itkLevelSetEquationChanAndVeseInternalTerm.h:142
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::LevelSetEquationChanAndVeseInternalTerm
Class to represent the internal energy Chan And Vese term.
Definition: itkLevelSetEquationChanAndVeseInternalTerm.h:48
itkLevelSetEquationTermBase.h
itk::LevelSetEquationChanAndVeseInternalTerm::m_Mean
InputPixelRealType m_Mean
Definition: itkLevelSetEquationChanAndVeseInternalTerm.h:140