plastimatch
|
The Hausdorff class computes the worst-case distance between two regions. There are many variants of the Hausdorff. See for example: More...
#include <hausdorff_distance.h>
Public Member Functions | |
Hausdorff_distance () | |
~Hausdorff_distance () | |
Inputs | |
void | set_reference_image (const char *image_fn) |
Set the reference image. The image will be loaded from the specified filename. | |
void | set_reference_image (const UCharImageType::Pointer image) |
Set the reference image as an ITK image. | |
void | set_compare_image (const char *image_fn) |
Set the compare image. The image will be loaded from the specified filename. | |
void | set_compare_image (const UCharImageType::Pointer image) |
Set the compare image as an ITK image. | |
void | set_hausdorff_distance_fraction (float hausdorff_distance_fraction) |
Set the fraction of voxels to include when computing the percent hausdorff distance. The input value should be a number between 0 and 1. The default value is 0.95. | |
void | set_distance_map_algorithm (const std::string &dmap_alg) |
Choose which distance map algorithm to use. | |
void | set_maximum_distance (float maximum_distance) |
Choose the maximum distance that is returned when computing the distance map. | |
void | set_volume_boundary_behavior (Volume_boundary_behavior vbb) |
Set the volume boundary behavior, either ZERO_PADDING, EDGE_PADDING, or ADAPTIVE_PADDING. | |
Execution | |
void | run () |
Compute hausdorff distances. | |
Outputs | |
float | get_hausdorff () |
Return the Hausdorff distance. | |
float | get_min_min_hausdorff () |
Return the minimum Hausdorff distance. | |
float | get_avg_average_hausdorff () |
Return the average Hausdorff distance. | |
float | get_max_average_hausdorff () |
Return the max average Hausdorff distance. | |
float | get_percent_hausdorff () |
Return the percent Hausdorff distance. | |
float | get_boundary_hausdorff () |
Return the boundary Hausdorff distance. | |
float | get_min_min_boundary_hausdorff () |
Return the minimum boundary Hausdorff distance. | |
float | get_avg_average_boundary_hausdorff () |
Return the average boundary Hausdorff distance. | |
float | get_max_average_boundary_hausdorff () |
Return the max average boundary Hausdorff distance. | |
float | get_percent_boundary_hausdorff () |
Return the percent boundary Hausdorff distance. | |
void | debug () |
Display debugging information to stdout. | |
Public Attributes | |
Hausdorff_distance_private * | d_ptr |
Protected Member Functions | |
void | run_internal (UCharImageType::Pointer image1, UCharImageType::Pointer image2) |
The Hausdorff class computes the worst-case distance between two regions. There are many variants of the Hausdorff. See for example:
"A Modified Hausdorff Distance for Object Matching," MP Dubuisson and AK Jain, Proc. International Conference on Pattern Recognition, pp 566–568, 1994.
To understand the variants, we first define the directed Hausdorff and the boundary Hausdorff.
The directed Hausdorff measure from X to Y is defined as the maximum distance, for all points in X, to the closest point in Y. Mathematically this is given as:
The (undirected) Hausdorff distance is the maximum of the two directed Hausdorff measures.
The (directed or undirected) boundary Hausdorff is a Hausdorff distance which is computed on the boundary of a set rather than the set itself. For example, the (undirected) boundary Hausdorff distance is given as:
The directed average Hausdorff measure is the average distance of a point in X to its closest point in Y. That is:
The (undirected) average Hausdorff measure is the average of the two directed average Hausdorff measures:
The (undirected) max average Hausdorff measure is the maximum of the two directed average Hausdorff measures:
The directed percent Hausdorff measure, for a percentile , is the th percentile distance over all distances from points in X to their closest point in Y. For example, the directed 95% Hausdorff distance is the point in X with distance to its closest point in Y is greater or equal to exactly 95% of the other points in X. In mathematical terms, denoting the th percentile as , this is given as:
The (undirected) percent Hausdorff measure is defined again with the mean:
If the images do not have the same size and resolution, the compare image will be resampled onto the reference image geometry prior to comparison.
Hausdorff_distance::Hausdorff_distance | ( | ) |
Hausdorff_distance::~Hausdorff_distance | ( | ) |
void Hausdorff_distance::debug | ( | ) |
Display debugging information to stdout.
float Hausdorff_distance::get_avg_average_boundary_hausdorff | ( | ) |
Return the average boundary Hausdorff distance.
float Hausdorff_distance::get_avg_average_hausdorff | ( | ) |
Return the average Hausdorff distance.
float Hausdorff_distance::get_boundary_hausdorff | ( | ) |
Return the boundary Hausdorff distance.
float Hausdorff_distance::get_hausdorff | ( | ) |
Return the Hausdorff distance.
float Hausdorff_distance::get_max_average_boundary_hausdorff | ( | ) |
Return the max average boundary Hausdorff distance.
float Hausdorff_distance::get_max_average_hausdorff | ( | ) |
Return the max average Hausdorff distance.
float Hausdorff_distance::get_min_min_boundary_hausdorff | ( | ) |
Return the minimum boundary Hausdorff distance.
float Hausdorff_distance::get_min_min_hausdorff | ( | ) |
Return the minimum Hausdorff distance.
float Hausdorff_distance::get_percent_boundary_hausdorff | ( | ) |
Return the percent boundary Hausdorff distance.
float Hausdorff_distance::get_percent_hausdorff | ( | ) |
Return the percent Hausdorff distance.
void Hausdorff_distance::run | ( | ) |
Compute hausdorff distances.
|
protected |
void Hausdorff_distance::set_compare_image | ( | const char * | image_fn | ) |
Set the compare image. The image will be loaded from the specified filename.
void Hausdorff_distance::set_compare_image | ( | const UCharImageType::Pointer | image | ) |
Set the compare image as an ITK image.
void Hausdorff_distance::set_distance_map_algorithm | ( | const std::string & | dmap_alg | ) |
Choose which distance map algorithm to use.
void Hausdorff_distance::set_hausdorff_distance_fraction | ( | float | hausdorff_distance_fraction | ) |
Set the fraction of voxels to include when computing the percent hausdorff distance. The input value should be a number between 0 and 1. The default value is 0.95.
void Hausdorff_distance::set_maximum_distance | ( | float | maximum_distance | ) |
Choose the maximum distance that is returned when computing the distance map.
void Hausdorff_distance::set_reference_image | ( | const char * | image_fn | ) |
Set the reference image. The image will be loaded from the specified filename.
void Hausdorff_distance::set_reference_image | ( | const UCharImageType::Pointer | image | ) |
Set the reference image as an ITK image.
void Hausdorff_distance::set_volume_boundary_behavior | ( | Volume_boundary_behavior | vbb | ) |
Set the volume boundary behavior, either ZERO_PADDING, EDGE_PADDING, or ADAPTIVE_PADDING.
Hausdorff_distance_private* Hausdorff_distance::d_ptr |