ITK  5.2.0
Insight Toolkit
itkLevelSetEquationTermBase.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 itkLevelSetEquationTermBase_h
20 #define itkLevelSetEquationTermBase_h
21 
22 #include "itkObject.h"
24 #include <unordered_set>
25 
26 namespace itk
27 {
47 template <typename TInputImage, // Input image
48  typename TLevelSetContainer>
49 class ITK_TEMPLATE_EXPORT LevelSetEquationTermBase : public Object
50 {
51 public:
52  ITK_DISALLOW_COPY_AND_ASSIGN(LevelSetEquationTermBase);
54 
58  using Superclass = Object;
59 
61  itkTypeMacro(LevelSetEquationTermBase, Object);
62 
63  using InputImageType = TInputImage;
64  using InputImagePointer = typename InputImageType::Pointer;
65  using InputPixelType = typename InputImageType::PixelType;
67 
69  using LevelSetContainerType = TLevelSetContainer;
70  using LevelSetIdentifierType = typename LevelSetContainerType::LevelSetIdentifierType;
71  using LevelSetContainerPointer = typename LevelSetContainerType::Pointer;
72  using LevelSetType = typename LevelSetContainerType::LevelSetType;
73  using LevelSetPointer = typename LevelSetContainerType::LevelSetPointer;
74  using LevelSetOutputPixelType = typename LevelSetContainerType::OutputType;
75  using LevelSetOutputRealType = typename LevelSetContainerType::OutputRealType;
76  using LevelSetInputIndexType = typename LevelSetContainerType::InputIndexType;
77  using LevelSetGradientType = typename LevelSetContainerType::GradientType;
78  using LevelSetHessianType = typename LevelSetContainerType::HessianType;
79  using LevelSetDataType = typename LevelSetContainerType::LevelSetDataType;
80 
81  using DomainMapImageFilterType = typename LevelSetContainerType::DomainMapImageFilterType;
82  using CacheImageType = typename LevelSetContainerType::CacheImageType;
83 
85  // using HeavisidePointer = typename HeavisideType::Pointer;
87 
89  itkSetObjectMacro(Input, InputImageType);
90  itkGetModifiableObjectMacro(Input, InputImageType);
92 
93  itkSetMacro(Coefficient, LevelSetOutputRealType);
94  itkGetMacro(Coefficient, LevelSetOutputRealType);
95 
96  itkSetMacro(CurrentLevelSetId, LevelSetIdentifierType);
97  itkGetMacro(CurrentLevelSetId, LevelSetIdentifierType);
98 
99  itkGetModifiableObjectMacro(CurrentLevelSetPointer, LevelSetType);
100 
101  virtual void
102  SetLevelSetContainer(LevelSetContainerType * ptr);
103  itkGetModifiableObjectMacro(LevelSetContainer, LevelSetContainerType);
104 
108  virtual LevelSetOutputRealType
109  Evaluate(const LevelSetInputIndexType & iP);
110 
111  virtual LevelSetOutputRealType
112  Evaluate(const LevelSetInputIndexType & iP, const LevelSetDataType & iData);
113 
115  virtual void
116  Initialize(const LevelSetInputIndexType & iP) = 0;
117 
119  virtual void
120  InitializeParameters() = 0;
121 
123  virtual void
124  UpdatePixel(const LevelSetInputIndexType & iP,
125  const LevelSetOutputRealType & oldValue,
126  const LevelSetOutputRealType & newValue) = 0;
127 
129  itkGetConstMacro(CFLContribution, LevelSetOutputRealType);
130 
132  itkSetStringMacro(TermName);
133  itkGetStringMacro(TermName);
135 
137  virtual void
138  Update() = 0;
139 
140  using RequiredDataType = std::unordered_set<std::string>;
141 
142  const RequiredDataType &
143  GetRequiredData() const;
144 
145 protected:
148 
150  ~LevelSetEquationTermBase() override = default;
151 
152  void
153  SetUp();
154 
159  virtual LevelSetOutputRealType
160  Value(const LevelSetInputIndexType & iP) = 0;
161 
162  virtual LevelSetOutputRealType
163  Value(const LevelSetInputIndexType & iP, const LevelSetDataType & iData) = 0;
164 
167 
170 
173 
175 
178 
183 
188 
192  std::string m_TermName;
193 
195 };
196 } // namespace itk
197 
198 #ifndef ITK_MANUAL_INSTANTIATION
199 # include "itkLevelSetEquationTermBase.hxx"
200 #endif
201 
202 #endif
itk::LevelSetEquationTermBase::m_CFLContribution
LevelSetOutputRealType m_CFLContribution
Definition: itkLevelSetEquationTermBase.h:182
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::RequiredDataType
std::unordered_set< std::string > RequiredDataType
Definition: itkLevelSetEquationTermBase.h:140
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetIdentifierType
typename LevelSetContainerType::LevelSetIdentifierType LevelSetIdentifierType
Definition: itkLevelSetEquationTermBase.h:70
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetContainerType
TLevelSetContainer LevelSetContainerType
Definition: itkLevelSetEquationTermBase.h:69
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetHessianType
typename LevelSetContainerType::HessianType LevelSetHessianType
Definition: itkLevelSetEquationTermBase.h:78
itk::LevelSetEquationTermBase::m_CurrentLevelSetId
LevelSetIdentifierType m_CurrentLevelSetId
Definition: itkLevelSetEquationTermBase.h:172
itk::LevelSetEquationTermBase::m_TermName
std::string m_TermName
Definition: itkLevelSetEquationTermBase.h:192
itk::LevelSetEquationTermBase::m_Heaviside
HeavisideConstPointer m_Heaviside
Definition: itkLevelSetEquationTermBase.h:187
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetType
typename LevelSetContainerType::LevelSetType LevelSetType
Definition: itkLevelSetEquationTermBase.h:72
itk::LevelSetEquationTermBase::m_Input
InputImagePointer m_Input
Definition: itkLevelSetEquationTermBase.h:166
itk::LevelSetEquationTermBase::m_Coefficient
LevelSetOutputRealType m_Coefficient
Definition: itkLevelSetEquationTermBase.h:177
itk::SmartPointer< Self >
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::DomainMapImageFilterType
typename LevelSetContainerType::DomainMapImageFilterType DomainMapImageFilterType
Definition: itkLevelSetEquationTermBase.h:81
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::HeavisideStepFunctionBase
Base class of the Heaviside function.
Definition: itkHeavisideStepFunctionBase.h:54
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetInputIndexType
typename LevelSetContainerType::InputIndexType LevelSetInputIndexType
Definition: itkLevelSetEquationTermBase.h:76
itk::LevelSetEquationTermBase::m_CurrentLevelSetPointer
LevelSetPointer m_CurrentLevelSetPointer
Definition: itkLevelSetEquationTermBase.h:174
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::HeavisideConstPointer
typename HeavisideType::ConstPointer HeavisideConstPointer
Definition: itkLevelSetEquationTermBase.h:86
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::InputPixelRealType
typename NumericTraits< InputPixelType >::RealType InputPixelRealType
Definition: itkLevelSetEquationTermBase.h:66
itk::LevelSetContainer
Container of Level-Sets.
Definition: itkLevelSetContainer.h:39
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::CacheImageType
typename LevelSetContainerType::CacheImageType CacheImageType
Definition: itkLevelSetEquationTermBase.h:82
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetOutputPixelType
typename LevelSetContainerType::OutputType LevelSetOutputPixelType
Definition: itkLevelSetEquationTermBase.h:74
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetPointer
typename LevelSetContainerType::LevelSetPointer LevelSetPointer
Definition: itkLevelSetEquationTermBase.h:73
itkObject.h
itk::LevelSetEquationTermBase
Abstract class to represents a term in the level-set evolution PDE.
Definition: itkLevelSetEquationTermBase.h:49
itk::LevelSetEquationTermBase::m_RequiredData
RequiredDataType m_RequiredData
Definition: itkLevelSetEquationTermBase.h:194
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::InputImageType
TInput InputImageType
Definition: itkLevelSetEquationTermBase.h:63
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetContainerPointer
typename LevelSetContainerType::Pointer LevelSetContainerPointer
Definition: itkLevelSetEquationTermBase.h:71
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetDataType
typename LevelSetContainerType::LevelSetDataType LevelSetDataType
Definition: itkLevelSetEquationTermBase.h:79
itkHeavisideStepFunctionBase.h
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkLevelSetEquationTermBase.h:65
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetGradientType
typename LevelSetContainerType::GradientType LevelSetGradientType
Definition: itkLevelSetEquationTermBase.h:77
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::LevelSetOutputRealType
typename LevelSetContainerType::OutputRealType LevelSetOutputRealType
Definition: itkLevelSetEquationTermBase.h:75
itk::LevelSetEquationTermBase::m_LevelSetContainer
LevelSetContainerPointer m_LevelSetContainer
Definition: itkLevelSetEquationTermBase.h:169
itk::LevelSetEquationTermBase< TInput, TLevelSetContainer >::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkLevelSetEquationTermBase.h:64