18 #ifndef __itkMRIBiasFieldCorrectionFilter_h
19 #define __itkMRIBiasFieldCorrectionFilter_h
46 template<
class TImage,
class TImageMask,
class TBiasField >
224 template<
class TInputImage,
class TOutputImage,
class TMaskImage >
242 itkStaticConstMacro(ImageDimension,
unsigned int,
243 TOutputImage::ImageDimension);
312 void IsBiasFieldMultiplicative(
bool flag)
313 { m_BiasMultiplicative = flag; }
316 bool IsBiasFieldMultiplicative()
317 {
return m_BiasMultiplicative; }
322 itkSetMacro(UsingInterSliceIntensityCorrection,
bool);
323 itkGetConstReferenceMacro(UsingInterSliceIntensityCorrection,
bool);
331 itkSetMacro(UsingSlabIdentification,
bool);
332 itkGetConstReferenceMacro(UsingSlabIdentification,
bool);
335 itkSetMacro(SlabBackgroundMinimumThreshold, InputImagePixelType);
336 itkGetConstReferenceMacro(SlabBackgroundMinimumThreshold,
337 InputImagePixelType);
339 itkSetMacro(SlabNumberOfSamples,
unsigned int);
340 itkGetConstReferenceMacro(SlabNumberOfSamples,
unsigned int);
342 itkSetMacro(SlabTolerance,
double);
343 itkGetConstReferenceMacro(SlabTolerance,
double);
350 itkSetMacro(UsingBiasFieldCorrection,
bool);
351 itkGetConstReferenceMacro(UsingBiasFieldCorrection,
bool);
356 itkSetMacro(GeneratingOutput,
bool);
357 itkGetConstReferenceMacro(GeneratingOutput,
bool);
362 itkSetMacro(SlicingDirection,
int);
365 itkSetMacro(BiasFieldDegree,
int);
366 itkGetConstMacro(BiasFieldDegree,
int);
371 void SetInitialBiasFieldCoefficients(
const
374 { this->Modified(); m_BiasFieldCoefficients = coefficients; }
380 {
return m_EstimatedBiasFieldCoefficients; }
390 itkSetMacro(VolumeCorrectionMaximumIteration,
int);
391 itkGetConstMacro(VolumeCorrectionMaximumIteration,
int);
392 itkSetMacro(InterSliceCorrectionMaximumIteration,
int);
393 itkGetConstMacro(InterSliceCorrectionMaximumIteration,
int);
397 void SetOptimizerInitialRadius(
double initRadius)
398 { m_OptimizerInitialRadius = initRadius; }
399 double GetOptimizerInitialRadius()
400 {
return m_OptimizerInitialRadius; }
404 itkSetMacro(OptimizerGrowthFactor,
double);
405 itkGetConstMacro(OptimizerGrowthFactor,
double);
410 itkSetMacro(OptimizerShrinkFactor,
double);
411 itkGetConstMacro(OptimizerShrinkFactor,
double);
419 void SetNumberOfLevels(
unsigned int num);
422 itkGetConstMacro(NumberOfLevels,
unsigned int);
430 void SetSchedule(
const ScheduleType & schedule);
433 itkGetConstReferenceMacro(Schedule, ScheduleType);
439 void SetStartingShrinkFactors(
unsigned int factor);
441 void SetStartingShrinkFactors(
unsigned int *factors);
444 const unsigned int * GetStartingShrinkFactors()
const;
449 static bool IsScheduleDownwardDivisible(
const ScheduleType & schedule);
462 BiasFieldType EstimateBiasField(InputImageRegionType region,
464 int maximumIteration);
469 void CorrectImage(BiasFieldType & bias,
470 InputImageRegionType region);
474 void CorrectInterSliceIntensityInhomogeneity(InputImageRegionType region);
478 virtual ~MRIBiasFieldCorrectionFilter();
479 void PrintSelf(std::ostream & os,
Indent indent) const;
483 bool CheckMaskImage(ImageMaskType *mask);
489 void Log1PImage(InternalImageType *source,
490 InternalImageType *target);
494 void ExpImage(InternalImageType *source,
495 InternalImageType *target);
499 template< class TSource, class TTarget >
500 void CopyAndConvertImage(const TSource *source,
502 typename TTarget::RegionType requestedRegion)
506 typedef typename TTarget::PixelType TargetPixelType;
508 SourceIterator s_iter(source, requestedRegion);
509 TargetIterator t_iter(target, requestedRegion);
513 while ( !s_iter.IsAtEnd() )
515 t_iter.Set( static_cast< TargetPixelType >( s_iter.Get() ) );
525 void GetBiasFieldSize(InputImageRegionType region,
526 BiasFieldType::DomainSizeType & domainSize);
531 void AdjustSlabRegions(SlabRegionVectorType & slabs,
532 OutputImageRegionType requestedRegion);
538 void operator=(
const Self &);
615 #ifndef ITK_MANUAL_INSTANTIATION
616 #include "itkMRIBiasFieldCorrectionFilter.hxx"