SimpleITK  1.2.4
sitkScalarChanAndVeseDenseLevelSetImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
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 {
33  namespace simple {
34 
61  public:
63 
66 
70 
73 
74 
75 
78  SITK_RETURN_SELF_TYPE_HEADER SetMaximumRMSError ( double MaximumRMSError ) { this->m_MaximumRMSError = MaximumRMSError; return *this; }
79 
82  double GetMaximumRMSError() const { return this->m_MaximumRMSError; }
83 
86  SITK_RETURN_SELF_TYPE_HEADER SetNumberOfIterations ( uint32_t NumberOfIterations ) { this->m_NumberOfIterations = NumberOfIterations; return *this; }
87 
90  uint32_t GetNumberOfIterations() const { return this->m_NumberOfIterations; }
91 
94  SITK_RETURN_SELF_TYPE_HEADER SetLambda1 ( double Lambda1 ) { this->m_Lambda1 = Lambda1; return *this; }
95 
98  double GetLambda1() const { return this->m_Lambda1; }
99 
102  SITK_RETURN_SELF_TYPE_HEADER SetLambda2 ( double Lambda2 ) { this->m_Lambda2 = Lambda2; return *this; }
103 
106  double GetLambda2() const { return this->m_Lambda2; }
107 
110  SITK_RETURN_SELF_TYPE_HEADER SetEpsilon ( double Epsilon ) { this->m_Epsilon = Epsilon; return *this; }
111 
114  double GetEpsilon() const { return this->m_Epsilon; }
115 
118  SITK_RETURN_SELF_TYPE_HEADER SetCurvatureWeight ( double CurvatureWeight ) { this->m_CurvatureWeight = CurvatureWeight; return *this; }
119 
122  double GetCurvatureWeight() const { return this->m_CurvatureWeight; }
123 
126  SITK_RETURN_SELF_TYPE_HEADER SetAreaWeight ( double AreaWeight ) { this->m_AreaWeight = AreaWeight; return *this; }
127 
130  double GetAreaWeight() const { return this->m_AreaWeight; }
131 
134  SITK_RETURN_SELF_TYPE_HEADER SetReinitializationSmoothingWeight ( double ReinitializationSmoothingWeight ) { this->m_ReinitializationSmoothingWeight = ReinitializationSmoothingWeight; return *this; }
135 
138  double GetReinitializationSmoothingWeight() const { return this->m_ReinitializationSmoothingWeight; }
139 
142  SITK_RETURN_SELF_TYPE_HEADER SetVolume ( double Volume ) { this->m_Volume = Volume; return *this; }
143 
146  double GetVolume() const { return this->m_Volume; }
147 
150  SITK_RETURN_SELF_TYPE_HEADER SetVolumeMatchingWeight ( double VolumeMatchingWeight ) { this->m_VolumeMatchingWeight = VolumeMatchingWeight; return *this; }
151 
154  double GetVolumeMatchingWeight() const { return this->m_VolumeMatchingWeight; }
155 
156  typedef enum {AtanRegularizedHeaviside,SinRegularizedHeaviside,Heaviside} HeavisideStepFunctionType;
157 
160  SITK_RETURN_SELF_TYPE_HEADER SetHeavisideStepFunction ( HeavisideStepFunctionType HeavisideStepFunction ) { this->m_HeavisideStepFunction = HeavisideStepFunction; return *this; }
161 
164  HeavisideStepFunctionType GetHeavisideStepFunction() const { return this->m_HeavisideStepFunction; }
165 
170  SITK_RETURN_SELF_TYPE_HEADER SetUseImageSpacing ( bool UseImageSpacing ) { this->m_UseImageSpacing = UseImageSpacing; return *this; }
171 
173  SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOn() { return this->SetUseImageSpacing(true); }
174  SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOff() { return this->SetUseImageSpacing(false); }
175 
180  bool GetUseImageSpacing() const { return this->m_UseImageSpacing; }
187  uint32_t GetElapsedIterations() const { return this->m_ElapsedIterations; };
188 
195  double GetRMSChange() const { return this->m_RMSChange; };
196 
198  std::string GetName() const { return std::string ("ScalarChanAndVeseDenseLevelSetImageFilter"); }
199 
201  std::string ToString() const;
202 
203 
205  Image Execute ( const Image& image1, const Image& image2 );
206 
207 
209  Image Execute ( const Image& image1, const Image& image2, double maximumRMSError, uint32_t numberOfIterations, double lambda1, double lambda2, double epsilon, double curvatureWeight, double areaWeight, double reinitializationSmoothingWeight, double volume, double volumeMatchingWeight, ScalarChanAndVeseDenseLevelSetImageFilter::HeavisideStepFunctionType heavisideStepFunction, bool useImageSpacing );
210 
211  private:
212 
215  typedef Image (Self::*MemberFunctionType)( const Image& image1, const Image& image2 );
216  template <class TImageType> Image ExecuteInternal ( const Image& image1, const Image& image2 );
217 
218 
219  friend struct detail::MemberFunctionAddressor<MemberFunctionType>;
220 
221  nsstd::auto_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
222 
223 
224  /* Value of RMS change below which the filter should stop. This is a convergence criterion. */
226  /* Number of iterations to run */
228  /* Lambda1. Internal intensity difference weight */
229  double m_Lambda1;
230  /* Lambda2. External intensity difference weight */
231  double m_Lambda2;
232  /* Width of regularization of Heaviside function. */
233  double m_Epsilon;
234  /* Gamma. Scales all curvature weight values */
236  /* Nu. Area regularization values */
237  double m_AreaWeight;
238  /* Weight of the laplacian smoothing term */
240  /* Pixel Volume = Number of pixels inside the level-set */
241  double m_Volume;
242  /* Volume matching weight. */
244  /* Step functions */
247 
249 
250  double m_RMSChange;
251 
252  };
253 
254 
263  SITKBasicFilters_EXPORT Image ScalarChanAndVeseDenseLevelSet ( const Image& image1, const Image& image2, 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 );
264 
265  }
266 }
267 #endif
#define SITKBasicFilters_EXPORT
Self & SetHeavisideStepFunction(HeavisideStepFunctionType HeavisideStepFunction)
double GetRMSChange() const
The Root Mean Square of the levelset upon termination.
typelist::MakeTypeList< BasicPixelID< float >, BasicPixelID< double > >::Type RealPixelIDTypeList
Dense implementation of the Chan and Vese multiphase level set image filter.
::uint32_t uint32_t
The Image class for SimpleITK.
Definition: sitkImage.h:78
nsstd::auto_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
Image ScalarChanAndVeseDenseLevelSet(const Image &image1, const Image &image2, 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.
The base interface for SimpleITK filters that take one input image.