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 
32 namespace itk::simple {
33 
59  public:
61 
64 
68 
71 \
72 
75  SITK_RETURN_SELF_TYPE_HEADER SetMaximumRMSError ( double MaximumRMSError ) { this->m_MaximumRMSError = MaximumRMSError; return *this; }
76 
79  double GetMaximumRMSError() const { return this->m_MaximumRMSError; }\
80 
83  SITK_RETURN_SELF_TYPE_HEADER SetNumberOfIterations ( uint32_t NumberOfIterations ) { this->m_NumberOfIterations = NumberOfIterations; return *this; }
84 
87  uint32_t GetNumberOfIterations() const { return this->m_NumberOfIterations; }\
88 
91  SITK_RETURN_SELF_TYPE_HEADER SetLambda1 ( double Lambda1 ) { this->m_Lambda1 = Lambda1; return *this; }
92 
95  double GetLambda1() const { return this->m_Lambda1; }\
96 
99  SITK_RETURN_SELF_TYPE_HEADER SetLambda2 ( double Lambda2 ) { this->m_Lambda2 = Lambda2; return *this; }
100 
103  double GetLambda2() const { return this->m_Lambda2; }\
104 
107  SITK_RETURN_SELF_TYPE_HEADER SetEpsilon ( double Epsilon ) { this->m_Epsilon = Epsilon; return *this; }
108 
111  double GetEpsilon() const { return this->m_Epsilon; }\
112 
115  SITK_RETURN_SELF_TYPE_HEADER SetCurvatureWeight ( double CurvatureWeight ) { this->m_CurvatureWeight = CurvatureWeight; return *this; }
116 
119  double GetCurvatureWeight() const { return this->m_CurvatureWeight; }\
120 
123  SITK_RETURN_SELF_TYPE_HEADER SetAreaWeight ( double AreaWeight ) { this->m_AreaWeight = AreaWeight; return *this; }
124 
127  double GetAreaWeight() const { return this->m_AreaWeight; }\
128 
131  SITK_RETURN_SELF_TYPE_HEADER SetReinitializationSmoothingWeight ( double ReinitializationSmoothingWeight ) { this->m_ReinitializationSmoothingWeight = ReinitializationSmoothingWeight; return *this; }
132 
135  double GetReinitializationSmoothingWeight() const { return this->m_ReinitializationSmoothingWeight; }\
136 
139  SITK_RETURN_SELF_TYPE_HEADER SetVolume ( double Volume ) { this->m_Volume = Volume; return *this; }
140 
143  double GetVolume() const { return this->m_Volume; }\
144 
147  SITK_RETURN_SELF_TYPE_HEADER SetVolumeMatchingWeight ( double VolumeMatchingWeight ) { this->m_VolumeMatchingWeight = VolumeMatchingWeight; return *this; }
148 
151  double GetVolumeMatchingWeight() const { return this->m_VolumeMatchingWeight; }
152 
153  typedef enum {AtanRegularizedHeaviside,SinRegularizedHeaviside,Heaviside} HeavisideStepFunctionType;\
154 
157  SITK_RETURN_SELF_TYPE_HEADER SetHeavisideStepFunction ( HeavisideStepFunctionType HeavisideStepFunction ) { this->m_HeavisideStepFunction = HeavisideStepFunction; return *this; }
158 
161  HeavisideStepFunctionType GetHeavisideStepFunction() const { return this->m_HeavisideStepFunction; }\
162 
167  SITK_RETURN_SELF_TYPE_HEADER SetUseImageSpacing ( bool UseImageSpacing ) { this->m_UseImageSpacing = UseImageSpacing; return *this; }
168 
170  SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOn() { return this->SetUseImageSpacing(true); }
171  SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOff() { return this->SetUseImageSpacing(false); }
172 
177  bool GetUseImageSpacing() const { return this->m_UseImageSpacing; }
184  uint32_t GetElapsedIterations() const { return this->m_ElapsedIterations; };
185 
192  double GetRMSChange() const { return this->m_RMSChange; };
193 
194 
196  std::string GetName() const { return std::string ("ScalarChanAndVeseDenseLevelSetImageFilter"); }
197 
199  std::string ToString() const;
200 
201 
204  Image Execute ( const Image & initialImage, const Image & featureImage );
205 
206  private:
207 
210  using MemberFunctionType = Image (Self::*)( const Image * initialImage, const Image * featureImage );
211  template <class TImageType> Image ExecuteInternal ( const Image * initialImage, const Image * featureImage );
212 
213 
215 
216  std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
217 
218 
219  /* Value of RMS change below which the filter should stop. This is a convergence criterion. */
220  double m_MaximumRMSError{0.02};
221 
222  /* Number of iterations to run */
223  uint32_t m_NumberOfIterations{1000u};
224 
225  /* Lambda1. Internal intensity difference weight */
226  double m_Lambda1{1.0};
227 
228  /* Lambda2. External intensity difference weight */
229  double m_Lambda2{1.0};
230 
231  /* Width of regularization of Heaviside function. */
232  double m_Epsilon{1.0};
233 
234  /* Gamma. Scales all curvature weight values */
235  double m_CurvatureWeight{1.0};
236 
237  /* Nu. Area regularization values */
238  double m_AreaWeight{0.0};
239 
240  /* Weight of the laplacian smoothing term */
241  double m_ReinitializationSmoothingWeight{0.0};
242 
243  /* Pixel Volume = Number of pixels inside the level-set */
244  double m_Volume{0.0};
245 
246  /* Volume matching weight. */
247  double m_VolumeMatchingWeight{0.0};
248 
249  /* Step functions */
251 
252  bool m_UseImageSpacing{true};
253 
254 
255  uint32_t m_ElapsedIterations{0};
256 
257  double m_RMSChange{0.0};
258 
259 
260  };
261 
272  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 );
273 
275 }
276 #endif
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:76
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetNumberOfIterations
uint32_t GetNumberOfIterations() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:87
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetUseImageSpacing
bool GetUseImageSpacing() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:177
sitkBasicFilters.h
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::UseImageSpacingOff
Self & UseImageSpacingOff()
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:171
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetVolumeMatchingWeight
double GetVolumeMatchingWeight() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:151
itk::simple::RealPixelIDTypeList
typelist2::typelist< BasicPixelID< float >, BasicPixelID< double > > RealPixelIDTypeList
Definition: sitkPixelIDTypeLists.h:98
itk::simple::detail::MemberFunctionAddressor
Definition: sitkDetail.h:28
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetVolume
Self & SetVolume(double Volume)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:139
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetVolumeMatchingWeight
Self & SetVolumeMatchingWeight(double VolumeMatchingWeight)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:147
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetNumberOfIterations
Self & SetNumberOfIterations(uint32_t NumberOfIterations)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:83
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetReinitializationSmoothingWeight
double GetReinitializationSmoothingWeight() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:135
itk::HeavisideStepFunction
sitkImageFilter.h
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetCurvatureWeight
double GetCurvatureWeight() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:119
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetLambda2
Self & SetLambda2(double Lambda2)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:99
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::AtanRegularizedHeaviside
@ AtanRegularizedHeaviside
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:153
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetVolume
double GetVolume() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:143
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetHeavisideStepFunction
Self & SetHeavisideStepFunction(HeavisideStepFunctionType HeavisideStepFunction)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:157
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetLambda1
double GetLambda1() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:95
itk::simple::ScalarChanAndVeseDenseLevelSet
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.
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetElapsedIterations
uint32_t GetElapsedIterations() const
Number of iterations run.
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:184
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetHeavisideStepFunction
HeavisideStepFunctionType GetHeavisideStepFunction() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:161
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetRMSChange
double GetRMSChange() const
The Root Mean Square of the levelset upon termination.
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:192
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetUseImageSpacing
Self & SetUseImageSpacing(bool UseImageSpacing)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:167
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetMaximumRMSError
double GetMaximumRMSError() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:79
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter
Dense implementation of the Chan and Vese multiphase level set image filter.
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:58
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetAreaWeight
double GetAreaWeight() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:127
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::UseImageSpacingOn
Self & UseImageSpacingOn()
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:170
SITKBasicFilters_EXPORT
#define SITKBasicFilters_EXPORT
Definition: sitkBasicFilters.h:52
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetLambda2
double GetLambda2() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:103
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetEpsilon
Self & SetEpsilon(double Epsilon)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:107
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::HeavisideStepFunctionType
HeavisideStepFunctionType
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:153
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetReinitializationSmoothingWeight
Self & SetReinitializationSmoothingWeight(double ReinitializationSmoothingWeight)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:131
itk::simple::ImageFilter
The base interface for SimpleITK filters that take one input image.
Definition: sitkImageFilter.h:34
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetMaximumRMSError
Self & SetMaximumRMSError(double MaximumRMSError)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:75
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SinRegularizedHeaviside
@ SinRegularizedHeaviside
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:153
itk::Image
Definition: sitkPixelIDTypes.h:26
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::MemberFunctionType
Image(Self::*)(const Image *initialImage, const Image *featureImage) MemberFunctionType
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:210
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetName
std::string GetName() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:196
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::m_MemberFactory
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:216
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetCurvatureWeight
Self & SetCurvatureWeight(double CurvatureWeight)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:115
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetLambda1
Self & SetLambda1(double Lambda1)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:91
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::PixelIDTypeList
RealPixelIDTypeList PixelIDTypeList
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:70
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetEpsilon
double GetEpsilon() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:111
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetAreaWeight
Self & SetAreaWeight(double AreaWeight)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:123