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 
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 
132  double GetReinitializationSmoothingWeight() const { return this->m_ReinitializationSmoothingWeight; }\
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 
154  SITK_RETURN_SELF_TYPE_HEADER SetHeavisideStepFunction ( HeavisideStepFunctionType HeavisideStepFunction ) { this->m_HeavisideStepFunction = HeavisideStepFunction; return *this; }
155 
158  HeavisideStepFunctionType GetHeavisideStepFunction() const { return this->m_HeavisideStepFunction; }\
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 
201  Image Execute ( const Image & initialImage, const Image & featureImage );
202 
203  private:
204 
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 */
238  double m_ReinitializationSmoothingWeight{0.0};
239 
240  /* Pixel Volume = Number of pixels inside the level-set */
241  double m_Volume{0.0};
242 
243  /* Volume matching weight. */
244  double m_VolumeMatchingWeight{0.0};
245 
246  /* Step functions */
248 
249  bool m_UseImageSpacing{true};
250 
251 
252  uint32_t m_ElapsedIterations{0};
253 
254  double m_RMSChange{0.0};
255 
256 
257  };
258 
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
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:76
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetNumberOfIterations
uint32_t GetNumberOfIterations() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:84
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetUseImageSpacing
bool GetUseImageSpacing() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:174
sitkBasicFilters.h
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::UseImageSpacingOff
Self & UseImageSpacingOff()
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:168
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetVolumeMatchingWeight
double GetVolumeMatchingWeight() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:148
itk::simple::RealPixelIDTypeList
typelist2::typelist< BasicPixelID< float >, BasicPixelID< double > > RealPixelIDTypeList
Definition: sitkPixelIDTypeLists.h:98
itk::simple::detail::MemberFunctionAddressor
Definition: sitkDetail.h:29
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetVolume
Self & SetVolume(double Volume)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:136
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetVolumeMatchingWeight
Self & SetVolumeMatchingWeight(double VolumeMatchingWeight)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:144
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetNumberOfIterations
Self & SetNumberOfIterations(uint32_t NumberOfIterations)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:80
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetReinitializationSmoothingWeight
double GetReinitializationSmoothingWeight() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:132
itk::HeavisideStepFunction
sitkImageFilter.h
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetCurvatureWeight
double GetCurvatureWeight() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:116
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetLambda2
Self & SetLambda2(double Lambda2)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:96
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::AtanRegularizedHeaviside
@ AtanRegularizedHeaviside
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:150
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetVolume
double GetVolume() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:140
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetHeavisideStepFunction
Self & SetHeavisideStepFunction(HeavisideStepFunctionType HeavisideStepFunction)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:154
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetLambda1
double GetLambda1() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:92
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:181
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetHeavisideStepFunction
HeavisideStepFunctionType GetHeavisideStepFunction() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:158
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetRMSChange
double GetRMSChange() const
The Root Mean Square of the levelset upon termination.
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:189
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetUseImageSpacing
Self & SetUseImageSpacing(bool UseImageSpacing)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:164
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetMaximumRMSError
double GetMaximumRMSError() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:76
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter
Dense implementation of the Chan and Vese multiphase level set image filter.
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:55
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetAreaWeight
double GetAreaWeight() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:124
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::UseImageSpacingOn
Self & UseImageSpacingOn()
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:167
SITKBasicFilters_EXPORT
#define SITKBasicFilters_EXPORT
Definition: sitkBasicFilters.h:52
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetLambda2
double GetLambda2() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:100
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetEpsilon
Self & SetEpsilon(double Epsilon)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:104
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::HeavisideStepFunctionType
HeavisideStepFunctionType
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:150
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetReinitializationSmoothingWeight
Self & SetReinitializationSmoothingWeight(double ReinitializationSmoothingWeight)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:128
itk::simple::ImageFilter
The base interface for SimpleITK filters that take one input image.
Definition: sitkImageFilter.h:35
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetMaximumRMSError
Self & SetMaximumRMSError(double MaximumRMSError)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:72
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SinRegularizedHeaviside
@ SinRegularizedHeaviside
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:150
itk::Image
Definition: sitkPixelIDTypes.h:28
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::MemberFunctionType
Image(Self::*)(const Image *initialImage, const Image *featureImage) MemberFunctionType
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:207
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetName
std::string GetName() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:193
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::m_MemberFactory
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:213
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetCurvatureWeight
Self & SetCurvatureWeight(double CurvatureWeight)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:112
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetLambda1
Self & SetLambda1(double Lambda1)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:88
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::PixelIDTypeList
RealPixelIDTypeList PixelIDTypeList
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:67
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::GetEpsilon
double GetEpsilon() const
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:108
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::SetAreaWeight
Self & SetAreaWeight(double AreaWeight)
Definition: sitkScalarChanAndVeseDenseLevelSetImageFilter.h:120