18 #ifndef itkN4BiasFieldCorrectionImageFilter_h
19 #define itkN4BiasFieldCorrectionImageFilter_h
28 #include "vnl/vnl_vector.h"
93 template <
typename TInputImage,
94 typename TMaskImage = Image<unsigned char, TInputImage::ImageDimension>,
95 class TOutputImage = TInputImage>
114 static constexpr
unsigned int ImageDimension = TInputImage::ImageDimension;
141 EnlargeOutputRequestedRegion(
DataObject *)
override;
149 this->SetInput(image);
157 itkSetInputMacro(MaskImage, MaskImageType);
161 this->SetMaskImage(mask);
170 itkGetInputMacro(MaskImage, MaskImageType);
180 itkSetMacro(MaskLabel, MaskPixelType);
181 itkGetConstMacro(MaskLabel, MaskPixelType);
187 itkSetMacro(UseMaskLabel,
bool);
188 itkGetConstMacro(UseMaskLabel,
bool);
189 itkBooleanMacro(UseMaskLabel);
202 itkSetInputMacro(ConfidenceImage, RealImageType);
206 this->SetConfidenceImage(image);
220 itkGetInputMacro(ConfidenceImage, RealImageType);
231 itkSetMacro(NumberOfHistogramBins,
unsigned int);
237 itkGetConstMacro(NumberOfHistogramBins,
unsigned int);
242 itkSetMacro(WienerFilterNoise, RealType);
247 itkGetConstMacro(WienerFilterNoise, RealType);
253 itkSetMacro(BiasFieldFullWidthAtHalfMaximum, RealType);
259 itkGetConstMacro(BiasFieldFullWidthAtHalfMaximum, RealType);
266 itkSetMacro(SplineOrder,
unsigned int);
271 itkGetConstMacro(SplineOrder,
unsigned int);
280 itkSetMacro(NumberOfControlPoints, ArrayType);
289 itkGetConstMacro(NumberOfControlPoints, ArrayType);
297 itkSetMacro(NumberOfFittingLevels, ArrayType);
311 this->SetNumberOfFittingLevels(nlevels);
320 itkGetConstMacro(NumberOfFittingLevels, ArrayType);
326 itkSetMacro(MaximumNumberOfIterations, VariableSizeArrayType);
332 itkGetConstMacro(MaximumNumberOfIterations, VariableSizeArrayType);
341 itkSetMacro(ConvergenceThreshold, RealType);
350 itkGetConstMacro(ConvergenceThreshold, RealType);
361 itkGetConstObjectMacro(LogBiasFieldControlPointLattice, BiasFieldControlPointLatticeType);
367 itkGetConstMacro(ElapsedIterations,
unsigned int);
373 itkGetConstMacro(CurrentConvergenceMeasurement, RealType);
379 itkGetConstMacro(CurrentLevel,
unsigned int);
385 ReconstructBiasField(
const BiasFieldControlPointLatticeType *);
391 PrintSelf(std::ostream & os,
Indent indent)
const override;
394 GenerateData()
override;
411 SharpenImage(
const RealImageType * unsharpenedImage, RealImageType * sharpenedImage)
const;
419 UpdateBiasFieldEstimate(RealImageType *,
size_t);
426 CalculateConvergenceMeasurement(
const RealImageType *,
const RealImageType *)
const;
429 bool m_UseMaskLabel{
false };
433 unsigned int m_NumberOfHistogramBins{ 200 };
434 RealType m_WienerFilterNoise{ static_cast<RealType>(0.01) };
435 RealType m_BiasFieldFullWidthAtHalfMaximum{ static_cast<RealType>(0.15) };
440 unsigned int m_ElapsedIterations{ 0 };
441 RealType m_ConvergenceThreshold{ static_cast<RealType>(0.001) };
443 unsigned int m_CurrentLevel{ 0 };
449 unsigned int m_SplineOrder{ 3 };
456 #ifndef ITK_MANUAL_INSTANTIATION
457 # include "itkN4BiasFieldCorrectionImageFilter.hxx"