ITK  5.2.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  * 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_MOVE(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
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(NumericTraits<ScalarValueType>::ZeroValue());
121  this->SetPropagationWeight(NumericTraits<ScalarValueType>::OneValue());
122  this->SetCurvatureWeight(NumericTraits<ScalarValueType>::OneValue());
123  }
124 
125 protected:
127  {
128  this->SetAdvectionWeight(NumericTraits<ScalarValueType>::ZeroValue());
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::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::SegmentationLevelSetFunction::GlobalDataStruct
typename Superclass::GlobalDataStruct GlobalDataStruct
Definition: itkSegmentationLevelSetFunction.h:72
itk::SmartPointer< Self >
itk::FiniteDifferenceFunction::ImageType
TImageType ImageType
Definition: itkFiniteDifferenceFunction.h:82
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:59
itkSegmentationLevelSetFunction.h
itk::SegmentationLevelSetFunction::FeatureScalarType
typename FeatureImageType::PixelType FeatureScalarType
Definition: itkSegmentationLevelSetFunction.h:69
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
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:50
itk::SegmentationLevelSetFunction
Definition: itkSegmentationLevelSetFunction.h:47
itk::ShapeDetectionLevelSetFunction::ShapeDetectionLevelSetFunction
ShapeDetectionLevelSetFunction()
Definition: itkShapeDetectionLevelSetFunction.h:126