ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkCannySegmentationLevelSetFunction.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 itkCannySegmentationLevelSetFunction_h
19#define itkCannySegmentationLevelSetFunction_h
20
22#include "itkCastImageFilter.h"
25
26namespace itk
27{
34template <typename TImageType, typename TFeatureImageType = TImageType>
35class ITK_TEMPLATE_EXPORT CannySegmentationLevelSetFunction
36 : public SegmentationLevelSetFunction<TImageType, TFeatureImageType>
37{
38public:
39 ITK_DISALLOW_COPY_AND_MOVE(CannySegmentationLevelSetFunction);
40
46 using FeatureImageType = TFeatureImageType;
47
49 itkNewMacro(Self);
50
52 itkOverrideGetNameOfClassMacro(CannySegmentationLevelSetFunction);
53
55 using typename Superclass::ImageType;
56 using typename Superclass::ScalarValueType;
57 using typename Superclass::VectorImageType;
58 using typename Superclass::FeatureScalarType;
59 using typename Superclass::RadiusType;
60
62 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
63
66 void
71 ScalarValueType
73 {
74 return m_Threshold;
75 }
76
77
80 void
81 SetVariance(double v)
82 {
83 m_Variance = v;
84 }
85 [[nodiscard]] double
87 {
88 return m_Variance;
89 }
90
91
94 void
96
99 void
101
104 virtual void
106
107 void
116
117 ImageType *
119 {
120 return m_Canny->GetOutput();
121 }
122
123protected:
131
133
134private:
136 double m_Threshold{};
137
139
141
143
147 template <typename DummyImagePointerType>
148 void
149 AssignCannyInput(typename FeatureImageType::Pointer & feature, DummyImagePointerType &)
150 {
151 m_Caster->SetInput(feature);
152 m_Canny->SetInput(m_Caster->GetOutput());
153 }
154
158 void
159 AssignCannyInput(typename FeatureImageType::Pointer & feature, typename FeatureImageType::Pointer &)
160 {
161 m_Canny->SetInput(feature);
162 }
163};
164} // end namespace itk
165
166#ifndef ITK_MANUAL_INSTANTIATION
167# include "itkCannySegmentationLevelSetFunction.hxx"
168#endif
169
170#endif
This filter is an implementation of a Canny edge detector for scalar-valued images.
~CannySegmentationLevelSetFunction() override=default
void AssignCannyInput(typename FeatureImageType::Pointer &feature, typename FeatureImageType::Pointer &)
void AssignCannyInput(typename FeatureImageType::Pointer &feature, DummyImagePointerType &)
SegmentationLevelSetFunction< TImageType, TFeatureImageType > Superclass
DanielssonDistanceMapImageFilter< ImageType, ImageType >::Pointer m_Distance
Casts input pixels to output pixel type.
SmartPointer< Self > Pointer
This filter computes the distance map of the input image as an approximation with pixel accuracy to t...
virtual void SetAdvectionWeight(const ScalarValueType a)
virtual void SetPropagationWeight(const ScalarValueType p)
virtual void SetCurvatureWeight(const ScalarValueType c)
typename ConstNeighborhoodIterator< OutputImageType >::RadiusType RadiusType
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....