ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkShapeDetectionLevelSetFunction.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 itkShapeDetectionLevelSetFunction_h
19 #define itkShapeDetectionLevelSetFunction_h
20 
22 
23 namespace itk
24 {
71 template< typename TImageType, typename TFeatureImageType = TImageType >
72 class ITK_TEMPLATE_EXPORT ShapeDetectionLevelSetFunction:
73  public SegmentationLevelSetFunction< TImageType, TFeatureImageType >
74 {
75 public:
76  ITK_DISALLOW_COPY_AND_ASSIGN(ShapeDetectionLevelSetFunction);
77 
83  using FeatureImageType = TFeatureImageType;
84 
86  itkNewMacro(Self);
87 
90 
92  using ImageType = typename Superclass::ImageType;
93  using NeighborhoodType = typename Superclass::NeighborhoodType;
94  using ScalarValueType = typename Superclass::ScalarValueType;
95  using FeatureScalarType = typename Superclass::FeatureScalarType;
96  using RadiusType = typename Superclass::RadiusType;
97  using FloatOffsetType = typename Superclass::FloatOffsetType;
98  using GlobalDataStruct = typename Superclass::GlobalDataStruct;
99 
101  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
102 
103  void CalculateSpeedImage() override;
104 
107  const FloatOffsetType & offset, GlobalDataStruct *gd) const override
108  { return this->PropagationSpeed(neighborhood, offset, gd); }
109 
110  void Initialize(const RadiusType & r) override
111  {
112  Superclass::Initialize(r);
113 
114  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::ZeroValue());
115  this->SetPropagationWeight(NumericTraits< ScalarValueType >::OneValue());
116  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::OneValue());
117  }
118 
119 protected:
121  {
122  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::ZeroValue());
123  this->SetPropagationWeight(NumericTraits< ScalarValueType >::OneValue());
124  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::OneValue());
125  }
126 
127  ~ShapeDetectionLevelSetFunction() override = default;
128 
129 };
130 } // end namespace itk
131 
132 #ifndef ITK_MANUAL_INSTANTIATION
133 #include "itkShapeDetectionLevelSetFunction.hxx"
134 #endif
135 
136 #endif
typename Superclass::GlobalDataStruct GlobalDataStruct
Light weight base class for most itk classes.
This function is used in the ShapeDetectionLevelSetImageFilter to segment structures in an image base...
typename FeatureImageType::PixelType FeatureScalarType
Define numeric traits for std::vector.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
ScalarValueType CurvatureSpeed(const NeighborhoodType &neighborhood, const FloatOffsetType &offset, GlobalDataStruct *gd) const override