Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

mitk::HistogramMatching Class Reference

This class performes a histogram matching between the fixed image and moving image to improve the registration results. More...

#include <mitkHistogramMatching.h>

Inheritance diagram for mitk::HistogramMatching:
Inheritance graph
[legend]
Collaboration diagram for mitk::HistogramMatching:
Collaboration graph
[legend]

List of all members.

Public Types

typedef HistogramMatching Self
typedef RegistrationBase Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
void SetNumberOfMatchPoints (int matchPoints)
 Sets the number of match points for the histogram generation.
void SetNumberOfHistogramLevels (int histogrammLevels)
 Sets the number of histogram levels for the histogram generation.
void SetThresholdAtMeanIntensity (bool on)
 Sets whether a threshold at mean intensity should be used for the histogram generation.
virtual void GenerateData ()
 Starts the histogram matching.

Static Public Member Functions

static Pointer New ()
 Method for creation through the object factory.

Protected Member Functions

 HistogramMatching ()
 Default constructor.
virtual ~HistogramMatching ()
 Default destructor.
template<typename TPixel , unsigned int VImageDimension>
void GenerateData2 (itk::Image< TPixel, VImageDimension > *itkImage1)
 Template class to perform the histogram matching with any kind of image. Called by GenerateData().

Protected Attributes

bool m_ThresholdAtMeanIntensity
int m_NumberOfHistogramLevels
int m_NumberOfMatchPoints

Detailed Description

This class performes a histogram matching between the fixed image and moving image to improve the registration results.

Author:
Daniel Stein

Definition at line 38 of file mitkHistogramMatching.h.


Member Typedef Documentation

typedef itk::SmartPointer<const Self> mitk::HistogramMatching::ConstPointer

Reimplemented from mitk::RegistrationBase.

Definition at line 42 of file mitkHistogramMatching.h.

typedef itk::SmartPointer<Self> mitk::HistogramMatching::Pointer

Reimplemented from mitk::RegistrationBase.

Definition at line 42 of file mitkHistogramMatching.h.

Reimplemented from mitk::RegistrationBase.

Definition at line 42 of file mitkHistogramMatching.h.

Reimplemented from mitk::RegistrationBase.

Definition at line 42 of file mitkHistogramMatching.h.


Constructor & Destructor Documentation

mitk::HistogramMatching::HistogramMatching (  ) [protected]
mitk::HistogramMatching::~HistogramMatching (  ) [protected, virtual]

Default destructor.

Definition at line 28 of file mitkHistogramMatching.cpp.

  {

Member Function Documentation

virtual void mitk::HistogramMatching::GenerateData (  ) [inline, virtual]

Starts the histogram matching.

Reimplemented from mitk::ImageSource.

Definition at line 67 of file mitkHistogramMatching.h.

References AccessByItk.

    {
      if (this->GetInput())
      {
        AccessByItk(this->GetInput(), GenerateData2);
      }
    }
template<typename TPixel , unsigned int VImageDimension>
void mitk::HistogramMatching::GenerateData2 ( itk::Image< TPixel, VImageDimension > *  itkImage1 ) [protected]

Template class to perform the histogram matching with any kind of image. Called by GenerateData().

Definition at line 48 of file mitkHistogramMatching.cpp.

References mitk::CastToItkImage(), mitk::CastToMitkImage(), mitk::ImageSource::GetOutput(), m_NumberOfHistogramLevels, m_NumberOfMatchPoints, mitk::RegistrationBase::m_ReferenceImage, m_ThresholdAtMeanIntensity, and New().

  {
    typedef typename itk::Image< TPixel, VImageDimension >  FixedImageType;
    typedef typename itk::Image< TPixel, VImageDimension >  MovingImageType;

    typedef float InternalPixelType;
    typedef typename itk::Image< InternalPixelType, VImageDimension > InternalImageType;
    typedef typename itk::CastImageFilter< FixedImageType, 
                                InternalImageType > FixedImageCasterType;
    typedef typename itk::CastImageFilter< MovingImageType, 
                                InternalImageType > MovingImageCasterType;
    typedef typename itk::HistogramMatchingImageFilter<
                                    InternalImageType,
                                    InternalImageType >   MatchingFilterType;

    typename FixedImageType::Pointer fixedImage = FixedImageType::New();
    mitk::CastToItkImage(m_ReferenceImage, fixedImage);
    typename MovingImageType::Pointer movingImage = itkImage1;
    if (fixedImage.IsNotNull() && movingImage.IsNotNull())
    {
      typename FixedImageCasterType::Pointer fixedImageCaster = FixedImageCasterType::New();
      fixedImageCaster->SetInput(fixedImage);
      typename MovingImageCasterType::Pointer movingImageCaster = MovingImageCasterType::New();
      movingImageCaster->SetInput(movingImage);
      typename MatchingFilterType::Pointer matcher = MatchingFilterType::New();
      matcher->SetInput( movingImageCaster->GetOutput() );
      matcher->SetReferenceImage( fixedImageCaster->GetOutput() );
      matcher->SetNumberOfHistogramLevels( m_NumberOfHistogramLevels );
      matcher->SetNumberOfMatchPoints( m_NumberOfMatchPoints );
      matcher->SetThresholdAtMeanIntensity(m_ThresholdAtMeanIntensity);
      matcher->Update();
      Image::Pointer outputImage = this->GetOutput();
      mitk::CastToMitkImage( matcher->GetOutput(), outputImage );
    }
virtual const char* mitk::HistogramMatching::GetClassName (  ) const [virtual]

Reimplemented from mitk::RegistrationBase.

static Pointer mitk::HistogramMatching::New (  ) [static]

Method for creation through the object factory.

Reimplemented from mitk::RegistrationBase.

Referenced by QmitkDemonsRegistrationView::CalculateTransformation(), GenerateData2(), and mitkHistogramMatchingTest().

void mitk::HistogramMatching::SetNumberOfHistogramLevels ( int  histogrammLevels )

Sets the number of histogram levels for the histogram generation.

Definition at line 32 of file mitkHistogramMatching.cpp.

References m_NumberOfHistogramLevels.

  {
    m_NumberOfHistogramLevels = histogrammLevels;
void mitk::HistogramMatching::SetNumberOfMatchPoints ( int  matchPoints )

Sets the number of match points for the histogram generation.

Definition at line 37 of file mitkHistogramMatching.cpp.

References m_NumberOfMatchPoints.

  {
    m_NumberOfMatchPoints = matchPoints;
void mitk::HistogramMatching::SetThresholdAtMeanIntensity ( bool  on )

Sets whether a threshold at mean intensity should be used for the histogram generation.

Definition at line 42 of file mitkHistogramMatching.cpp.

References m_ThresholdAtMeanIntensity.


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines