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 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:
132
134
135private:
137 double m_Threshold{};
138
140
142
144
148 template <typename DummyImagePointerType>
149 void
150 AssignCannyInput(typename FeatureImageType::Pointer & feature, DummyImagePointerType &)
151 {
152 m_Caster->SetInput(feature);
153 m_Canny->SetInput(m_Caster->GetOutput());
154 }
155
159 void
160 AssignCannyInput(typename FeatureImageType::Pointer & feature, typename FeatureImageType::Pointer &)
161 {
162 m_Canny->SetInput(feature);
163 }
164};
165} // end namespace itk
166
167#ifndef ITK_MANUAL_INSTANTIATION
168# include "itkCannySegmentationLevelSetFunction.hxx"
169#endif
170
171#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....