ITK
4.4.0
Insight Segmentation and Registration Toolkit
|
#include <itkMattesMutualInformationImageToImageMetric.h>
Computes the mutual information between two images to be registered using the method of Mattes et al.
MattesMutualInformationImageToImageMetric computes the mutual information between a fixed and moving image to be registered.
This class is templated over the FixedImage type and the MovingImage type.
The fixed and moving images are set via methods SetFixedImage() and SetMovingImage(). This metric makes use of user specified Transform and Interpolator. The Transform is used to map points from the fixed image to the moving image domain. The Interpolator is used to evaluate the image intensity at user specified geometric points in the moving image. The Transform and Interpolator are set via methods SetTransform() and SetInterpolator().
If a BSplineInterpolationFunction is used, this class obtain image derivatives from the BSpline interpolator. Otherwise, image derivatives are computed using central differencing.
The method GetValue() computes of the mutual information while method GetValueAndDerivative() computes both the mutual information and its derivatives with respect to the transform parameters.
The calculations are based on the method of Mattes et al [1,2] where the probability density distribution are estimated using Parzen histograms. Since the fixed image PDF does not contribute to the derivatives, it does not need to be smooth. Hence, a zero order (box car) BSpline kernel is used for the fixed image intensity PDF. On the other hand, to ensure smoothness a third order BSpline kernel is used for the moving image intensity PDF.
On Initialize(), the FixedImage is uniformly sampled within the FixedImageRegion. The number of samples used can be set via SetNumberOfSpatialSamples(). Typically, the number of spatial samples used should increase with the image size.
The option UseAllPixelOn() disables the random sampling and uses all the pixels of the FixedImageRegion in order to estimate the joint intensity PDF.
During each call of GetValue(), GetDerivatives(), GetValueAndDerivatives(), marginal and joint intensity PDF's values are estimated at discrete position or bins. The number of bins used can be set via SetNumberOfHistogramBins(). To handle data with arbitray magnitude and dynamic range, the image intensity is scale such that any contribution to the histogram will fall into a valid bin.
One the PDF's have been contructed, the mutual information is obtained by doubling summing over the discrete PDF values.
Notes:
References: [1] "Nonrigid multimodality image registration" D. Mattes, D. R. Haynor, H. Vesselle, T. Lewellen and W. Eubank Medical Imaging 2001: Image Processing, 2001, pp. 1609-1620. [2] "PET-CT Image Registration in the Chest Using Free-form Deformations" D. Mattes, D. R. Haynor, H. Vesselle, T. Lewellen and W. Eubank IEEE Transactions in Medical Imaging. Vol.22, No.1, January 2003. pp.120-128. [3] "Optimization of Mutual Information for MultiResolution Image Registration" P. Thevenaz and M. Unser IEEE Transactions in Image Processing, 9(12) December 2000.
Definition at line 114 of file itkMattesMutualInformationImageToImageMetric.h.
Classes | |
struct | PerThreadS |
Static Public Member Functions | |
static Pointer | New () |
Static Public Attributes | |
static const unsigned int | MovingImageDimension = MovingImageType::ImageDimension |
Static Public Attributes inherited from itk::ImageToImageMetric< TFixedImage, TMovingImage > | |
static const unsigned int | MovingImageDimension = TMovingImage::ImageDimension |
static const unsigned int | FixedImageDimension = TFixedImage::ImageDimension |
Protected Member Functions | |
MattesMutualInformationImageToImageMetric () | |
void | PrintSelf (std::ostream &os, Indent indent) const |
virtual | ~MattesMutualInformationImageToImageMetric () |
Protected Member Functions inherited from itk::ImageToImageMetric< TFixedImage, TMovingImage > | |
virtual void | ComputeImageDerivatives (const MovingImagePointType &mappedPoint, ImageDerivativesType &gradient, ThreadIdType threadID) const |
void | GetValueAndDerivativeMultiThreadedInitiate (void) const |
void | GetValueAndDerivativeMultiThreadedPostProcessInitiate (void) const |
void | GetValueAndDerivativeMultiThreadedPreProcessInitiate (void) const |
virtual void | GetValueAndDerivativeThread (ThreadIdType threadID) const |
void | GetValueMultiThreadedInitiate (void) const |
void | GetValueMultiThreadedPostProcessInitiate (void) const |
void | GetValueMultiThreadedPreProcessInitiate (void) const |
virtual void | GetValueThread (ThreadIdType threadID) const |
ImageToImageMetric () | |
virtual void | PreComputeTransformValues (void) |
virtual void | SampleFixedImageIndexes (FixedImageSampleContainer &samples) const |
virtual void | SampleFixedImageRegion (FixedImageSampleContainer &samples) const |
virtual void | SampleFullFixedImageRegion (FixedImageSampleContainer &samples) const |
virtual void | SynchronizeTransforms () const |
virtual void | TransformPoint (unsigned int sampleNumber, MovingImagePointType &mappedPoint, bool &sampleWithinSupportRegion, double &movingImageValue, ThreadIdType threadID) const |
virtual void | TransformPointWithDerivatives (unsigned int sampleNumber, MovingImagePointType &mappedPoint, bool &sampleWithinSupportRegion, double &movingImageValue, ImageDerivativesType &gradient, ThreadIdType threadID) const |
virtual | ~ImageToImageMetric () |
Protected Member Functions inherited from itk::SingleValuedCostFunction | |
SingleValuedCostFunction () | |
virtual | ~SingleValuedCostFunction () |
Protected Member Functions inherited from itk::CostFunction | |
CostFunction () | |
virtual | ~CostFunction () |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &time) |
virtual | ~Object () |
Protected Member Functions inherited from itk::LightObject | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Private Types | |
typedef BSplineDerivativeKernelFunction < 3, PDFValueType > | CubicBSplineDerivativeFunctionType |
typedef BSplineKernelFunction < 3, PDFValueType > | CubicBSplineFunctionType |
typedef JointPDFDerivativesType::IndexType | JointPDFDerivativesIndexType |
typedef JointPDFDerivativesType::RegionType | JointPDFDerivativesRegionType |
typedef JointPDFDerivativesType::SizeType | JointPDFDerivativesSizeType |
typedef JointPDFDerivativesType::PixelType | JointPDFDerivativesValueType |
typedef JointPDFType::IndexType | JointPDFIndexType |
typedef JointPDFType::RegionType | JointPDFRegionType |
typedef JointPDFType::SizeType | JointPDFSizeType |
typedef JointPDFType::PixelType | JointPDFValueType |
typedef Array2D< PRatioType > | PRatioArrayType |
typedef PDFValueType | PRatioType |
Private Member Functions | |
void | ComputeFixedImageParzenWindowIndices (FixedImageSampleContainer &samples) |
void | ComputePDFDerivatives (ThreadIdType threadID, unsigned int sampleNumber, int movingImageParzenWindowIndex, const ImageDerivativesType &movingImageGradientValue, PDFValueType cubicBSplineDerivativeValue) const |
virtual void | GetValueAndDerivativeThreadPostProcess (ThreadIdType threadID, bool withinSampleThread) const |
virtual void | GetValueAndDerivativeThreadPreProcess (ThreadIdType threadID, bool withinSampleThread) const |
virtual bool | GetValueAndDerivativeThreadProcessSample (ThreadIdType threadID, SizeValueType fixedImageSample, const MovingImagePointType &mappedPoint, double movingImageValue, const ImageDerivativesType &movingImageGradientValue) const |
virtual void | GetValueThreadPostProcess (ThreadIdType threadID, bool withinSampleThread) const |
virtual void | GetValueThreadPreProcess (ThreadIdType threadID, bool withinSampleThread) const |
virtual bool | GetValueThreadProcessSample (ThreadIdType threadID, SizeValueType fixedImageSample, const MovingImagePointType &mappedPoint, double movingImageValue) const |
itkAlignedTypedef (ITK_CACHE_LINE_ALIGNMENT, PerThreadS, AlignedPerThreadType) | |
MattesMutualInformationImageToImageMetric (const Self &) | |
void | operator= (const Self &) |
typedef Superclass::BSplineTransformIndexArrayType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::BSplineTransformIndexArrayType |
Definition at line 146 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::BSplineTransformWeightsType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::BSplineTransformWeightsType |
Definition at line 145 of file itkMattesMutualInformationImageToImageMetric.h.
typedef SmartPointer<const Self> itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::ConstPointer |
Definition at line 123 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::CoordinateRepresentationType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::CoordinateRepresentationType |
Definition at line 148 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 280 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Typedefs for BSpline kernel and derivative functions.
Definition at line 279 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::DerivativeType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::DerivativeType |
Definition at line 138 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::FixedImageConstPointer itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::FixedImageConstPointer |
Definition at line 143 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::FixedImageSampleContainer itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::FixedImageSampleContainer |
Definition at line 149 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::FixedImageType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::FixedImageType |
Definition at line 140 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::ImageDerivativesType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::ImageDerivativesType |
Definition at line 150 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::IndexValueType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::IndexValueType |
Definition at line 152 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::InterpolatorType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::InterpolatorType |
Definition at line 136 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 273 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 275 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 276 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Image<PDFValueType, 3> itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::JointPDFDerivativesType |
Definition at line 224 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 274 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 269 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 271 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 272 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Image<PDFValueType, 2> itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::JointPDFType |
Typedef for the joint PDF and PDF derivatives are stored as ITK Images.
Definition at line 223 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 270 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::MeasureType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::MeasureType |
Definition at line 137 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::MovingImageConstPointer itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::MovingImageConstPointer |
Definition at line 144 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::MovingImagePointType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::MovingImagePointType |
Definition at line 142 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::MovingImageType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::MovingImageType |
Definition at line 141 of file itkMattesMutualInformationImageToImageMetric.h.
typedef FixedImageType::OffsetValueType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::OffsetValueType |
Definition at line 154 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::ParametersType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::ParametersType |
Definition at line 139 of file itkMattesMutualInformationImageToImageMetric.h.
typedef double itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::PDFValueType |
The marginal PDFs are stored as std::vector.
Definition at line 216 of file itkMattesMutualInformationImageToImageMetric.h.
typedef SmartPointer<Self> itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::Pointer |
Definition at line 122 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 323 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Helper array for storing the values of the JointPDF ratios.
Definition at line 322 of file itkMattesMutualInformationImageToImageMetric.h.
typedef MattesMutualInformationImageToImageMetric itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::Self |
Standard class typedefs.
Definition at line 120 of file itkMattesMutualInformationImageToImageMetric.h.
typedef ImageToImageMetric<TFixedImage, TMovingImage> itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::Superclass |
Definition at line 121 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::TransformJacobianType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::TransformJacobianType |
Definition at line 135 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::TransformPointer itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::TransformPointer |
Definition at line 134 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::TransformType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::TransformType |
Types inherited from Superclass.
Definition at line 130 of file itkMattesMutualInformationImageToImageMetric.h.
typedef Superclass::WeightsValueType itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::WeightsValueType |
Definition at line 151 of file itkMattesMutualInformationImageToImageMetric.h.
|
protected |
|
protectedvirtual |
|
private |
|
private |
Precompute fixed image parzen window indices.
|
private |
Compute PDF derivative contribution for each parameter.
|
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.
|
virtual |
Get the derivatives of the match measure.
Implements itk::SingleValuedCostFunction.
|
inline |
Get the internal JointPDF image that was used in creating the metric value.
Definition at line 230 of file itkMattesMutualInformationImageToImageMetric.h.
References NULL.
|
inline |
Get the internal JointPDFDeriviative image that was used in creating the metric derivative value. This is only created when UseExplicitPDFDerivatives is ON, and derivatives are requested.
Definition at line 246 of file itkMattesMutualInformationImageToImageMetric.h.
References NULL.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ImageToImageMetric< TFixedImage, TMovingImage >.
|
virtual |
Number of bins to used in the histogram. According to Mattes et al the optimum value is 50. The minimum value is 5 due to the padding required by the Parzen windowing with a cubic-BSpline kernel. Note that even if the metric is used on binary images, the number of bins should at least be equal to five.
|
virtual |
This variable selects the method to be used for computing the Metric derivatives with respect to the Transform parameters. Two modes of computation are available. The choice between one and the other is a trade-off between computation speed and memory allocations. The two modes are described in detail below:
UseExplicitPDFDerivatives = True will compute the Metric derivative by first calculating the derivatives of each one of the Joint PDF bins with respect to each one of the Transform parameters and then accumulating these contributions in the final metric derivative array by using a bin-specific weight. The memory required for storing the intermediate derivatives is a 3D array of floating point values with size equals to the product of (number of histogram bins)^2 times number of transform parameters. This method is well suited for Transform with a small number of parameters.
UseExplicitPDFDerivatives = False will compute the Metric derivative by first computing the weights for each one of the Joint PDF bins and caching them into an array. Then it will revisit each one of the PDF bins for computing its weighted contribution to the full derivative array. In this method an extra 2D array is used for storing the weights of each one of the PDF bins. This is an array of floating point values with size equals to (number of histogram bins)^2. This method is well suited for Transforms with a large number of parameters, such as, BSplineTransforms.
|
virtual |
Get the value.
Implements itk::SingleValuedCostFunction.
|
virtual |
Get the value and derivatives for single valued optimizers.
Reimplemented from itk::SingleValuedCostFunction.
|
privatevirtual |
Reimplemented from itk::ImageToImageMetric< TFixedImage, TMovingImage >.
|
privatevirtual |
Reimplemented from itk::ImageToImageMetric< TFixedImage, TMovingImage >.
|
privatevirtual |
Reimplemented from itk::ImageToImageMetric< TFixedImage, TMovingImage >.
|
privatevirtual |
Reimplemented from itk::ImageToImageMetric< TFixedImage, TMovingImage >.
|
privatevirtual |
Reimplemented from itk::ImageToImageMetric< TFixedImage, TMovingImage >.
|
privatevirtual |
Reimplemented from itk::ImageToImageMetric< TFixedImage, TMovingImage >.
|
virtual |
Initialize the Metric by (1) making sure that all the components are present and plugged together correctly, (2) uniformly select NumberOfSpatialSamples within the FixedImageRegion, and (3) allocate memory for pdf data structures.
Reimplemented from itk::ImageToImageMetric< TFixedImage, TMovingImage >.
|
private |
|
static |
Method for creation through the object factory.
|
private |
|
protectedvirtual |
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::ImageToImageMetric< TFixedImage, TMovingImage >.
|
virtual |
Number of bins to used in the histogram. According to Mattes et al the optimum value is 50. The minimum value is 5 due to the padding required by the Parzen windowing with a cubic-BSpline kernel. Note that even if the metric is used on binary images, the number of bins should at least be equal to five.
|
virtual |
This variable selects the method to be used for computing the Metric derivatives with respect to the Transform parameters. Two modes of computation are available. The choice between one and the other is a trade-off between computation speed and memory allocations. The two modes are described in detail below:
UseExplicitPDFDerivatives = True will compute the Metric derivative by first calculating the derivatives of each one of the Joint PDF bins with respect to each one of the Transform parameters and then accumulating these contributions in the final metric derivative array by using a bin-specific weight. The memory required for storing the intermediate derivatives is a 3D array of floating point values with size equals to the product of (number of histogram bins)^2 times number of transform parameters. This method is well suited for Transform with a small number of parameters.
UseExplicitPDFDerivatives = False will compute the Metric derivative by first computing the weights for each one of the Joint PDF bins and caching them into an array. Then it will revisit each one of the PDF bins for computing its weighted contribution to the full derivative array. In this method an extra 2D array is used for storing the weights of each one of the PDF bins. This is an array of floating point values with size equals to (number of histogram bins)^2. This method is well suited for Transforms with a large number of parameters, such as, BSplineTransforms.
|
virtual |
This variable selects the method to be used for computing the Metric derivatives with respect to the Transform parameters. Two modes of computation are available. The choice between one and the other is a trade-off between computation speed and memory allocations. The two modes are described in detail below:
UseExplicitPDFDerivatives = True will compute the Metric derivative by first calculating the derivatives of each one of the Joint PDF bins with respect to each one of the Transform parameters and then accumulating these contributions in the final metric derivative array by using a bin-specific weight. The memory required for storing the intermediate derivatives is a 3D array of floating point values with size equals to the product of (number of histogram bins)^2 times number of transform parameters. This method is well suited for Transform with a small number of parameters.
UseExplicitPDFDerivatives = False will compute the Metric derivative by first computing the weights for each one of the Joint PDF bins and caching them into an array. Then it will revisit each one of the PDF bins for computing its weighted contribution to the full derivative array. In this method an extra 2D array is used for storing the weights of each one of the PDF bins. This is an array of floating point values with size equals to (number of histogram bins)^2. This method is well suited for Transforms with a large number of parameters, such as, BSplineTransforms.
|
virtual |
This variable selects the method to be used for computing the Metric derivatives with respect to the Transform parameters. Two modes of computation are available. The choice between one and the other is a trade-off between computation speed and memory allocations. The two modes are described in detail below:
UseExplicitPDFDerivatives = True will compute the Metric derivative by first calculating the derivatives of each one of the Joint PDF bins with respect to each one of the Transform parameters and then accumulating these contributions in the final metric derivative array by using a bin-specific weight. The memory required for storing the intermediate derivatives is a 3D array of floating point values with size equals to the product of (number of histogram bins)^2 times number of transform parameters. This method is well suited for Transform with a small number of parameters.
UseExplicitPDFDerivatives = False will compute the Metric derivative by first computing the weights for each one of the Joint PDF bins and caching them into an array. Then it will revisit each one of the PDF bins for computing its weighted contribution to the full derivative array. In this method an extra 2D array is used for storing the weights of each one of the PDF bins. This is an array of floating point values with size equals to (number of histogram bins)^2. This method is well suited for Transforms with a large number of parameters, such as, BSplineTransforms.
|
private |
Definition at line 319 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Cubic BSpline kernel for computing Parzen histograms.
Definition at line 318 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 314 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 309 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 311 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 310 of file itkMattesMutualInformationImageToImageMetric.h.
|
mutableprivate |
Definition at line 353 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 315 of file itkMattesMutualInformationImageToImageMetric.h.
|
mutableprivate |
The moving image marginal PDF.
Definition at line 328 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 308 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 313 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 312 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Variables to define the marginal and joint histograms.
Definition at line 307 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 350 of file itkMattesMutualInformationImageToImageMetric.h.
|
mutableprivate |
Definition at line 325 of file itkMattesMutualInformationImageToImageMetric.h.
|
private |
Definition at line 352 of file itkMattesMutualInformationImageToImageMetric.h.
|
static |
The moving image dimension.
Definition at line 158 of file itkMattesMutualInformationImageToImageMetric.h.