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.in to make changes.
25 */
26
27#include <memory>
28
29#include "sitkBasicFilters.h"
30#include "sitkImageFilter.h"
31
32namespace itk::simple {
33
56 public:
58
61
65
68\
69
72 SITK_RETURN_SELF_TYPE_HEADER SetMaximumRMSError ( double MaximumRMSError ) { this->m_MaximumRMSError = MaximumRMSError; return *this; }
73
76 double GetMaximumRMSError() const { return this->m_MaximumRMSError; }\
77
80 SITK_RETURN_SELF_TYPE_HEADER SetNumberOfIterations ( uint32_t NumberOfIterations ) { this->m_NumberOfIterations = NumberOfIterations; return *this; }
81
84 uint32_t GetNumberOfIterations() const { return this->m_NumberOfIterations; }\
85
88 SITK_RETURN_SELF_TYPE_HEADER SetLambda1 ( double Lambda1 ) { this->m_Lambda1 = Lambda1; return *this; }
89
92 double GetLambda1() const { return this->m_Lambda1; }\
93
96 SITK_RETURN_SELF_TYPE_HEADER SetLambda2 ( double Lambda2 ) { this->m_Lambda2 = Lambda2; return *this; }
97
100 double GetLambda2() const { return this->m_Lambda2; }\
101
104 SITK_RETURN_SELF_TYPE_HEADER SetEpsilon ( double Epsilon ) { this->m_Epsilon = Epsilon; return *this; }
105
108 double GetEpsilon() const { return this->m_Epsilon; }\
109
112 SITK_RETURN_SELF_TYPE_HEADER SetCurvatureWeight ( double CurvatureWeight ) { this->m_CurvatureWeight = CurvatureWeight; return *this; }
113
116 double GetCurvatureWeight() const { return this->m_CurvatureWeight; }\
117
120 SITK_RETURN_SELF_TYPE_HEADER SetAreaWeight ( double AreaWeight ) { this->m_AreaWeight = AreaWeight; return *this; }
121
124 double GetAreaWeight() const { return this->m_AreaWeight; }\
125
128 SITK_RETURN_SELF_TYPE_HEADER SetReinitializationSmoothingWeight ( double ReinitializationSmoothingWeight ) { this->m_ReinitializationSmoothingWeight = ReinitializationSmoothingWeight; return *this; }
129
133
136 SITK_RETURN_SELF_TYPE_HEADER SetVolume ( double Volume ) { this->m_Volume = Volume; return *this; }
137
140 double GetVolume() const { return this->m_Volume; }\
141
144 SITK_RETURN_SELF_TYPE_HEADER SetVolumeMatchingWeight ( double VolumeMatchingWeight ) { this->m_VolumeMatchingWeight = VolumeMatchingWeight; return *this; }
145
148 double GetVolumeMatchingWeight() const { return this->m_VolumeMatchingWeight; }
149
150 typedef enum {AtanRegularizedHeaviside,SinRegularizedHeaviside,Heaviside} HeavisideStepFunctionType;\
151
155
159
164 SITK_RETURN_SELF_TYPE_HEADER SetUseImageSpacing ( bool UseImageSpacing ) { this->m_UseImageSpacing = UseImageSpacing; return *this; }
165
167 SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOn() { return this->SetUseImageSpacing(true); }
168 SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOff() { return this->SetUseImageSpacing(false); }
169
174 bool GetUseImageSpacing() const { return this->m_UseImageSpacing; }
181 uint32_t GetElapsedIterations() const { return this->m_ElapsedIterations; };
182
189 double GetRMSChange() const { return this->m_RMSChange; };
190
191
193 std::string GetName() const { return std::string ("ScalarChanAndVeseDenseLevelSetImageFilter"); }
194
196 std::string ToString() const;
197
198
200
201 Image Execute ( const Image & initialImage, const Image & featureImage );
202
203 private:
204
206
207 using MemberFunctionType = Image (Self::*)( const Image * initialImage, const Image * featureImage );
208 template <class TImageType> Image ExecuteInternal ( const Image * initialImage, const Image * featureImage );
209
210
212
213 std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
214
215
216 /* Value of RMS change below which the filter should stop. This is a convergence criterion. */
217 double m_MaximumRMSError{0.02};
218
219 /* Number of iterations to run */
220 uint32_t m_NumberOfIterations{1000u};
221
222 /* Lambda1. Internal intensity difference weight */
223 double m_Lambda1{1.0};
224
225 /* Lambda2. External intensity difference weight */
226 double m_Lambda2{1.0};
227
228 /* Width of regularization of Heaviside function. */
229 double m_Epsilon{1.0};
230
231 /* Gamma. Scales all curvature weight values */
232 double m_CurvatureWeight{1.0};
233
234 /* Nu. Area regularization values */
235 double m_AreaWeight{0.0};
236
237 /* Weight of the laplacian smoothing term */
239
240 /* Pixel Volume = Number of pixels inside the level-set */
241 double m_Volume{0.0};
242
243 /* Volume matching weight. */
245
246 /* Step functions */
248
250
251
253
254 double m_RMSChange{0.0};
255
256
257 };
258
268
269 SITKBasicFilters_EXPORT 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 );
270
272}
273#endif
The Image class for SimpleITK.
Definition sitkImage.h:77
Image ExecuteInternal(const Image *initialImage, const Image *featureImage)
Self & SetHeavisideStepFunction(HeavisideStepFunctionType HeavisideStepFunction)
Image Execute(const Image &initialImage, const Image &featureImage)
double GetRMSChange() const
The Root Mean Square of the levelset upon termination.
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
Image(Self::*)(const Image *initialImage, const Image *featureImage) MemberFunctionType
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