ITK  6.0.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 * https://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
26namespace itk
27{
47template <typename TInputImage, // Input image
48 typename TLevelSetContainer>
49class ITK_TEMPLATE_EXPORT LevelSetEquationTermBase : public Object
50{
51public:
52 ITK_DISALLOW_COPY_AND_MOVE(LevelSetEquationTermBase);
59
61 itkOverrideGetNameOfClassMacro(LevelSetEquationTermBase);
62
63 using InputImageType = TInputImage;
65 using InputPixelType = typename InputImageType::PixelType;
67
69 using LevelSetContainerType = TLevelSetContainer;
70 using LevelSetIdentifierType = typename LevelSetContainerType::LevelSetIdentifierType;
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);
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
103 itkGetModifiableObjectMacro(LevelSetContainer, LevelSetContainerType);
104
110
113
115 virtual void
117
119 virtual void
121
123 virtual void
125 const LevelSetOutputRealType & oldValue,
126 const LevelSetOutputRealType & newValue) = 0;
127
129 itkGetConstMacro(CFLContribution, LevelSetOutputRealType);
130
132 itkSetStringMacro(TermName);
133 itkGetStringMacro(TermName);
137 virtual void
138 Update() = 0;
139
140 using RequiredDataType = std::unordered_set<std::string>;
141
142 const RequiredDataType &
144
145protected:
148
150 ~LevelSetEquationTermBase() override = default;
151
152 void
154
161
163 Value(const LevelSetInputIndexType & iP, const LevelSetDataType & iData) = 0;
164
167
169 LevelSetContainerPointer m_LevelSetContainer{};
170
172 LevelSetIdentifierType m_CurrentLevelSetId{};
173
174 LevelSetPointer m_CurrentLevelSetPointer{};
175
177 LevelSetOutputRealType m_Coefficient{};
178
182 LevelSetOutputRealType m_CFLContribution{};
183
188
192 std::string m_TermName{};
193
194 RequiredDataType m_RequiredData{};
195};
196} // namespace itk
197
198#ifndef ITK_MANUAL_INSTANTIATION
199# include "itkLevelSetEquationTermBase.hxx"
200#endif
201
202#endif
Base class of the Heaviside function.
Container of Level-Sets.
Abstract class to represents a term in the level-set evolution PDE.
virtual void Initialize(const LevelSetInputIndexType &iP)=0
typename LevelSetContainerType::LevelSetIdentifierType LevelSetIdentifierType
virtual void UpdatePixel(const LevelSetInputIndexType &iP, const LevelSetOutputRealType &oldValue, const LevelSetOutputRealType &newValue)=0
typename LevelSetContainerType::LevelSetDataType LevelSetDataType
const RequiredDataType & GetRequiredData() const
virtual void SetLevelSetContainer(LevelSetContainerType *iContainer)
~LevelSetEquationTermBase() override=default
typename LevelSetContainerType::LevelSetType LevelSetType
virtual void InitializeParameters()=0
typename LevelSetContainerType::HessianType LevelSetHessianType
typename LevelSetContainerType::Pointer LevelSetContainerPointer
virtual LevelSetOutputRealType Evaluate(const LevelSetInputIndexType &iP)
std::unordered_set< std::string > RequiredDataType
typename LevelSetContainerType::DomainMapImageFilterType DomainMapImageFilterType
typename LevelSetContainerType::OutputRealType LevelSetOutputRealType
typename HeavisideType::ConstPointer HeavisideConstPointer
typename InputImageType::PixelType InputPixelType
virtual LevelSetOutputRealType Value(const LevelSetInputIndexType &iP, const LevelSetDataType &iData)=0
virtual LevelSetOutputRealType Value(const LevelSetInputIndexType &iP)=0
typename InputImageType::Pointer InputImagePointer
typename LevelSetContainerType::GradientType LevelSetGradientType
typename LevelSetContainerType::LevelSetPointer LevelSetPointer
typename LevelSetContainerType::InputIndexType LevelSetInputIndexType
typename NumericTraits< InputPixelType >::RealType InputPixelRealType
virtual LevelSetOutputRealType Evaluate(const LevelSetInputIndexType &iP, const LevelSetDataType &iData)
typename LevelSetContainerType::OutputType LevelSetOutputPixelType
typename LevelSetContainerType::CacheImageType CacheImageType
Light weight base class for most itk classes.
Define additional traits for native types such as int or float.
Base class for most ITK classes.
Definition: itkObject.h:62
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....