ITK  5.4.0
Insight Toolkit
itkShapeDetectionLevelSetFunction.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 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_MOVE(ShapeDetectionLevelSetFunction);
77 
83  using FeatureImageType = TFeatureImageType;
84 
86  itkNewMacro(Self);
87 
89  itkOverrideGetNameOfClassMacro(ShapeDetectionLevelSetFunction);
90 
92  using typename Superclass::ImageType;
93  using typename Superclass::NeighborhoodType;
94  using typename Superclass::ScalarValueType;
95  using typename Superclass::FeatureScalarType;
96  using typename Superclass::RadiusType;
97  using typename Superclass::FloatOffsetType;
98  using typename Superclass::GlobalDataStruct;
99 
101  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
102 
103  void
104  CalculateSpeedImage() override;
105 
108  CurvatureSpeed(const NeighborhoodType & neighborhood,
109  const FloatOffsetType & offset,
110  GlobalDataStruct * gd) const override
111  {
112  return this->PropagationSpeed(neighborhood, offset, gd);
113  }
114 
115  void
116  Initialize(const RadiusType & r) override
117  {
118  Superclass::Initialize(r);
119 
120  this->SetAdvectionWeight(ScalarValueType{});
121  this->SetPropagationWeight(NumericTraits<ScalarValueType>::OneValue());
122  this->SetCurvatureWeight(NumericTraits<ScalarValueType>::OneValue());
123  }
124 
125 protected:
127  {
128  this->SetAdvectionWeight(ScalarValueType{});
129  this->SetPropagationWeight(NumericTraits<ScalarValueType>::OneValue());
130  this->SetCurvatureWeight(NumericTraits<ScalarValueType>::OneValue());
131  }
132 
133  ~ShapeDetectionLevelSetFunction() override = default;
134 };
135 } // end namespace itk
136 
137 #ifndef ITK_MANUAL_INSTANTIATION
138 # include "itkShapeDetectionLevelSetFunction.hxx"
139 #endif
140 
141 #endif
itk::FiniteDifferenceFunction::RadiusType
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
Definition: itkFiniteDifferenceFunction.h:97
itk::ShapeDetectionLevelSetFunction::CurvatureSpeed
ScalarValueType CurvatureSpeed(const NeighborhoodType &neighborhood, const FloatOffsetType &offset, GlobalDataStruct *gd) const override
Definition: itkShapeDetectionLevelSetFunction.h:108
itk::ShapeDetectionLevelSetFunction
This function is used in the ShapeDetectionLevelSetImageFilter to segment structures in an image base...
Definition: itkShapeDetectionLevelSetFunction.h:72
itk::LevelSetFunction::GlobalDataStruct
Definition: itkLevelSetFunction.h:106
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::SmartPointer< Self >
itk::SegmentationLevelSetFunction::FeatureImageType
TFeatureImageType FeatureImageType
Definition: itkSegmentationLevelSetFunction.h:65
itk::ShapeDetectionLevelSetFunction::Initialize
void Initialize(const RadiusType &r) override
Definition: itkShapeDetectionLevelSetFunction.h:116
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkSegmentationLevelSetFunction.h
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:59
itk::LevelSetFunction::ScalarValueType
PixelType ScalarValueType
Definition: itkLevelSetFunction.h:90
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ConstNeighborhoodIterator
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Definition: itkConstNeighborhoodIterator.h:51
itk::SegmentationLevelSetFunction
Definition: itkSegmentationLevelSetFunction.h:47
itk::ShapeDetectionLevelSetFunction::ShapeDetectionLevelSetFunction
ShapeDetectionLevelSetFunction()
Definition: itkShapeDetectionLevelSetFunction.h:126