SimpleITK  
sitkN4BiasFieldCorrectionImageFilter.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 sitkN4BiasFieldCorrectionImageFilter_h
19 #define sitkN4BiasFieldCorrectionImageFilter_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 
74  public:
76 
79 
83 
86 \
87 
91  SITK_RETURN_SELF_TYPE_HEADER SetConvergenceThreshold ( double ConvergenceThreshold ) { this->m_ConvergenceThreshold = ConvergenceThreshold; return *this; }
92 
96  double GetConvergenceThreshold() const { return this->m_ConvergenceThreshold; }\
97 
101  SITK_RETURN_SELF_TYPE_HEADER SetMaximumNumberOfIterations ( std::vector<uint32_t> MaximumNumberOfIterations ) { this->m_MaximumNumberOfIterations = MaximumNumberOfIterations; return *this; }
102 
106  std::vector<uint32_t> GetMaximumNumberOfIterations() const { return this->m_MaximumNumberOfIterations; }\
107 
111  SITK_RETURN_SELF_TYPE_HEADER SetBiasFieldFullWidthAtHalfMaximum ( double BiasFieldFullWidthAtHalfMaximum ) { this->m_BiasFieldFullWidthAtHalfMaximum = BiasFieldFullWidthAtHalfMaximum; return *this; }
112 
116  double GetBiasFieldFullWidthAtHalfMaximum() const { return this->m_BiasFieldFullWidthAtHalfMaximum; }\
117 
121  SITK_RETURN_SELF_TYPE_HEADER SetWienerFilterNoise ( double WienerFilterNoise ) { this->m_WienerFilterNoise = WienerFilterNoise; return *this; }
122 
126  double GetWienerFilterNoise() const { return this->m_WienerFilterNoise; }\
127 
131  SITK_RETURN_SELF_TYPE_HEADER SetNumberOfHistogramBins ( uint32_t NumberOfHistogramBins ) { this->m_NumberOfHistogramBins = NumberOfHistogramBins; return *this; }
132 
136  uint32_t GetNumberOfHistogramBins() const { return this->m_NumberOfHistogramBins; }\
137 
141  SITK_RETURN_SELF_TYPE_HEADER SetNumberOfControlPoints ( std::vector<uint32_t> NumberOfControlPoints ) { this->m_NumberOfControlPoints = std::move(NumberOfControlPoints); return *this; }
142 
144  SITK_RETURN_SELF_TYPE_HEADER SetNumberOfControlPoints( uint32_t value ) { this->m_NumberOfControlPoints = std::vector<uint32_t>(3, value); return *this; }
145 
149  std::vector<uint32_t> GetNumberOfControlPoints() const { return this->m_NumberOfControlPoints; }\
150 
154  SITK_RETURN_SELF_TYPE_HEADER SetSplineOrder ( uint32_t SplineOrder ) { this->m_SplineOrder = SplineOrder; return *this; }
155 
159  uint32_t GetSplineOrder() const { return this->m_SplineOrder; }\
160 
164  SITK_RETURN_SELF_TYPE_HEADER SetUseMaskLabel ( bool UseMaskLabel ) { this->m_UseMaskLabel = UseMaskLabel; return *this; }
165 
167  SITK_RETURN_SELF_TYPE_HEADER UseMaskLabelOn() { return this->SetUseMaskLabel(true); }
168  SITK_RETURN_SELF_TYPE_HEADER UseMaskLabelOff() { return this->SetUseMaskLabel(false); }
169 
173  bool GetUseMaskLabel() const { return this->m_UseMaskLabel; }\
174 
178  SITK_RETURN_SELF_TYPE_HEADER SetMaskLabel ( uint8_t MaskLabel ) { this->m_MaskLabel = MaskLabel; return *this; }
179 
183  uint8_t GetMaskLabel() const { return this->m_MaskLabel; }
191  uint32_t GetCurrentLevel() const { return this->m_pfGetCurrentLevel(); };
192 
200  uint32_t GetElapsedIterations() const { return this->m_pfGetElapsedIterations(); };
201 
209  double GetCurrentConvergenceMeasurement() const { return this->m_pfGetCurrentConvergenceMeasurement(); };
210 
219  Image GetLogBiasFieldAsImage(Image referenceImage) const { return this->m_pfGetLogBiasFieldAsImage(referenceImage); };
220 
221 
223  std::string GetName() const { return std::string ("N4BiasFieldCorrectionImageFilter"); }
224 
226  std::string ToString() const;
227 
228 
231  Image Execute ( const Image & image, const Image & maskImage );
232  Image Execute ( const Image & image );
233 
234  private:
235 
238  using MemberFunctionType = Image (Self::*)( const Image * image, const Image * maskImage );
239  template <class TImageType> Image ExecuteInternal ( const Image * image, const Image * maskImage );
240 
241 
243 
244  std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
245 
246 
247  /* */
248  double m_ConvergenceThreshold{0.001};
249 
250  /* odo this variable needs to be printed */
251  std::vector<uint32_t> m_MaximumNumberOfIterations{std::vector<uint32_t>(4,50)};
252 
253  /* */
254  double m_BiasFieldFullWidthAtHalfMaximum{0.15};
255 
256  /* */
257  double m_WienerFilterNoise{0.01};
258 
259  /* */
260  uint32_t m_NumberOfHistogramBins{200u};
261 
262  /* */
263  std::vector<uint32_t> m_NumberOfControlPoints{std::vector<uint32_t>(3, 4)};
264 
265  /* */
266  uint32_t m_SplineOrder{3u};
267 
268  bool m_UseMaskLabel{true};
269 
270  uint8_t m_MaskLabel{1};
271 
272  /* Some global documentation */
273  std::function<uint32_t()> m_pfGetCurrentLevel;
274  /* Some global documentation */
275  std::function<uint32_t()> m_pfGetElapsedIterations;
276  /* Some global documentation */
277  std::function<double()> m_pfGetCurrentConvergenceMeasurement;
278  /* Some global documentation */
280 
281  // Holder of process object for active measurements
282  itk::ProcessObject *m_Filter{nullptr};
283 
284  };
285 
296  SITKBasicFilters_EXPORT Image N4BiasFieldCorrection ( const Image & image, const Image & maskImage, double convergenceThreshold = 0.001, std::vector<uint32_t> maximumNumberOfIterations = std::vector<uint32_t>(4,50), double biasFieldFullWidthAtHalfMaximum = 0.15, double wienerFilterNoise = 0.01, uint32_t numberOfHistogramBins = 200u, std::vector<uint32_t> numberOfControlPoints = std::vector<uint32_t>(3, 4), uint32_t splineOrder = 3u, bool useMaskLabel = true, uint8_t maskLabel = 1 );
297  SITKBasicFilters_EXPORT Image N4BiasFieldCorrection ( const Image & image, double convergenceThreshold = 0.001, std::vector<uint32_t> maximumNumberOfIterations = std::vector<uint32_t>(4,50), double biasFieldFullWidthAtHalfMaximum = 0.15, double wienerFilterNoise = 0.01, uint32_t numberOfHistogramBins = 200u, std::vector<uint32_t> numberOfControlPoints = std::vector<uint32_t>(3, 4), uint32_t splineOrder = 3u, bool useMaskLabel = true, uint8_t maskLabel = 1 );
299 }
300 #endif
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:76
itk::simple::N4BiasFieldCorrectionImageFilter::m_MemberFactory
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
Definition: sitkN4BiasFieldCorrectionImageFilter.h:244
sitkBasicFilters.h
itk::simple::N4BiasFieldCorrectionImageFilter::SetNumberOfHistogramBins
Self & SetNumberOfHistogramBins(uint32_t NumberOfHistogramBins)
Definition: sitkN4BiasFieldCorrectionImageFilter.h:131
itk::simple::RealPixelIDTypeList
typelist2::typelist< BasicPixelID< float >, BasicPixelID< double > > RealPixelIDTypeList
Definition: sitkPixelIDTypeLists.h:98
itk::simple::N4BiasFieldCorrectionImageFilter::m_pfGetCurrentConvergenceMeasurement
std::function< double()> m_pfGetCurrentConvergenceMeasurement
Definition: sitkN4BiasFieldCorrectionImageFilter.h:277
itk::simple::detail::MemberFunctionAddressor
Definition: sitkDetail.h:29
itk::simple::N4BiasFieldCorrectionImageFilter::SetNumberOfControlPoints
Self & SetNumberOfControlPoints(std::vector< uint32_t > NumberOfControlPoints)
Definition: sitkN4BiasFieldCorrectionImageFilter.h:141
itk::simple::N4BiasFieldCorrectionImageFilter::GetMaximumNumberOfIterations
std::vector< uint32_t > GetMaximumNumberOfIterations() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:106
itk::simple::N4BiasFieldCorrectionImageFilter::m_pfGetElapsedIterations
std::function< uint32_t()> m_pfGetElapsedIterations
Definition: sitkN4BiasFieldCorrectionImageFilter.h:275
itk::simple::N4BiasFieldCorrectionImageFilter::GetNumberOfHistogramBins
uint32_t GetNumberOfHistogramBins() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:136
itk::simple::N4BiasFieldCorrectionImageFilter::GetNumberOfControlPoints
std::vector< uint32_t > GetNumberOfControlPoints() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:149
itk::simple::N4BiasFieldCorrectionImageFilter::GetElapsedIterations
uint32_t GetElapsedIterations() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:200
itk::simple::N4BiasFieldCorrectionImageFilter
Implementation of the N4 bias field correction algorithm.
Definition: sitkN4BiasFieldCorrectionImageFilter.h:73
itk::simple::N4BiasFieldCorrectionImageFilter::m_pfGetLogBiasFieldAsImage
std::function< Image(Image)> m_pfGetLogBiasFieldAsImage
Definition: sitkN4BiasFieldCorrectionImageFilter.h:279
sitkImageFilter.h
itk::simple::N4BiasFieldCorrectionImageFilter::MemberFunctionType
Image(Self::*)(const Image *image, const Image *maskImage) MemberFunctionType
Definition: sitkN4BiasFieldCorrectionImageFilter.h:238
itk::simple::N4BiasFieldCorrectionImageFilter::SetNumberOfControlPoints
Self & SetNumberOfControlPoints(uint32_t value)
Definition: sitkN4BiasFieldCorrectionImageFilter.h:144
itk::simple::N4BiasFieldCorrectionImageFilter::GetName
std::string GetName() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:223
itk::simple::N4BiasFieldCorrectionImageFilter::SetBiasFieldFullWidthAtHalfMaximum
Self & SetBiasFieldFullWidthAtHalfMaximum(double BiasFieldFullWidthAtHalfMaximum)
Definition: sitkN4BiasFieldCorrectionImageFilter.h:111
itk::simple::N4BiasFieldCorrectionImageFilter::m_pfGetCurrentLevel
std::function< uint32_t()> m_pfGetCurrentLevel
Definition: sitkN4BiasFieldCorrectionImageFilter.h:273
itk::simple::N4BiasFieldCorrectionImageFilter::SetConvergenceThreshold
Self & SetConvergenceThreshold(double ConvergenceThreshold)
Definition: sitkN4BiasFieldCorrectionImageFilter.h:91
itk::simple::N4BiasFieldCorrectionImageFilter::SetMaximumNumberOfIterations
Self & SetMaximumNumberOfIterations(std::vector< uint32_t > MaximumNumberOfIterations)
Definition: sitkN4BiasFieldCorrectionImageFilter.h:101
itk::simple::N4BiasFieldCorrectionImageFilter::PixelIDTypeList
RealPixelIDTypeList PixelIDTypeList
Definition: sitkN4BiasFieldCorrectionImageFilter.h:85
itk::simple::N4BiasFieldCorrectionImageFilter::SetMaskLabel
Self & SetMaskLabel(uint8_t MaskLabel)
Definition: sitkN4BiasFieldCorrectionImageFilter.h:178
itk::simple::N4BiasFieldCorrection
Image N4BiasFieldCorrection(const Image &image, const Image &maskImage, double convergenceThreshold=0.001, std::vector< uint32_t > maximumNumberOfIterations=std::vector< uint32_t >(4, 50), double biasFieldFullWidthAtHalfMaximum=0.15, double wienerFilterNoise=0.01, uint32_t numberOfHistogramBins=200u, std::vector< uint32_t > numberOfControlPoints=std::vector< uint32_t >(3, 4), uint32_t splineOrder=3u, bool useMaskLabel=true, uint8_t maskLabel=1)
Implementation of the N4 bias field correction algorithm.
SITKBasicFilters_EXPORT
#define SITKBasicFilters_EXPORT
Definition: sitkBasicFilters.h:52
itk::simple::N4BiasFieldCorrectionImageFilter::SetUseMaskLabel
Self & SetUseMaskLabel(bool UseMaskLabel)
Definition: sitkN4BiasFieldCorrectionImageFilter.h:164
itk::simple::N4BiasFieldCorrectionImageFilter::GetLogBiasFieldAsImage
Image GetLogBiasFieldAsImage(Image referenceImage) const
The computed log bias field correction. Typically, a reduced size image is used as input to the N4 fi...
Definition: sitkN4BiasFieldCorrectionImageFilter.h:219
itk::simple::N4BiasFieldCorrectionImageFilter::GetUseMaskLabel
bool GetUseMaskLabel() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:173
itk::simple::N4BiasFieldCorrectionImageFilter::GetSplineOrder
uint32_t GetSplineOrder() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:159
itk::simple::N4BiasFieldCorrectionImageFilter::SetWienerFilterNoise
Self & SetWienerFilterNoise(double WienerFilterNoise)
Definition: sitkN4BiasFieldCorrectionImageFilter.h:121
itk::simple::N4BiasFieldCorrectionImageFilter::GetMaskLabel
uint8_t GetMaskLabel() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:183
itk::simple::N4BiasFieldCorrectionImageFilter::GetConvergenceThreshold
double GetConvergenceThreshold() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:96
itk::simple::N4BiasFieldCorrectionImageFilter::SetSplineOrder
Self & SetSplineOrder(uint32_t SplineOrder)
Definition: sitkN4BiasFieldCorrectionImageFilter.h:154
itk::ProcessObject
itk::simple::N4BiasFieldCorrectionImageFilter::GetCurrentLevel
uint32_t GetCurrentLevel() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:191
itk::simple::ImageFilter
The base interface for SimpleITK filters that take one input image.
Definition: sitkImageFilter.h:35
itk::simple::N4BiasFieldCorrectionImageFilter::GetCurrentConvergenceMeasurement
double GetCurrentConvergenceMeasurement() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:209
itk::Image
Definition: sitkPixelIDTypes.h:28
itk::simple::N4BiasFieldCorrectionImageFilter::UseMaskLabelOff
Self & UseMaskLabelOff()
Definition: sitkN4BiasFieldCorrectionImageFilter.h:168
itk::simple::N4BiasFieldCorrectionImageFilter::UseMaskLabelOn
Self & UseMaskLabelOn()
Definition: sitkN4BiasFieldCorrectionImageFilter.h:167
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::N4BiasFieldCorrectionImageFilter::GetBiasFieldFullWidthAtHalfMaximum
double GetBiasFieldFullWidthAtHalfMaximum() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:116
itk::simple::N4BiasFieldCorrectionImageFilter::GetWienerFilterNoise
double GetWienerFilterNoise() const
Definition: sitkN4BiasFieldCorrectionImageFilter.h:126