18 #ifndef __itkMRIBiasFieldCorrectionFilter_h
19 #define __itkMRIBiasFieldCorrectionFilter_h
46 template<
class TImage,
class TImageMask,
class TBiasField >
223 template<
class TInputImage,
class TOutputImage,
class TMaskImage >
241 itkStaticConstMacro(ImageDimension,
unsigned int,
242 TOutputImage::ImageDimension);
311 void IsBiasFieldMultiplicative(
bool flag)
312 { m_BiasMultiplicative = flag; }
315 bool IsBiasFieldMultiplicative()
316 {
return m_BiasMultiplicative; }
321 itkSetMacro(UsingInterSliceIntensityCorrection,
bool);
322 itkGetConstReferenceMacro(UsingInterSliceIntensityCorrection,
bool);
330 itkSetMacro(UsingSlabIdentification,
bool);
331 itkGetConstReferenceMacro(UsingSlabIdentification,
bool);
334 itkSetMacro(SlabBackgroundMinimumThreshold, InputImagePixelType);
335 itkGetConstReferenceMacro(SlabBackgroundMinimumThreshold,
336 InputImagePixelType);
338 itkSetMacro(SlabNumberOfSamples,
unsigned int);
339 itkGetConstReferenceMacro(SlabNumberOfSamples,
unsigned int);
341 itkSetMacro(SlabTolerance,
double);
342 itkGetConstReferenceMacro(SlabTolerance,
double);
349 itkSetMacro(UsingBiasFieldCorrection,
bool);
350 itkGetConstReferenceMacro(UsingBiasFieldCorrection,
bool);
355 itkSetMacro(GeneratingOutput,
bool);
356 itkGetConstReferenceMacro(GeneratingOutput,
bool);
361 itkSetMacro(SlicingDirection,
int);
364 itkSetMacro(BiasFieldDegree,
int);
365 itkGetConstMacro(BiasFieldDegree,
int);
370 void SetInitialBiasFieldCoefficients(
const
373 { this->Modified(); m_BiasFieldCoefficients = coefficients; }
379 {
return m_EstimatedBiasFieldCoefficients; }
389 itkSetMacro(VolumeCorrectionMaximumIteration,
int);
390 itkGetConstMacro(VolumeCorrectionMaximumIteration,
int);
391 itkSetMacro(InterSliceCorrectionMaximumIteration,
int);
392 itkGetConstMacro(InterSliceCorrectionMaximumIteration,
int);
396 void SetOptimizerInitialRadius(
double initRadius)
397 { m_OptimizerInitialRadius = initRadius; }
398 double GetOptimizerInitialRadius()
399 {
return m_OptimizerInitialRadius; }
403 itkSetMacro(OptimizerGrowthFactor,
double);
404 itkGetConstMacro(OptimizerGrowthFactor,
double);
409 itkSetMacro(OptimizerShrinkFactor,
double);
410 itkGetConstMacro(OptimizerShrinkFactor,
double);
418 void SetNumberOfLevels(
unsigned int num);
421 itkGetConstMacro(NumberOfLevels,
unsigned int);
429 void SetSchedule(
const ScheduleType & schedule);
432 itkGetConstReferenceMacro(Schedule, ScheduleType);
438 void SetStartingShrinkFactors(
unsigned int factor);
440 void SetStartingShrinkFactors(
unsigned int *factors);
443 const unsigned int * GetStartingShrinkFactors()
const;
448 static bool IsScheduleDownwardDivisible(
const ScheduleType & schedule);
461 BiasFieldType EstimateBiasField(InputImageRegionType region,
463 int maximumIteration);
468 void CorrectImage(BiasFieldType & bias,
469 InputImageRegionType region);
473 void CorrectInterSliceIntensityInhomogeneity(InputImageRegionType region);
477 virtual ~MRIBiasFieldCorrectionFilter();
478 void PrintSelf(std::ostream & os,
Indent indent) const;
482 bool CheckMaskImage(ImageMaskType *mask);
488 void Log1PImage(InternalImageType *source,
489 InternalImageType *target);
493 void ExpImage(InternalImageType *source,
494 InternalImageType *target);
498 template< class TSource, class TTarget >
499 void CopyAndConvertImage(const TSource *source,
501 typename TTarget::RegionType requestedRegion)
505 typedef typename TTarget::PixelType TargetPixelType;
507 SourceIterator s_iter(source, requestedRegion);
508 TargetIterator t_iter(target, requestedRegion);
512 while ( !s_iter.IsAtEnd() )
514 t_iter.Set( static_cast< TargetPixelType >( s_iter.Get() ) );
524 void GetBiasFieldSize(InputImageRegionType region,
525 BiasFieldType::DomainSizeType & domainSize);
530 void AdjustSlabRegions(SlabRegionVectorType & slabs,
531 OutputImageRegionType requestedRegion);
537 void operator=(
const Self &);
614 #ifndef ITK_MANUAL_INSTANTIATION
615 #include "itkMRIBiasFieldCorrectionFilter.hxx"