ITK
4.12.0
Insight Segmentation and Registration Toolkit
|
#include <itkHistogramMatchingImageFilter.h>
Normalize the grayscale values between two images by histogram matching.
HistogramMatchingImageFilter normalizes the grayscale values of a source image based on the grayscale values of a reference image. This filter uses a histogram matching technique where the histograms of the two images are matched only at a specified number of quantile values.
This filter was originally designed to normalize MR images of the same MR protocol and same body part. The algorithm works best if background pixels are excluded from both the source and reference histograms. A simple background exclusion method is to exclude all pixels whose grayscale values are smaller than the mean grayscale value. ThresholdAtMeanIntensityOn() switches on this simple background exclusion method.
The source image can be set via either SetInput() or SetSourceImage(). The reference image can be set via SetReferenceImage().
SetNumberOfHistogramLevels() sets the number of bins used when creating histograms of the source and reference images. SetNumberOfMatchPoints() governs the number of quantile values to be matched.
This filter assumes that both the source and reference are of the same type and that the input and output image type have the same number of dimension and have scalar pixel types.
Definition at line 68 of file itkHistogramMatchingImageFilter.h.
Public Types | |
typedef SmartPointer< const Self > | ConstPointer |
typedef HistogramType::Pointer | HistogramPointer |
typedef Statistics::Histogram < THistogramMeasurement > | HistogramType |
typedef Superclass::InputImageConstPointer | InputImageConstPointer |
typedef Superclass::InputImagePointer | InputImagePointer |
typedef Superclass::InputImageType | InputImageType |
typedef InputImageType::PixelType | InputPixelType |
typedef Superclass::OutputImagePointer | OutputImagePointer |
typedef TOutputImage::RegionType | OutputImageRegionType |
typedef Superclass::OutputImageType | OutputImageType |
typedef OutputImageType::PixelType | OutputPixelType |
typedef SmartPointer< Self > | Pointer |
typedef HistogramMatchingImageFilter | Self |
typedef ImageToImageFilter < TInputImage, TOutputImage > | Superclass |
Public Types inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
typedef SmartPointer< const Self > | ConstPointer |
typedef InputImageType::ConstPointer | InputImageConstPointer |
typedef InputImageType::PixelType | InputImagePixelType |
typedef InputImageType::Pointer | InputImagePointer |
typedef InputImageType::RegionType | InputImageRegionType |
typedef TInputImage | InputImageType |
typedef Superclass::OutputImagePixelType | OutputImagePixelType |
typedef Superclass::OutputImageRegionType | OutputImageRegionType |
typedef SmartPointer< Self > | Pointer |
typedef ImageToImageFilter | Self |
typedef ImageSource< TOutputImage > | Superclass |
Public Types inherited from itk::ImageSource< TOutputImage > | |
typedef SmartPointer< const Self > | ConstPointer |
typedef Superclass::DataObjectIdentifierType | DataObjectIdentifierType |
typedef DataObject::Pointer | DataObjectPointer |
typedef Superclass::DataObjectPointerArraySizeType | DataObjectPointerArraySizeType |
typedef OutputImageType::PixelType | OutputImagePixelType |
typedef OutputImageType::Pointer | OutputImagePointer |
typedef OutputImageType::RegionType | OutputImageRegionType |
typedef TOutputImage | OutputImageType |
typedef SmartPointer< Self > | Pointer |
typedef ImageSource | Self |
typedef ProcessObject | Superclass |
Public Types inherited from itk::ProcessObject | |
typedef SmartPointer< const Self > | ConstPointer |
typedef DataObject::DataObjectIdentifierType | DataObjectIdentifierType |
typedef DataObject::Pointer | DataObjectPointer |
typedef std::vector < DataObjectPointer > | DataObjectPointerArray |
typedef DataObjectPointerArray::size_type | DataObjectPointerArraySizeType |
typedef std::vector < DataObjectIdentifierType > | NameArray |
typedef SmartPointer< Self > | Pointer |
typedef ProcessObject | Self |
typedef Object | Superclass |
Public Types inherited from itk::Object | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef Object | Self |
typedef LightObject | Superclass |
Public Types inherited from itk::LightObject | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef LightObject | Self |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Static Public Attributes | |
static const unsigned int | ImageDimension = TInputImage::ImageDimension |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
static const unsigned int | InputImageDimension = TInputImage::ImageDimension |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageSource< TOutputImage > | |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Private Types | |
typedef vnl_vector< double > | GradientArrayType |
typedef vnl_matrix< double > | TableType |
Private Attributes | |
GradientArrayType | m_Gradients |
double | m_LowerGradient |
SizeValueType | m_NumberOfHistogramLevels |
SizeValueType | m_NumberOfMatchPoints |
HistogramPointer | m_OutputHistogram |
OutputPixelType | m_OutputIntensityThreshold |
THistogramMeasurement | m_OutputMaxValue |
THistogramMeasurement | m_OutputMeanValue |
THistogramMeasurement | m_OutputMinValue |
TableType | m_QuantileTable |
HistogramPointer | m_ReferenceHistogram |
InputPixelType | m_ReferenceIntensityThreshold |
THistogramMeasurement | m_ReferenceMaxValue |
THistogramMeasurement | m_ReferenceMeanValue |
THistogramMeasurement | m_ReferenceMinValue |
HistogramPointer | m_SourceHistogram |
InputPixelType | m_SourceIntensityThreshold |
THistogramMeasurement | m_SourceMaxValue |
THistogramMeasurement | m_SourceMeanValue |
THistogramMeasurement | m_SourceMinValue |
bool | m_ThresholdAtMeanIntensity |
double | m_UpperGradient |
Additional Inherited Members | |
Protected Types inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
typedef ImageToImageFilterDetail::ImageRegionCopier < itkGetStaticConstMacro(OutputImageDimension), itkGetStaticConstMacro(InputImageDimension) > | InputToOutputRegionCopierType |
typedef ImageToImageFilterDetail::ImageRegionCopier < itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) > | OutputToInputRegionCopierType |
Static Protected Member Functions inherited from itk::ImageSource< TOutputImage > | |
static const ImageRegionSplitterBase * | GetGlobalDefaultSplitter () |
static ITK_THREAD_RETURN_TYPE | ThreaderCallback (void *arg) |
Protected Attributes inherited from itk::ProcessObject | |
TimeStamp | m_OutputInformationMTime |
bool | m_Updating |
Protected Attributes inherited from itk::LightObject | |
AtomicInt< int > | m_ReferenceCount |
typedef SmartPointer< const Self > itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::ConstPointer |
Definition at line 76 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 229 of file itkHistogramMatchingImageFilter.h.
typedef HistogramType::Pointer itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::HistogramPointer |
Definition at line 107 of file itkHistogramMatchingImageFilter.h.
typedef Statistics::Histogram< THistogramMeasurement > itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::HistogramType |
Histogram related typedefs.
Definition at line 106 of file itkHistogramMatchingImageFilter.h.
typedef Superclass::InputImageConstPointer itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::InputImageConstPointer |
Definition at line 97 of file itkHistogramMatchingImageFilter.h.
typedef Superclass::InputImagePointer itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::InputImagePointer |
Definition at line 96 of file itkHistogramMatchingImageFilter.h.
typedef Superclass::InputImageType itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::InputImageType |
Inherited typedefs.
Definition at line 95 of file itkHistogramMatchingImageFilter.h.
typedef InputImageType::PixelType itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::InputPixelType |
Pixel related typedefs.
Definition at line 102 of file itkHistogramMatchingImageFilter.h.
typedef Superclass::OutputImagePointer itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::OutputImagePointer |
Definition at line 99 of file itkHistogramMatchingImageFilter.h.
typedef TOutputImage::RegionType itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::OutputImageRegionType |
Typedef to describe the output image region type.
Definition at line 92 of file itkHistogramMatchingImageFilter.h.
typedef Superclass::OutputImageType itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::OutputImageType |
Definition at line 98 of file itkHistogramMatchingImageFilter.h.
typedef OutputImageType::PixelType itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::OutputPixelType |
Definition at line 103 of file itkHistogramMatchingImageFilter.h.
typedef SmartPointer< Self > itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::Pointer |
Definition at line 75 of file itkHistogramMatchingImageFilter.h.
typedef HistogramMatchingImageFilter itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::Self |
Standard class typedefs.
Definition at line 73 of file itkHistogramMatchingImageFilter.h.
typedef ImageToImageFilter< TInputImage, TOutputImage > itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::Superclass |
Definition at line 74 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 226 of file itkHistogramMatchingImageFilter.h.
|
protected |
|
inlineprotected |
Definition at line 173 of file itkHistogramMatchingImageFilter.h.
|
overrideprotectedvirtual |
If an imaging filter needs to perform processing after all processing threads have completed, the filter can can provide an implementation for AfterThreadedGenerateData(). The execution flow in the default GenerateData() method will be: 1) Allocate the output buffer 2) Call BeforeThreadedGenerateData() 3) Spawn threads, calling ThreadedGenerateData() in each thread. 4) Call AfterThreadedGenerateData() Note that this flow of control is only available if a filter provides a ThreadedGenerateData() method and NOT a GenerateData() method.
Reimplemented from itk::ImageSource< TOutputImage >.
|
overrideprotectedvirtual |
If an imaging filter needs to perform processing after the buffer has been allocated but before threads are spawned, the filter can can provide an implementation for BeforeThreadedGenerateData(). The execution flow in the default GenerateData() method will be: 1) Allocate the output buffer 2) Call BeforeThreadedGenerateData() 3) Spawn threads, calling ThreadedGenerateData() in each thread. 4) Call AfterThreadedGenerateData() Note that this flow of control is only available if a filter provides a ThreadedGenerateData() method and NOT a GenerateData() method.
Reimplemented from itk::ImageSource< TOutputImage >.
|
protected |
Compute min, max and mean of an image.
|
protected |
Construct a histogram from an image.
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
|
overridevirtual |
This filter requires all of the input to be in the buffer.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
virtual |
Methods to get the histograms of the source, reference, and output. Objects are only valid after Update() has been called on this filter.
|
virtual |
Methods to get the histograms of the source, reference, and output. Objects are only valid after Update() has been called on this filter.
|
virtual |
Methods to get the histograms of the source, reference, and output. Objects are only valid after Update() has been called on this filter.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set/Get the number of histogram levels used.
|
virtual |
Set/Get the number of match points used.
|
virtual |
Methods to get the histograms of the source, reference, and output. Objects are only valid after Update() has been called on this filter.
|
virtual |
Methods to get the histograms of the source, reference, and output. Objects are only valid after Update() has been called on this filter.
const InputImageType* itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::GetReferenceImage | ( | ) |
|
virtual |
Methods to get the histograms of the source, reference, and output. Objects are only valid after Update() has been called on this filter.
|
inline |
Set/Get the source image.
Definition at line 112 of file itkHistogramMatchingImageFilter.h.
|
virtual |
Set/Get the threshold at mean intensity flag. If true, only source (reference) pixels which are greater than the mean source (reference) intensity is used in the histogram matching. If false, all pixels are used.
|
static |
Method for creation through the object factory.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set/Get the number of histogram levels used.
|
virtual |
Set/Get the number of match points used.
void itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::SetReferenceImage | ( | const InputImageType * | reference | ) |
Set/Get the reference image.
|
inline |
Set/Get the source image.
Definition at line 110 of file itkHistogramMatchingImageFilter.h.
|
virtual |
Set/Get the threshold at mean intensity flag. If true, only source (reference) pixels which are greater than the mean source (reference) intensity is used in the histogram matching. If false, all pixels are used.
|
overrideprotectedvirtual |
If an imaging filter can be implemented as a multithreaded algorithm, the filter will provide an implementation of ThreadedGenerateData(). This superclass will automatically split the output image into a number of pieces, spawn multiple threads, and call ThreadedGenerateData() in each thread. Prior to spawning threads, the BeforeThreadedGenerateData() method is called. After all the threads have completed, the AfterThreadedGenerateData() method is called. If an image processing filter cannot support threading, that filter should provide an implementation of the GenerateData() method instead of providing an implementation of ThreadedGenerateData(). If a filter provides a GenerateData() method as its implementation, then the filter is responsible for allocating the output data. If a filter provides a ThreadedGenerateData() method as its implementation, then the output memory will allocated automatically by this superclass. The ThreadedGenerateData() method should only produce the output specified by "outputThreadRegion" parameter. ThreadedGenerateData() cannot write to any other portion of the output image (as this is responsibility of a different thread).
Reimplemented from itk::ImageSource< TOutputImage >.
|
virtual |
Set/Get the threshold at mean intensity flag. If true, only source (reference) pixels which are greater than the mean source (reference) intensity is used in the histogram matching. If false, all pixels are used.
|
virtual |
Set/Get the threshold at mean intensity flag. If true, only source (reference) pixels which are greater than the mean source (reference) intensity is used in the histogram matching. If false, all pixels are used.
|
inlineoverrideprotectedvirtual |
Override VeriyInputInformation() since this filter does not expect the input images to occupy the same physical space.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 188 of file itkHistogramMatchingImageFilter.h.
|
static |
ImageDimension enumeration.
Definition at line 86 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 230 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 231 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 202 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 205 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 224 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 210 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 219 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 220 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 218 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 227 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 223 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 209 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 216 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 217 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 215 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 222 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 208 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 213 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 214 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 212 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 206 of file itkHistogramMatchingImageFilter.h.
|
private |
Definition at line 232 of file itkHistogramMatchingImageFilter.h.
|
static |
ImageDimension enumeration.
Definition at line 88 of file itkHistogramMatchingImageFilter.h.