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
65 void
70 ScalarValueType
72 {
73 return m_Threshold;
74 }
75
76
78 void
79 SetVariance(double v)
80 {
81 m_Variance = v;
82 }
83 double
85 {
86 return m_Variance;
87 }
88
89
92 void
94
97 void
99
102 virtual void
104
105 void
114
115 ImageType *
117 {
118 return m_Canny->GetOutput();
119 }
120
121protected:
130
132
133private:
135 double m_Threshold{};
136
138
140
142
146 template <typename DummyImagePointerType>
147 void
148 AssignCannyInput(typename FeatureImageType::Pointer & feature, DummyImagePointerType &)
149 {
150 m_Caster->SetInput(feature);
151 m_Canny->SetInput(m_Caster->GetOutput());
152 }
153
157 void
158 AssignCannyInput(typename FeatureImageType::Pointer & feature, typename FeatureImageType::Pointer &)
159 {
160 m_Canny->SetInput(feature);
161 }
162};
163} // end namespace itk
165
166#ifndef ITK_MANUAL_INSTANTIATION
167# include "itkCannySegmentationLevelSetFunction.hxx"
168#endif
169
170#endif
~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
static Pointer New()
SmartPointer< Self > Pointer
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....