ITK  6.0.0
Insight Toolkit
itkCurvesLevelSetFunction.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 itkCurvesLevelSetFunction_h
19#define itkCurvesLevelSetFunction_h
20
22
23namespace itk
24{
61template <typename TImageType, typename TFeatureImageType = TImageType>
62class ITK_TEMPLATE_EXPORT CurvesLevelSetFunction : public SegmentationLevelSetFunction<TImageType, TFeatureImageType>
63{
64public:
65 ITK_DISALLOW_COPY_AND_MOVE(CurvesLevelSetFunction);
66
73 using FeatureImageType = TFeatureImageType;
74
76 itkNewMacro(Self);
77
79 itkOverrideGetNameOfClassMacro(CurvesLevelSetFunction);
80
83 using typename Superclass::ImageType;
84 using typename Superclass::NeighborhoodType;
85 using typename Superclass::ScalarValueType;
86 using typename Superclass::FeatureScalarType;
87 using typename Superclass::RadiusType;
90 using typename Superclass::VectorImageType;
91
93 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
94
96 void
98
100 void
102
105 CurvatureSpeed(const NeighborhoodType & neighborhood,
106 const FloatOffsetType & offset,
107 GlobalDataStruct * gd) const override
108 {
109 return this->PropagationSpeed(neighborhood, offset, gd);
110 }
111
114 void
115 SetDerivativeSigma(const double v)
116 {
117 m_DerivativeSigma = v;
118 }
119 double
121 {
122 return m_DerivativeSigma;
123 }
126 void
127 Initialize(const RadiusType & r) override;
128
129protected:
131
132 {
133 // Curvature term is the minimal curvature.
134 this->UseMinimalCurvatureOn();
135 this->SetAdvectionWeight(NumericTraits<ScalarValueType>::OneValue());
136 this->SetPropagationWeight(NumericTraits<ScalarValueType>::OneValue());
137 this->SetCurvatureWeight(NumericTraits<ScalarValueType>::OneValue());
138 }
139
140 ~CurvesLevelSetFunction() override = default;
141
142 void
143 PrintSelf(std::ostream & os, Indent indent) const override
144 {
145 Superclass::PrintSelf(os, indent);
146 os << indent << "DerivativeSigma: " << m_DerivativeSigma << std::endl;
147 }
148
149private:
151 std::slice x_slice[ImageDimension];
152
154 OffsetValueType m_Center{ 0 };
155
157 OffsetValueType m_xStride[ImageDimension]{};
158
159 double m_DerivativeSigma{ 1.0 };
160};
161} // end namespace itk
162
163#ifndef ITK_MANUAL_INSTANTIATION
164# include "itkCurvesLevelSetFunction.hxx"
165#endif
166
167#endif
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
This function is used in CurvesLevelSetImageFilter to segment structures in images based on user supp...
void CalculateAdvectionImage() override
~CurvesLevelSetFunction() override=default
typename SuperSuperclass::GlobalDataStruct GlobalDataStruct
void Initialize(const RadiusType &r) override
ScalarValueType CurvatureSpeed(const NeighborhoodType &neighborhood, const FloatOffsetType &offset, GlobalDataStruct *gd) const override
void PrintSelf(std::ostream &os, Indent indent) const override
void CalculateSpeedImage() override
typename ImageType::PixelType PixelType
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
The LevelSetFunction class is a generic function object which can be used to create a level set metho...
Light weight base class for most itk classes.
Define additional traits for native types such as int or float.
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:63
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
long OffsetValueType
Definition: itkIntTypes.h:97