ITK  4.13.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:
44  typedef TFeatureImageType FeatureImageType;
45 
47  itkNewMacro(Self);
48 
51 
53  typedef typename Superclass::ImageType ImageType;
54  typedef typename Superclass::ScalarValueType ScalarValueType;
55  typedef typename Superclass::FeatureScalarType FeatureScalarType;
56  typedef typename Superclass::RadiusType RadiusType;
57 
59  itkStaticConstMacro(ImageDimension, unsigned int,
60  Superclass::ImageDimension);
61 
62  virtual void CalculateSpeedImage() ITK_OVERRIDE;
63 
64  virtual void Initialize(const RadiusType & r) ITK_OVERRIDE
65  {
66  Superclass::Initialize(r);
67 
68  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::ZeroValue());
69  this->SetPropagationWeight(-1.0 * NumericTraits< ScalarValueType >::OneValue());
70  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::OneValue());
71  }
72 
79  void SetAdvectionWeight(const ScalarValueType value) ITK_OVERRIDE
80  {
82  {
83  Superclass::SetAdvectionWeight(value);
84  }
85  }
87 
88 protected:
89 
91  {
92  this->SetAdvectionWeight(0.0);
93  this->SetPropagationWeight(1.0);
94  this->SetCurvatureWeight(1.0);
95  }
96 
97  virtual ~LaplacianSegmentationLevelSetFunction() ITK_OVERRIDE {}
98 
99  ITK_DISALLOW_COPY_AND_ASSIGN(LaplacianSegmentationLevelSetFunction);
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.
SegmentationLevelSetFunction< TImageType, TFeatureImageType > Superclass
ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
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:710
void SetAdvectionWeight(const ScalarValueType value) override
This function is used in LaplacianSegmentationImageFilter to segment structures in an image based Lap...
Define additional traits for native types such as int or float.