SimpleITK  1.0.1
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 
67  public:
69 
73 
76 
79 
80 
81 
84  SITK_RETURN_SELF_TYPE_HEADER SetMaximumRMSError ( double MaximumRMSError ) { this->m_MaximumRMSError = MaximumRMSError; return *this; }
85 
88  double GetMaximumRMSError() const { return this->m_MaximumRMSError; }
89 
92  SITK_RETURN_SELF_TYPE_HEADER SetNumberOfIterations ( uint32_t NumberOfIterations ) { this->m_NumberOfIterations = NumberOfIterations; return *this; }
93 
96  uint32_t GetNumberOfIterations() const { return this->m_NumberOfIterations; }
97 
100  SITK_RETURN_SELF_TYPE_HEADER SetLambda1 ( double Lambda1 ) { this->m_Lambda1 = Lambda1; return *this; }
101 
104  double GetLambda1() const { return this->m_Lambda1; }
105 
108  SITK_RETURN_SELF_TYPE_HEADER SetLambda2 ( double Lambda2 ) { this->m_Lambda2 = Lambda2; return *this; }
109 
112  double GetLambda2() const { return this->m_Lambda2; }
113 
116  SITK_RETURN_SELF_TYPE_HEADER SetEpsilon ( double Epsilon ) { this->m_Epsilon = Epsilon; return *this; }
117 
120  double GetEpsilon() const { return this->m_Epsilon; }
121 
124  SITK_RETURN_SELF_TYPE_HEADER SetCurvatureWeight ( double CurvatureWeight ) { this->m_CurvatureWeight = CurvatureWeight; return *this; }
125 
128  double GetCurvatureWeight() const { return this->m_CurvatureWeight; }
129 
132  SITK_RETURN_SELF_TYPE_HEADER SetAreaWeight ( double AreaWeight ) { this->m_AreaWeight = AreaWeight; return *this; }
133 
136  double GetAreaWeight() const { return this->m_AreaWeight; }
137 
140  SITK_RETURN_SELF_TYPE_HEADER SetReinitializationSmoothingWeight ( double ReinitializationSmoothingWeight ) { this->m_ReinitializationSmoothingWeight = ReinitializationSmoothingWeight; return *this; }
141 
144  double GetReinitializationSmoothingWeight() const { return this->m_ReinitializationSmoothingWeight; }
145 
148  SITK_RETURN_SELF_TYPE_HEADER SetVolume ( double Volume ) { this->m_Volume = Volume; return *this; }
149 
152  double GetVolume() const { return this->m_Volume; }
153 
156  SITK_RETURN_SELF_TYPE_HEADER SetVolumeMatchingWeight ( double VolumeMatchingWeight ) { this->m_VolumeMatchingWeight = VolumeMatchingWeight; return *this; }
157 
160  double GetVolumeMatchingWeight() const { return this->m_VolumeMatchingWeight; }
161 
162  typedef enum {AtanRegularizedHeaviside,SinRegularizedHeaviside,Heaviside} HeavisideStepFunctionType;
163 
166  SITK_RETURN_SELF_TYPE_HEADER SetHeavisideStepFunction ( HeavisideStepFunctionType HeavisideStepFunction ) { this->m_HeavisideStepFunction = HeavisideStepFunction; return *this; }
167 
170  HeavisideStepFunctionType GetHeavisideStepFunction() const { return this->m_HeavisideStepFunction; }
171 
176  SITK_RETURN_SELF_TYPE_HEADER SetUseImageSpacing ( bool UseImageSpacing ) { this->m_UseImageSpacing = UseImageSpacing; return *this; }
177 
179  SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOn() { return this->SetUseImageSpacing(true); }
180  SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOff() { return this->SetUseImageSpacing(false); }
181 
186  bool GetUseImageSpacing() const { return this->m_UseImageSpacing; }
193  uint32_t GetElapsedIterations() const { return this->m_ElapsedIterations; };
194 
201  double GetRMSChange() const { return this->m_RMSChange; };
202 
204  std::string GetName() const { return std::string ("ScalarChanAndVeseDenseLevelSetImageFilter"); }
205 
207  std::string ToString() const;
208 
209 
211  Image Execute ( const Image& image1, const Image& image2 );
212 
213 
215  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 );
216 
217 
218  private:
219 
222  typedef Image (Self::*MemberFunctionType)( const Image& image1, const Image& image2 );
223  template <class TImageType> Image ExecuteInternal ( const Image& image1, const Image& image2 );
224 
225 
226 
227  friend struct detail::MemberFunctionAddressor<MemberFunctionType>;
228 
229  nsstd::auto_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
230 
231 
232  /* Value of RMS change below which the filter should stop. This is a convergence criterion. */
234  /* Number of iterations to run */
236  /* Lambda1. Internal intensity difference weight */
237  double m_Lambda1;
238  /* Lambda2. External intensity difference weight */
239  double m_Lambda2;
240  /* Width of regularization of Heaviside function. */
241  double m_Epsilon;
242  /* Gamma. Scales all curvature weight values */
244  /* Nu. Area regularization values */
245  double m_AreaWeight;
246  /* Weight of the laplacian smoothing term */
248  /* Pixel Volume = Number of pixels inside the level-set */
249  double m_Volume;
250  /* Volume matching weight. */
252  /* Step functions */
255 
257 
258  double m_RMSChange;
259 
260  };
261 
262 
263 
272  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 );
273 
274  }
275 }
276 #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 main Image class for SimpleITK.
Definition: sitkImage.h:54
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.