ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkLevelSetEquationChanAndVeseInternalTerm.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 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_ASSIGN(LevelSetEquationChanAndVeseInternalTerm);
54 
58  using Superclass = LevelSetEquationTermBase< TInput,
59  TLevelSetContainer >;
60 
62  itkNewMacro( Self );
63 
67 
68  using InputImageType = typename Superclass::InputImageType;
69  using InputImagePointer = typename Superclass::InputImagePointer;
70  using InputPixelType = typename Superclass::InputPixelType;
71  using InputPixelRealType = typename Superclass::InputPixelRealType;
72 
73  using LevelSetContainerType = typename Superclass::LevelSetContainerType;
74  using LevelSetContainerPointer = typename Superclass::LevelSetContainerPointer;
75  using LevelSetType = typename Superclass::LevelSetType;
76  using LevelSetPointer = typename Superclass::LevelSetPointer;
77  using LevelSetOutputPixelType = typename Superclass::LevelSetOutputPixelType;
78  using LevelSetOutputRealType = typename Superclass::LevelSetOutputRealType;
79  using LevelSetInputIndexType = typename Superclass::LevelSetInputIndexType;
80  using LevelSetGradientType = typename Superclass::LevelSetGradientType;
81  using LevelSetHessianType = typename Superclass::LevelSetHessianType;
82  using LevelSetIdentifierType = typename Superclass::LevelSetIdentifierType;
83 
84  using HeavisideType = typename Superclass::HeavisideType;
85  using HeavisideConstPointer = typename Superclass::HeavisideConstPointer;
86 
87  using LevelSetDataType = typename Superclass::LevelSetDataType;
88 
89  using DomainMapImageFilterType = typename Superclass::DomainMapImageFilterType;
90  using CacheImageType = typename Superclass::CacheImageType;
91 
92  itkSetMacro( Mean, InputPixelRealType );
93  itkGetMacro( Mean, InputPixelRealType );
94 
96  void Update() override;
97 
99  void InitializeParameters() override;
100 
102  void Initialize( const LevelSetInputIndexType& inputIndex ) override;
103 
105  virtual void ComputeProduct( const LevelSetInputIndexType& inputPixel,
106  LevelSetOutputRealType& prod );
107 
112  {}
113 
115  void UpdatePixel( const LevelSetInputIndexType& inputPixel,
116  const LevelSetOutputRealType & oldValue,
117  const LevelSetOutputRealType & newValue ) override;
118 
119 protected:
121 
122  ~LevelSetEquationChanAndVeseInternalTerm() override = default;
123 
126  LevelSetOutputRealType Value( const LevelSetInputIndexType& inputPixel ) override;
127 
130  LevelSetOutputRealType Value( const LevelSetInputIndexType& inputPixel,
131  const LevelSetDataType& data ) override;
132 
134  void Accumulate( const InputPixelType& inputPixel,
135  const LevelSetOutputRealType& heavisideValue );
136 
140 };
141 
142 }
143 #ifndef ITK_MANUAL_INSTANTIATION
144 #include "itkLevelSetEquationChanAndVeseInternalTerm.hxx"
145 #endif
146 
147 #endif
virtual void ComputeProductTerm(const LevelSetInputIndexType &, LevelSetOutputRealType &)
Light weight base class for most itk classes.
Class to represent the internal energy Chan And Vese term.
typename Superclass::LevelSetContainerPointer LevelSetContainerPointer
typename Superclass::DomainMapImageFilterType DomainMapImageFilterType
Abstract class to represents a term in the level-set evolution PDE.
typename Superclass::LevelSetContainerType LevelSetContainerType
typename Superclass::LevelSetOutputRealType LevelSetOutputRealType
typename Superclass::LevelSetInputIndexType LevelSetInputIndexType
typename Superclass::LevelSetOutputPixelType LevelSetOutputPixelType
typename Superclass::LevelSetIdentifierType LevelSetIdentifierType
typename Superclass::HeavisideConstPointer HeavisideConstPointer