ITK  5.2.0
Insight Toolkit
itkLaplacianSegmentationLevelSetFunction.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 #ifndef itkLaplacianSegmentationLevelSetFunction_h
19 #define itkLaplacianSegmentationLevelSetFunction_h
20 
22 
23 namespace itk
24 {
33 template <typename TImageType, typename TFeatureImageType = TImageType>
34 class ITK_TEMPLATE_EXPORT LaplacianSegmentationLevelSetFunction
35  : public SegmentationLevelSetFunction<TImageType, TFeatureImageType>
36 {
37 public:
38  ITK_DISALLOW_COPY_AND_ASSIGN(LaplacianSegmentationLevelSetFunction);
39 
45  using FeatureImageType = TFeatureImageType;
46 
48  itkNewMacro(Self);
49 
52 
54  using ImageType = typename Superclass::ImageType;
55  using ScalarValueType = typename Superclass::ScalarValueType;
56  using FeatureScalarType = typename Superclass::FeatureScalarType;
57  using RadiusType = typename Superclass::RadiusType;
58 
60  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
61 
62  void
63  CalculateSpeedImage() override;
64 
65  void
66  Initialize(const RadiusType & r) override
67  {
68  Superclass::Initialize(r);
69 
70  this->SetAdvectionWeight(NumericTraits<ScalarValueType>::ZeroValue());
71  this->SetPropagationWeight(-1.0 * NumericTraits<ScalarValueType>::OneValue());
72  this->SetCurvatureWeight(NumericTraits<ScalarValueType>::OneValue());
73  }
74 
81  void
82  SetAdvectionWeight(const ScalarValueType value) override
83  {
85  {
86  Superclass::SetAdvectionWeight(value);
87  }
88  }
90 
91 protected:
93  {
94  this->SetAdvectionWeight(0.0);
95  this->SetPropagationWeight(1.0);
96  this->SetCurvatureWeight(1.0);
97  }
98 
99  ~LaplacianSegmentationLevelSetFunction() override = default;
100 };
101 } // end namespace itk
102 
103 #ifndef ITK_MANUAL_INSTANTIATION
104 # include "itkLaplacianSegmentationLevelSetFunction.hxx"
105 # include "itkMath.h"
106 #endif
107 
108 #endif
itk::FiniteDifferenceFunction::RadiusType
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
Definition: itkFiniteDifferenceFunction.h:97
itk::LaplacianSegmentationLevelSetFunction::FeatureScalarType
typename Superclass::FeatureScalarType FeatureScalarType
Definition: itkLaplacianSegmentationLevelSetFunction.h:56
itk::Math::ExactlyEquals
bool ExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Return the result of an exact comparison between two scalar values of potentially different types.
Definition: itkMath.h:723
itk::LaplacianSegmentationLevelSetFunction::SetAdvectionWeight
void SetAdvectionWeight(const ScalarValueType value) override
Definition: itkLaplacianSegmentationLevelSetFunction.h:82
itk::SmartPointer< Self >
itk::FiniteDifferenceFunction::ImageType
TImageType ImageType
Definition: itkFiniteDifferenceFunction.h:82
itk::LaplacianSegmentationLevelSetFunction
This function is used in LaplacianSegmentationImageFilter to segment structures in an image based Lap...
Definition: itkLaplacianSegmentationLevelSetFunction.h:34
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkSegmentationLevelSetFunction.h
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itk::LaplacianSegmentationLevelSetFunction::LaplacianSegmentationLevelSetFunction
LaplacianSegmentationLevelSetFunction()
Definition: itkLaplacianSegmentationLevelSetFunction.h:92
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::SegmentationLevelSetFunction
Definition: itkSegmentationLevelSetFunction.h:47
itk::LaplacianSegmentationLevelSetFunction::ScalarValueType
typename Superclass::ScalarValueType ScalarValueType
Definition: itkLaplacianSegmentationLevelSetFunction.h:55
itk::LaplacianSegmentationLevelSetFunction::Initialize
void Initialize(const RadiusType &r) override
Definition: itkLaplacianSegmentationLevelSetFunction.h:66
itk::LaplacianSegmentationLevelSetFunction::FeatureImageType
TFeatureImageType FeatureImageType
Definition: itkLaplacianSegmentationLevelSetFunction.h:45
itkMath.h