18 #ifndef sitkN4BiasFieldCorrectionImageFilter_h
19 #define sitkN4BiasFieldCorrectionImageFilter_h
90 SITK_RETURN_SELF_TYPE_HEADER
SetConvergenceThreshold (
double ConvergenceThreshold ) { this->m_ConvergenceThreshold = ConvergenceThreshold;
return *
this; }
100 SITK_RETURN_SELF_TYPE_HEADER
SetMaximumNumberOfIterations ( std::vector<uint32_t> MaximumNumberOfIterations ) { this->m_MaximumNumberOfIterations = MaximumNumberOfIterations;
return *
this; }
110 SITK_RETURN_SELF_TYPE_HEADER
SetBiasFieldFullWidthAtHalfMaximum (
double BiasFieldFullWidthAtHalfMaximum ) { this->m_BiasFieldFullWidthAtHalfMaximum = BiasFieldFullWidthAtHalfMaximum;
return *
this; }
120 SITK_RETURN_SELF_TYPE_HEADER
SetWienerFilterNoise (
double WienerFilterNoise ) { this->m_WienerFilterNoise = WienerFilterNoise;
return *
this; }
140 SITK_RETURN_SELF_TYPE_HEADER
SetNumberOfControlPoints (
const std::vector<uint32_t> & NumberOfControlPoints ) { this->m_NumberOfControlPoints = NumberOfControlPoints;
return *
this; }
154 SITK_RETURN_SELF_TYPE_HEADER
SetSplineOrder (
uint32_t SplineOrder ) { this->m_SplineOrder = SplineOrder;
return *
this; }
164 SITK_RETURN_SELF_TYPE_HEADER
SetUseMaskLabel (
bool UseMaskLabel ) { this->m_UseMaskLabel = UseMaskLabel;
return *
this; }
167 SITK_RETURN_SELF_TYPE_HEADER
UseMaskLabelOn() {
return this->SetUseMaskLabel(
true); }
168 SITK_RETURN_SELF_TYPE_HEADER
UseMaskLabelOff() {
return this->SetUseMaskLabel(
false); }
178 SITK_RETURN_SELF_TYPE_HEADER
SetMaskLabel (
uint8_t MaskLabel ) { this->m_MaskLabel = MaskLabel;
return *
this; }
185 std::string
GetName()
const {
return std::string (
"N4BiasFieldCorrectionImageFilter"); }
188 std::string ToString()
const;
197 Image Execute (
const Image & image,
const Image & maskImage,
double convergenceThreshold, std::vector<uint32_t> maximumNumberOfIterations,
double biasFieldFullWidthAtHalfMaximum,
double wienerFilterNoise,
uint32_t numberOfHistogramBins,
const std::vector<uint32_t> & numberOfControlPoints,
uint32_t splineOrder,
bool useMaskLabel,
uint8_t maskLabel );
198 Image Execute (
const Image & image,
double convergenceThreshold, std::vector<uint32_t> maximumNumberOfIterations,
double biasFieldFullWidthAtHalfMaximum,
double wienerFilterNoise,
uint32_t numberOfHistogramBins,
const std::vector<uint32_t> & numberOfControlPoints,
uint32_t splineOrder,
bool useMaskLabel,
uint8_t maskLabel );
204 typedef Image (Self::*MemberFunctionType)(
const Image * image,
const Image * maskImage );
205 template <
class TImageType>
Image ExecuteInternal (
const Image * image,
const Image * maskImage );
240 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,
const std::vector<uint32_t> & numberOfControlPoints = std::vector<uint32_t>(3, 4),
uint32_t splineOrder = 3u,
bool useMaskLabel =
true,
uint8_t maskLabel = 1 );
241 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,
const std::vector<uint32_t> & numberOfControlPoints = std::vector<uint32_t>(3, 4),
uint32_t splineOrder = 3u,
bool useMaskLabel =
true,
uint8_t maskLabel = 1 );
Self & SetWienerFilterNoise(double WienerFilterNoise)
Self & SetNumberOfControlPoints(uint32_t value)
double m_WienerFilterNoise
bool GetUseMaskLabel() const
Self & SetNumberOfHistogramBins(uint32_t NumberOfHistogramBins)
std::vector< uint32_t > m_NumberOfControlPoints
#define SITKBasicFilters_EXPORT
double m_BiasFieldFullWidthAtHalfMaximum
Self & SetConvergenceThreshold(double ConvergenceThreshold)
Self & SetMaximumNumberOfIterations(std::vector< uint32_t > MaximumNumberOfIterations)
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, const 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.
typelist::MakeTypeList< BasicPixelID< float >, BasicPixelID< double > >::Type RealPixelIDTypeList
double m_ConvergenceThreshold
std::vector< uint32_t > m_MaximumNumberOfIterations
double GetConvergenceThreshold() const
Self & SetMaskLabel(uint8_t MaskLabel)
uint32_t GetNumberOfHistogramBins() const
double GetWienerFilterNoise() const
Implementation of the N4 bias field correction algorithm.
std::string GetName() const
nsstd::auto_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
uint32_t GetSplineOrder() const
The Image class for SimpleITK.
std::vector< uint32_t > GetNumberOfControlPoints() const
Self & SetBiasFieldFullWidthAtHalfMaximum(double BiasFieldFullWidthAtHalfMaximum)
Self & SetNumberOfControlPoints(const std::vector< uint32_t > &NumberOfControlPoints)
RealPixelIDTypeList PixelIDTypeList
Self & SetUseMaskLabel(bool UseMaskLabel)
Self & SetSplineOrder(uint32_t SplineOrder)
uint32_t m_NumberOfHistogramBins
std::vector< uint32_t > GetMaximumNumberOfIterations() const
The base interface for SimpleITK filters that take one input image.
uint8_t GetMaskLabel() const
N4BiasFieldCorrectionImageFilter Self
double GetBiasFieldFullWidthAtHalfMaximum() const