SimpleITK  
sitkScalarChanAndVeseDenseLevelSetImageFilter.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 sitkScalarChanAndVeseDenseLevelSetImageFilter_h
19#define sitkScalarChanAndVeseDenseLevelSetImageFilter_h
20
21/*
22 * WARNING: DO NOT EDIT THIS FILE!
23 * THIS FILE IS AUTOMATICALLY GENERATED BY THE SIMPLEITK BUILD PROCESS.
24 * Please look at sitkImageFilterTemplate.h.jinja to make changes.
25 */
26
27#include <memory>
28
29#include "sitkBasicFilters.h"
30#include "sitkImageFilter.h"
32
33namespace itk::simple {
34
59public:
61
64
68
71
72
73
74
77 void
78 SetMaximumRMSError(double MaximumRMSError )
79 { this->m_MaximumRMSError = MaximumRMSError; }
80
82 double
83 GetMaximumRMSError() const { return this->m_MaximumRMSError; }
84
85
88 void
89 SetNumberOfIterations(uint32_t NumberOfIterations )
90 { this->m_NumberOfIterations = NumberOfIterations; }
91
93 uint32_t
95
96
99 void
100 SetLambda1(double Lambda1 )
101 { this->m_Lambda1 = Lambda1; }
102
104 double
105 GetLambda1() const { return this->m_Lambda1; }
106
107
110 void
111 SetLambda2(double Lambda2 )
112 { this->m_Lambda2 = Lambda2; }
113
115 double
116 GetLambda2() const { return this->m_Lambda2; }
117
118
121 void
122 SetEpsilon(double Epsilon )
123 { this->m_Epsilon = Epsilon; }
124
126 double
127 GetEpsilon() const { return this->m_Epsilon; }
128
129
132 void
133 SetCurvatureWeight(double CurvatureWeight )
134 { this->m_CurvatureWeight = CurvatureWeight; }
135
137 double
138 GetCurvatureWeight() const { return this->m_CurvatureWeight; }
139
140
143 void
144 SetAreaWeight(double AreaWeight )
145 { this->m_AreaWeight = AreaWeight; }
146
148 double
149 GetAreaWeight() const { return this->m_AreaWeight; }
150
151
154 void
155 SetReinitializationSmoothingWeight(double ReinitializationSmoothingWeight )
156 { this->m_ReinitializationSmoothingWeight = ReinitializationSmoothingWeight; }
157
159 double
161
162
165 void
166 SetVolume(double Volume )
167 { this->m_Volume = Volume; }
168
170 double
171 GetVolume() const { return this->m_Volume; }
172
173
176 void
177 SetVolumeMatchingWeight(double VolumeMatchingWeight )
178 { this->m_VolumeMatchingWeight = VolumeMatchingWeight; }
179
181 double
183
184 typedef enum { AtanRegularizedHeaviside, SinRegularizedHeaviside, Heaviside } HeavisideStepFunctionType;
185
188 void
191
193 HeavisideStepFunctionType
195
196
201 void
202 SetUseImageSpacing(bool UseImageSpacing )
203 { this->m_UseImageSpacing = UseImageSpacing; }
204
206 void
207 UseImageSpacingOn() { return this->SetUseImageSpacing(true); }
208 void
209 UseImageSpacingOff() { return this->SetUseImageSpacing(false); }
214 bool
215 GetUseImageSpacing() const { return this->m_UseImageSpacing; }
216
217
223 uint32_t GetElapsedIterations() const { return this->m_ElapsedIterations; }
224
230 double GetRMSChange() const { return this->m_RMSChange; }
231
233 std::string GetName() const { return std::string("ScalarChanAndVeseDenseLevelSetImageFilter"); }
234
236 std::string ToString() const;
237
238
240 Image Execute(const Image &initialImage, const Image &featureImage);
241
242
243private:
245 using MemberFunctionType = Image (Self::*)(const Image *
246 initialImage, const Image *
247 featureImage);
248 template <class TImageType> Image ExecuteInternal(const Image *
249 initialImage, const Image *
250 featureImage);
253
254
255 /* Value of RMS change below which the filter should stop. This is a convergence criterion. */
256 double m_MaximumRMSError{ 0.02 };
257
258 /* Number of iterations to run */
259 uint32_t m_NumberOfIterations{ 1000u };
260
261 /* Lambda1. Internal intensity difference weight */
262 double m_Lambda1{ 1.0 };
263
264 /* Lambda2. External intensity difference weight */
265 double m_Lambda2{ 1.0 };
266
267 /* Width of regularization of Heaviside function. */
268 double m_Epsilon{ 1.0 };
269
270 /* Gamma. Scales all curvature weight values */
271 double m_CurvatureWeight{ 1.0 };
272
273 /* Nu. Area regularization values */
274 double m_AreaWeight{ 0.0 };
275
276 /* Weight of the laplacian smoothing term */
278
279 /* Pixel Volume = Number of pixels inside the level-set */
280 double m_Volume{ 0.0 };
281
282 /* Volume matching weight. */
284
285 /* Step functions */
287
288 bool m_UseImageSpacing{ true };
289
290
291
292 uint32_t m_ElapsedIterations{ 0 };
293 double m_RMSChange{ 0.0 };
294
295
296
297
298};
299
300
310 const Image &initialImage, const Image &featureImage, double maximumRMSError = 0.02, uint32_t numberOfIterations = 1000u, double lambda1 = 1.0, double lambda2 = 1.0, double epsilon = 1.0, double curvatureWeight = 1.0, double areaWeight = 0.0, double reinitializationSmoothingWeight = 0.0, double volume = 0.0, double volumeMatchingWeight = 0.0, ScalarChanAndVeseDenseLevelSetImageFilter::HeavisideStepFunctionType heavisideStepFunction = itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::AtanRegularizedHeaviside, bool useImageSpacing = true
311);
312
314
315}
316#endif
The Image class for SimpleITK.
Definition sitkImage.h:77
Image ExecuteInternal(const Image *initialImage, const Image *featureImage)
Image Execute(const Image &initialImage, const Image &featureImage)
double GetRMSChange() const
The Root Mean Square of the levelset upon termination.
Image(Self::*)(const Image * initialImage, const Image * featureImage) MemberFunctionType
static const detail::MemberFunctionFactory< MemberFunctionType > & GetMemberFunctionFactory()
void SetHeavisideStepFunction(HeavisideStepFunctionType HeavisideStepFunction)
A class used to instantiate and generate function object to templated member functions.
Image ScalarChanAndVeseDenseLevelSet(const Image &initialImage, const Image &featureImage, double maximumRMSError=0.02, uint32_t numberOfIterations=1000u, double lambda1=1.0, double lambda2=1.0, double epsilon=1.0, double curvatureWeight=1.0, double areaWeight=0.0, double reinitializationSmoothingWeight=0.0, double volume=0.0, double volumeMatchingWeight=0.0, ScalarChanAndVeseDenseLevelSetImageFilter::HeavisideStepFunctionType heavisideStepFunction=itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::AtanRegularizedHeaviside, bool useImageSpacing=true)
Dense implementation of the Chan and Vese multiphase level set image filter.
typelist2::typelist< BasicPixelID< float >, BasicPixelID< double > > RealPixelIDTypeList
#define SITKBasicFilters_EXPORT