NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Abstract base class, implementing TemplateMethod [2] for similarity measures. More...
Public Types | |
typedef SimilarityMeasure | Self |
typedef ImageToImageMetricWithConstraint < TFixedImage, TMovingImage > | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef Superclass::TransformType | TransformType |
typedef itk::UCLBaseTransform < double, TFixedImage::ImageDimension, TMovingImage::ImageDimension > | UCLBaseTransformType |
typedef Superclass::TransformPointer | TransformPointer |
typedef Superclass::TransformParametersType | TransformParametersType |
typedef Superclass::TransformJacobianType | TransformJacobianType |
typedef Superclass::InputPointType | InputPointType |
typedef Superclass::OutputPointType | OutputPointType |
typedef Superclass::MeasureType | MeasureType |
typedef Superclass::DerivativeType | DerivativeType |
typedef Superclass::FixedImageType | FixedImageType |
typedef FixedImageType::SizeType | FixedImageSizeType |
typedef Superclass::FixedImageType::PixelType | FixedImagePixelType |
typedef Superclass::MovingImageType | MovingImageType |
typedef MovingImageType::SizeType | MovingImageSizeType |
typedef Superclass::MovingImageType::PixelType | MovingImagePixelType |
typedef Superclass::FixedImageConstPointer | FixedImageConstPointer |
typedef Superclass::MovingImageConstPointer | MovingImageConstPointer |
typedef ImageFileWriter < TFixedImage > | ImageFileWriterType |
typedef Superclass::InterpolatorType | InterpolatorType |
typedef Image< char, TFixedImage::ImageDimension > | MidwayImageType |
typedef Image< float, TFixedImage::ImageDimension > | FloatImageType |
typedef Image< unsigned char, TFixedImage::ImageDimension > | UnsignedCharImageType |
typedef SignedMaurerDistanceMapImageFilter < UnsignedCharImageType, FloatImageType > | FixedDistanceMapImageFilterType |
typedef SignedMaurerDistanceMapImageFilter < UnsignedCharImageType, FloatImageType > | MovingDistanceMapImageFilterType |
typedef LinearInterpolateImageFunction < FloatImageType, double > | DistanceMapLinearInterpolatorType |
typedef itk::EulerAffineTransform < double, TFixedImage::ImageDimension, TMovingImage::ImageDimension > | AffineTransformType |
typedef const ImageMaskSpatialObject < TFixedImage::ImageDimension > | FixedMaskType |
typedef const ImageMaskSpatialObject < TMovingImage::ImageDimension > | MovingMaskType |
Public Types inherited from itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage > | |
typedef ImageToImageMetricWithConstraint | Self |
typedef ImageToImageMetric < TFixedImage, TMovingImage > | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef itk::Constraint | ConstraintType |
typedef ConstraintType::Pointer | ConstraintPointer |
typedef MetricDerivativeBridge < TFixedImage, TMovingImage > | MetricDerivativeBridgeType |
typedef MetricDerivativeBridgeType::Pointer | MetricDerivativePointer |
typedef Superclass::MeasureType | MeasureType |
typedef Superclass::DerivativeType | DerivativeType |
typedef Superclass::ParametersType | TransformParametersType |
Static Public Attributes | |
static const int | SYMMETRIC_METRIC_AVERAGE |
static const int | SYMMETRIC_METRIC_MID_WAY |
static const int | SYMMETRIC_METRIC_BOTH_FIXED_AND_MOVING_TRANSFORM |
Abstract base class, implementing TemplateMethod [2] for similarity measures.
The simplest use of this class is to extend it and implement the virtual methods:
ResetAggregate()
AggregatePair(fixedValue, movingValue)
AggregateTotal()
See itkSSDImageToImageMetric for a simple example.
itkImageToImageMetricWithConstraint overrides the default GetValue method, and calls the virtual GetSimilarity method. This class implements the GetSimilarity method, calling the virtual methods shown above. So derived classes can either override GetValue, at which point, you are on your own, and can do whatever you like. Or, you can override GetSimilarity, which means you will have access to the constraint mechanism in the itkImageToImageMetricWithConstraint class.
Note that this class is NOT thread safe.
typedef itk::EulerAffineTransform<double, TFixedImage::ImageDimension, TMovingImage::ImageDimension> itk::SimilarityMeasure< TFixedImage, TMovingImage >::AffineTransformType |
typedef SmartPointer<const Self> itk::SimilarityMeasure< TFixedImage, TMovingImage >::ConstPointer |
typedef Superclass::DerivativeType itk::SimilarityMeasure< TFixedImage, TMovingImage >::DerivativeType |
typedef LinearInterpolateImageFunction<FloatImageType, double> itk::SimilarityMeasure< TFixedImage, TMovingImage >::DistanceMapLinearInterpolatorType |
typedef SignedMaurerDistanceMapImageFilter<UnsignedCharImageType, FloatImageType> itk::SimilarityMeasure< TFixedImage, TMovingImage >::FixedDistanceMapImageFilterType |
typedef Superclass::FixedImageConstPointer itk::SimilarityMeasure< TFixedImage, TMovingImage >::FixedImageConstPointer |
typedef Superclass::FixedImageType::PixelType itk::SimilarityMeasure< TFixedImage, TMovingImage >::FixedImagePixelType |
typedef FixedImageType::SizeType itk::SimilarityMeasure< TFixedImage, TMovingImage >::FixedImageSizeType |
typedef Superclass::FixedImageType itk::SimilarityMeasure< TFixedImage, TMovingImage >::FixedImageType |
typedef const ImageMaskSpatialObject<TFixedImage::ImageDimension> itk::SimilarityMeasure< TFixedImage, TMovingImage >::FixedMaskType |
typedef Image<float, TFixedImage::ImageDimension> itk::SimilarityMeasure< TFixedImage, TMovingImage >::FloatImageType |
typedef ImageFileWriter<TFixedImage> itk::SimilarityMeasure< TFixedImage, TMovingImage >::ImageFileWriterType |
typedef Superclass::InputPointType itk::SimilarityMeasure< TFixedImage, TMovingImage >::InputPointType |
typedef Superclass::InterpolatorType itk::SimilarityMeasure< TFixedImage, TMovingImage >::InterpolatorType |
typedef Superclass::MeasureType itk::SimilarityMeasure< TFixedImage, TMovingImage >::MeasureType |
typedef Image<char, TFixedImage::ImageDimension> itk::SimilarityMeasure< TFixedImage, TMovingImage >::MidwayImageType |
typedef SignedMaurerDistanceMapImageFilter<UnsignedCharImageType, FloatImageType> itk::SimilarityMeasure< TFixedImage, TMovingImage >::MovingDistanceMapImageFilterType |
typedef Superclass::MovingImageConstPointer itk::SimilarityMeasure< TFixedImage, TMovingImage >::MovingImageConstPointer |
typedef Superclass::MovingImageType::PixelType itk::SimilarityMeasure< TFixedImage, TMovingImage >::MovingImagePixelType |
typedef MovingImageType::SizeType itk::SimilarityMeasure< TFixedImage, TMovingImage >::MovingImageSizeType |
typedef Superclass::MovingImageType itk::SimilarityMeasure< TFixedImage, TMovingImage >::MovingImageType |
typedef const ImageMaskSpatialObject<TMovingImage::ImageDimension> itk::SimilarityMeasure< TFixedImage, TMovingImage >::MovingMaskType |
typedef Superclass::OutputPointType itk::SimilarityMeasure< TFixedImage, TMovingImage >::OutputPointType |
typedef SmartPointer<Self> itk::SimilarityMeasure< TFixedImage, TMovingImage >::Pointer |
typedef SimilarityMeasure itk::SimilarityMeasure< TFixedImage, TMovingImage >::Self |
Standard class typedefs.
typedef ImageToImageMetricWithConstraint<TFixedImage, TMovingImage > itk::SimilarityMeasure< TFixedImage, TMovingImage >::Superclass |
typedef Superclass::TransformJacobianType itk::SimilarityMeasure< TFixedImage, TMovingImage >::TransformJacobianType |
typedef Superclass::TransformParametersType itk::SimilarityMeasure< TFixedImage, TMovingImage >::TransformParametersType |
typedef Superclass::TransformPointer itk::SimilarityMeasure< TFixedImage, TMovingImage >::TransformPointer |
typedef Superclass::TransformType itk::SimilarityMeasure< TFixedImage, TMovingImage >::TransformType |
Types transferred from the base class
typedef itk::UCLBaseTransform<double, TFixedImage::ImageDimension, TMovingImage::ImageDimension> itk::SimilarityMeasure< TFixedImage, TMovingImage >::UCLBaseTransformType |
typedef Image<unsigned char, TFixedImage::ImageDimension> itk::SimilarityMeasure< TFixedImage, TMovingImage >::UnsignedCharImageType |
|
protected |
|
inlineprotectedvirtual |
|
protectedpure virtual |
Use this method to add corresponding pairs of image values, called repeatedly during a single value of the cost function.
Implemented in itk::HistogramSimilarityMeasure< TFixedImage, TMovingImage >, itk::CRImageToImageMetric< TFixedImage, TMovingImage >, itk::NCCImageToImageMetric< TFixedImage, TMovingImage >, itk::RIUImageToImageMetric< TFixedImage, TMovingImage >, itk::SADImageToImageMetric< TFixedImage, TMovingImage >, and itk::SSDImageToImageMetric< TFixedImage, TMovingImage >.
|
inlineprotectedvirtual |
Use this method to add corresponding pairs of image values, called repeatedly during a single value of the cost function. With weighting.
Reimplemented in itk::NCCImageToImageMetric< TFixedImage, TMovingImage >.
|
protectedpure virtual |
Assuming we have all the data aggregated by AggregatePair method, this method is used to sum up, or average, or do something to get the final total.
Implemented in itk::NCCImageToImageMetric< TFixedImage, TMovingImage >, itk::CRImageToImageMetric< TFixedImage, TMovingImage >, itk::RIUImageToImageMetric< TFixedImage, TMovingImage >, itk::MSDImageToImageMetric< TFixedImage, TMovingImage >, itk::SADImageToImageMetric< TFixedImage, TMovingImage >, itk::SSDImageToImageMetric< TFixedImage, TMovingImage >, itk::PIUImageToImageMetric< TFixedImage, TMovingImage >, itk::NMIImageToImageMetric< TFixedImage, TMovingImage >, itk::MIImageToImageMetric< TFixedImage, TMovingImage >, and itk::JEImageToImageMetric< TFixedImage, TMovingImage >.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >.
Reimplemented in itk::CRImageToImageMetric< TFixedImage, TMovingImage >, itk::PIUImageToImageMetric< TFixedImage, TMovingImage >, itk::MSDImageToImageMetric< TFixedImage, TMovingImage >, itk::RIUImageToImageMetric< TFixedImage, TMovingImage >, itk::JacobianGradientSimilarityMeasure< TFixedImage, TMovingImage >, itk::JEImageToImageMetric< TFixedImage, TMovingImage >, itk::MIImageToImageMetric< TFixedImage, TMovingImage >, itk::NCCImageToImageMetric< TFixedImage, TMovingImage >, itk::NMIImageToImageMetric< TFixedImage, TMovingImage >, itk::SADImageToImageMetric< TFixedImage, TMovingImage >, itk::SSDImageToImageMetric< TFixedImage, TMovingImage >, itk::HistogramSimilarityMeasure< TFixedImage, TMovingImage >, and itk::FiniteDifferenceGradientSimilarityMeasure< TFixedImage, TMovingImage >.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Get FixedLowerBound, lowest intensity value to use in fixed image.
|
virtual |
Get FixedUpperBound, highest intensity value to use in fixed image.
|
virtual |
|
virtual |
|
virtual |
double itk::SimilarityMeasure< TFixedImage, TMovingImage >::GetMeasureOfParameterChange | ( | TransformParametersType | lastP, |
TransformParametersType | p | ||
) |
Get a measure of the change of parameters between two successive iterations.
|
virtual |
|
virtual |
Get MovingLowerBound, lowest intensity value to use in moving image.
|
virtual |
Get MovingUpperBound, highest intensity value to use in moving image.
|
virtual |
Get the number of samples used in the most recent evaluation of the measure.
|
virtual |
Get the number of samples used in the most recent evaluation of the measure.
|
protectedvirtual |
itkImageToImageMetric implements GetValue, which calls this GetSimilarity, which calls ResetAggregate, AggregatePair, AggregateTotal, which subclasses should override.
Implements itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >.
|
protectedvirtual |
Get the similarity given both the fixed and moving image transform.
|
virtual |
|
protectedvirtual |
Return the symmetrical similarity measure by evaluating the similarity both ways.
|
protectedvirtual |
Return the symmetrical similarity measure by evaluating the similarity at the mid-point.
We are directly looking for the midway transformation, i.e. we evaluate similiary(A(T^-1) + B(T)).
|
inlinevirtual |
Return the transformed moving image.
|
inlinevirtual |
Return the transformed moving image.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
void itk::SimilarityMeasure< TFixedImage, TMovingImage >::Initialize | ( | ) | ||
throw | ( | ExceptionObject | ||
) |
Initializes the metric. This is declared virtual in base class.
|
protectedvirtual |
Initializes the distance weightings.
void itk::SimilarityMeasure< TFixedImage, TMovingImage >::InitializeIntensityBounds | ( | ) | ||
throw | ( | ExceptionObject | ||
) |
Called from within Initialize
|
protectedvirtual |
Initializes the symmetric metric.
|
protected |
|
protectedpure virtual |
Called at the start of each evaluation of the cost function. Subclasses should implement this, and reset any internal variables.
Implemented in itk::HistogramSimilarityMeasure< TFixedImage, TMovingImage >, itk::CRImageToImageMetric< TFixedImage, TMovingImage >, itk::MSDImageToImageMetric< TFixedImage, TMovingImage >, itk::NCCImageToImageMetric< TFixedImage, TMovingImage >, itk::RIUImageToImageMetric< TFixedImage, TMovingImage >, itk::SADImageToImageMetric< TFixedImage, TMovingImage >, and itk::SSDImageToImageMetric< TFixedImage, TMovingImage >.
|
virtual |
Set/Get this flag to do direct voxel comparison. If this is true, we just iterate through the image, comparing voxel for voxel. There is minimal checking, so we assume the size is identical. This is useful for block matching.
|
virtual |
Set/Get the file ext to dump to. Default to "nii".
|
virtual |
Set/Get the file name to dump to. Default to "tmp.similarity.fixed"
|
virtual |
Set/Get interpolators.
|
virtual |
Set/Get FixedImageTransform.
|
virtual |
Set/Get m_InitialiseIntensityBoundsUsingMask.
void itk::SimilarityMeasure< TFixedImage, TMovingImage >::SetIntensityBounds | ( | const FixedImagePixelType | fixedLower, |
const FixedImagePixelType | fixedUpper, | ||
const MovingImagePixelType | movingLower, | ||
const MovingImagePixelType | movingUpper | ||
) |
Set fixed and moving, min and max intensity values.
|
virtual |
Set/Get IsResampleWholeImage.
|
virtual |
|
virtual |
|
virtual |
Set/Get this flag to return the symmetrical similarity measure by evaluating the similarity both ways.
|
virtual |
Set/Get the file ext to dump to. Default to "nii".
|
virtual |
Set/Get the file name to dump to. Default to "tmp.similarity.moving"
|
virtual |
Set/Get the transformed moving image pad value. Default 0.
|
virtual |
Set whether we are using a Two Sided Metric.
There are three ways to handle the moving image mask.
If TwoSidedMetric is true, and we have supplied a moving mask, we actually evaluate the metric twice, once using the baseline mask only and mapping points into the moving image, and once using the moving mask only mapping the points into the fixed image. We then take the mean of the two measures. This means the transformation must be invertable. The reason for this is that you don't want to inadvertently align the boundaries of the two masks.
If TwoSidedMetric is false, we evaluate the measure once, and take all the points in the baseline masked region, mapping them to the moving image, and only use them if they fall within the moving masked region. This means we are using the intersection of the two regions as the region of interest. This means you MAY cause your algorithm to be a bit prone to aligning the edges of the masks.
The alternative is to simply not supply the moving mask. In this case, the value of this flag will not matter, as there is no moving mask to worry about.
The default value is false.
This flag is used in the GetSimilarity method in this class. So if otherclasses override GetSimilarity (as they are free to do so), then this flag will probably have very little meaning.
|
virtual |
Set/Get the UseWeighting. Default false.
|
virtual |
Set/Get the WeightingDistanceThreshold. Default 2.0mm.
|
virtual |
Writes a fixed image after each similarity measure evaluation.
|
virtual |
Writes a transformed moving image after each similarity measure evaluation.
|
inlinevirtual |
Subclasses should implement this. Simply return true if the cost function should be maximized (like Mutual Info.) or false if it should be minimized (like Sum Squared Difference).
Reimplemented in itk::CRImageToImageMetric< TFixedImage, TMovingImage >, itk::MIImageToImageMetric< TFixedImage, TMovingImage >, itk::NCCImageToImageMetric< TFixedImage, TMovingImage >, and itk::NMIImageToImageMetric< TFixedImage, TMovingImage >.
|
protected |
Method that actually writes one of the fixed or transformed moving images to file.
|
protected |
Distance map of the fixed mask. Provides weighting for de-weighting the dependency of voxels near the edges of the overlapping region. See Jenkinson (2001). Improved Optimization for the robust and accurate linear registration and motion correction of brain image.
|
protected |
Interpolator for the distance map in the fixed image.
|
protected |
For symmetric registration, we need to interpolate fixed image and moveing image. Fixed image interpolator.
|
protected |
Transform for the fixed image.
|
protected |
Lowest intensity value to use in fixed image.
|
protected |
Highest intensity value to use in fixed image.
|
protected |
Use the masks for the intensity bounds initialisation.
|
protected |
Resample the whole image in GetSimilarityUsingFixedAndMovingImageTransforms.
|
protected |
This image defines the space for resampling the fixed and moving images at the mid-point.
|
protected |
Distance map of the moving mask.
|
protected |
Interpolator for the distance map in the moving image.
|
protected |
Moving image interpolator.
|
protected |
Lowest intensity value to use in moving image.
|
protected |
Highest intensity value to use in moving image.
|
protected |
Also keep a transformed fixed image for symmetric deformable transform.
|
protected |
As we iterate through image, its easy to calculate a transformed moving image as we go. This is essential for the deformable type metrics, and optional for simple metrics like SSD, NCC. However, we store this here, so everyone can have one.
|
protected |
If set, use weightings from the distance maps.
|
protected |
The weighting distance threshold - weighting set to 1 if the distance is greater than this threshold. Otherwise, the weighting is linearly set.
|
static |
|
static |
|
static |