This class performes a histogram matching between the fixed image and moving image to improve the registration results. More...
#include <mitkHistogramMatching.h>
Public Types | |
typedef HistogramMatching | Self |
typedef RegistrationBase | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
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 |
This class performes a histogram matching between the fixed image and moving image to improve the registration results.
Definition at line 38 of file mitkHistogramMatching.h.
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.
mitk::HistogramMatching::HistogramMatching | ( | ) | [protected] |
Default constructor.
Definition at line 21 of file mitkHistogramMatching.cpp.
References m_NumberOfHistogramLevels, m_NumberOfMatchPoints, and m_ThresholdAtMeanIntensity.
{ m_ThresholdAtMeanIntensity = true; m_NumberOfHistogramLevels = 1024; m_NumberOfMatchPoints = 7;
mitk::HistogramMatching::~HistogramMatching | ( | ) | [protected, virtual] |
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); } }
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.
{ m_ThresholdAtMeanIntensity = on;
int mitk::HistogramMatching::m_NumberOfHistogramLevels [protected] |
Definition at line 94 of file mitkHistogramMatching.h.
Referenced by GenerateData2(), HistogramMatching(), and SetNumberOfHistogramLevels().
int mitk::HistogramMatching::m_NumberOfMatchPoints [protected] |
Definition at line 95 of file mitkHistogramMatching.h.
Referenced by GenerateData2(), HistogramMatching(), and SetNumberOfMatchPoints().
bool mitk::HistogramMatching::m_ThresholdAtMeanIntensity [protected] |
Definition at line 93 of file mitkHistogramMatching.h.
Referenced by GenerateData2(), HistogramMatching(), and SetThresholdAtMeanIntensity().