ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkLaplacianSegmentationLevelSetFunction.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 #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 
42  using Superclass =
46  using FeatureImageType = TFeatureImageType;
47 
49  itkNewMacro(Self);
50 
53 
55  using ImageType = typename Superclass::ImageType;
56  using ScalarValueType = typename Superclass::ScalarValueType;
57  using FeatureScalarType = typename Superclass::FeatureScalarType;
58  using RadiusType = typename Superclass::RadiusType;
59 
61  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
62 
63  void CalculateSpeedImage() override;
64 
65  void Initialize(const RadiusType & r) override
66  {
67  Superclass::Initialize(r);
68 
69  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::ZeroValue());
70  this->SetPropagationWeight(-1.0 * NumericTraits< ScalarValueType >::OneValue());
71  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::OneValue());
72  }
73 
80  void SetAdvectionWeight(const ScalarValueType value) override
81  {
83  {
84  Superclass::SetAdvectionWeight(value);
85  }
86  }
88 
89 protected:
90 
92  {
93  this->SetAdvectionWeight(0.0);
94  this->SetPropagationWeight(1.0);
95  this->SetCurvatureWeight(1.0);
96  }
97 
98  ~LaplacianSegmentationLevelSetFunction() override = default;
99 
100 };
101 } // end namespace itk
102 
103 #ifndef ITK_MANUAL_INSTANTIATION
104 #include "itkLaplacianSegmentationLevelSetFunction.hxx"
105 #include "itkMath.h"
106 #endif
107 
108 #endif
Light weight base class for most itk classes.
Define numeric traits for std::vector.
bool ExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Return the result of an exact comparison between two scalar values of potetially different types...
Definition: itkMath.h:707
void SetAdvectionWeight(const ScalarValueType value) override
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
This function is used in LaplacianSegmentationImageFilter to segment structures in an image based Lap...