ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLevelSetFunction.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#ifndef itkLevelSetFunction_h
19#define itkLevelSetFunction_h
20
22#include "vnl/vnl_matrix_fixed.h"
23
24namespace itk
25{
61template <typename TImageType>
62class ITK_TEMPLATE_EXPORT LevelSetFunction : public FiniteDifferenceFunction<TImageType>
63{
64public:
65 ITK_DISALLOW_COPY_AND_MOVE(LevelSetFunction);
66
74 itkNewMacro(Self);
75
77 itkOverrideGetNameOfClassMacro(LevelSetFunction);
78
80 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
81
83 using TimeStepType = double;
84 using typename Superclass::ImageType;
85 using typename Superclass::PixelType;
87 using typename Superclass::PixelRealType;
88 using typename Superclass::RadiusType;
89 using typename Superclass::NeighborhoodType;
91 using typename Superclass::FloatOffsetType;
92
94 // typedef
96
119
121 virtual VectorType
123 {
125 }
126
129 virtual ScalarValueType
131 {
132 return ScalarValueType{};
133 }
134
137 virtual ScalarValueType
142
145 virtual ScalarValueType
150
152 virtual void
157 ScalarValueType
159 {
160 return m_AdvectionWeight;
161 }
162
163
165 virtual void
170 ScalarValueType
172 {
173 return m_PropagationWeight;
174 }
175
176
178 virtual void
183 ScalarValueType
185 {
186 return m_CurvatureWeight;
187 }
188
189
191 void
196 ScalarValueType
201
202
204 void
209 ScalarValueType
211 {
212 return m_EpsilonMagnitude;
213 }
214
215
217 PixelType
219 void * globalData,
220 const FloatOffsetType & = FloatOffsetType(0.0)) override;
221
229 ComputeGlobalTimeStep(void * GlobalData) const override;
230
238 void *
239 GetGlobalDataPointer() const override
240 {
241 auto * ans = new GlobalDataStruct();
242
243 ans->m_MaxAdvectionChange = ScalarValueType{};
244 ans->m_MaxPropagationChange = ScalarValueType{};
245 ans->m_MaxCurvatureChange = ScalarValueType{};
246 return ans;
247 }
248
252 virtual void
254
259 void
260 ReleaseGlobalDataPointer(void * GlobalData) const override
261 {
262 delete (GlobalDataStruct *)GlobalData;
263 }
264
266 virtual ScalarValueType
268
269 virtual ScalarValueType
271
272 virtual ScalarValueType
274
275 virtual ScalarValueType
277
279 void
281 {
283 }
284
285 bool
287 {
289 }
290
291 void
293 {
294 this->SetUseMinimalCurvature(true);
295 }
296
297 void
299 {
300 this->SetUseMinimalCurvature(false);
301 }
302
307 static void
309 {
310 m_DT = n;
311 }
312
313 static double
315 {
316 return m_DT;
317 }
318
323 static void
325 {
326 m_WaveDT = n;
327 }
328
329 static double
331 {
332 return m_WaveDT;
333 }
334
335protected:
343
344 ~LevelSetFunction() override = default;
345 void
346 PrintSelf(std::ostream & os, Indent indent) const override;
347
349 static double m_WaveDT;
350 static double m_DT;
351
354
357
360
362
365 static VectorType
367
370
373
376
379
382
385};
386} // namespace itk
387
388#ifndef ITK_MANUAL_INSTANTIATION
389# include "itkLevelSetFunction.hxx"
390#endif
391
392#endif
ConstNeighborhoodIterator< TImageType, DefaultBoundaryConditionType > NeighborhoodType
static constexpr unsigned int ImageDimension
Vector< float, Self::ImageDimension > FloatOffsetType
typename ImageType::PixelType PixelType
Vector< PixelRealType, Self::ImageDimension > NeighborhoodScalesType
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
Simulate a standard C array with copy semantics.
Control indentation during Print() invocation.
Definition itkIndent.h:50
virtual void Initialize(const RadiusType &r)
static double GetMaximumPropagationTimeStep()
ConstNeighborhoodIterator< TImageType, DefaultBoundaryConditionType > NeighborhoodType
virtual ScalarValueType ComputeMinimalCurvature(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd=0)
ScalarValueType GetAdvectionWeight() const
virtual ScalarValueType ComputeCurvatureTerm(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd=0)
SmartPointer< const Self > ConstPointer
FixedArray< ScalarValueType, Self::ImageDimension > VectorType
ScalarValueType GetLaplacianSmoothingWeight() const
virtual void SetAdvectionWeight(const ScalarValueType a)
void ReleaseGlobalDataPointer(void *GlobalData) const override
void SetEpsilonMagnitude(const ScalarValueType e)
virtual VectorType AdvectionField(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *=0) const
virtual ScalarValueType PropagationSpeed(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *=0) const
virtual ScalarValueType CurvatureSpeed(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *=nullptr) const
~LevelSetFunction() override=default
static VectorType InitializeZeroVectorConstant()
static void SetMaximumPropagationTimeStep(double n)
std::slice x_slice[Self::ImageDimension]
PixelType ComputeUpdate(const NeighborhoodType &it, void *globalData, const FloatOffsetType &=FloatOffsetType(0.0)) override
OffsetValueType m_xStride[Self::ImageDimension]
static double GetMaximumCurvatureTimeStep()
ScalarValueType GetPropagationWeight() const
ScalarValueType m_PropagationWeight
virtual ScalarValueType LaplacianSmoothingSpeed(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *=0) const
void * GetGlobalDataPointer() const override
virtual ScalarValueType Compute3DMinimalCurvature(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd=0)
void SetLaplacianSmoothingWeight(const ScalarValueType c)
void PrintSelf(std::ostream &os, Indent indent) const override
TimeStepType ComputeGlobalTimeStep(void *GlobalData) const override
Vector< float, Self::ImageDimension > FloatOffsetType
ScalarValueType GetCurvatureWeight() const
typename ImageType::PixelType PixelType
static VectorType m_ZeroVectorConstant
static constexpr unsigned int ImageDimension
SmartPointer< Self > Pointer
ScalarValueType GetEpsilonMagnitude() const
virtual void SetPropagationWeight(const ScalarValueType p)
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
FiniteDifferenceFunction< TImageType > Superclass
virtual ScalarValueType ComputeMeanCurvature(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd=0)
virtual void SetCurvatureWeight(const ScalarValueType c)
ScalarValueType m_CurvatureWeight
ScalarValueType m_AdvectionWeight
ScalarValueType m_LaplacianSmoothingWeight
static void SetMaximumCurvatureTimeStep(double n)
ScalarValueType m_EpsilonMagnitude
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
long OffsetValueType
Definition itkIntTypes.h:97
vnl_matrix_fixed< ScalarValueType, Self::ImageDimension, Self::ImageDimension > m_dxy
ScalarValueType m_dx_backward[Self::ImageDimension]
ScalarValueType m_dx_forward[Self::ImageDimension]
ScalarValueType m_dx[Self::ImageDimension]