ComputerVisionMetrics._hausdorff_metric
— Method_hausdorff_metric
_hausdorff_metric(
set1::Vector{CartesianIndex{N}}, set2::Vector{CartesianIndex{N}};
per::Union{Nothing, Real}=nothing, directed::Bool=false
) where N
Compute the Hausdorff distance between two sets of points, set1
and set2
.
This function has multiple methods depending on the arguments provided:
- Without
per
: Computes the standard Hausdorff distance. - With
per
: Computes the Hausdorff distance at the specified percentile.
Arguments
set1
: First set of points in 2D or 3D space.set2
: Second set of points in 2D or 3D space.per
: Percentile for the Hausdorff distance (optional).directed
: Iftrue
, computes one-sided Hausdorff. Default isfalse
.
Returns
- Hausdorff distance or Hausdorff distance at the specified percentile.
ComputerVisionMetrics.compute_min_euc_distances
— Methodcompute_min_euc_distances
compute_min_euc_distances(set1::Vector{CartesianIndex{N}}, set2::Vector{CartesianIndex{N}}) where N
Compute the minimum Euclidean distances for each point in set1
to every point in set2
.
Arguments
set1
: First set of points in 2D or 3D space.set2
: Second set of points in 2D or 3D space.
Returns
- Vector of minimum Euclidean distances.
ComputerVisionMetrics.dice_metric
— Methoddice_metric
dice_metric(prediction::AbstractArray, ground_truth::AbstractArray)
Compute the Dice Coefficient (also known as the Sørensen–Dice index) between two binary masks, prediction
and ground_truth
.
The Dice Coefficient measures the similarity between two sets and ranges from 0 (no overlap) to 1 (perfect overlap).
Arguments
predicted_segment
: Predicted binary mask.ground_truth_segment
: Ground truth binary mask.
Returns
- Dice Coefficient value between the two masks.
ComputerVisionMetrics.euc
— Methodeuc
euc(u::CartesianIndex{2}, v::CartesianIndex{2})
euc(u::CartesianIndex{3}, v::CartesianIndex{3})
Euclidean distance
ComputerVisionMetrics.get_mask_edges
— Functionget_mask_edges
get_mask_edges(seg_pred::AbstractMatrix, seg_gt::AbstractMatrix, points=true)
get_mask_edges(seg_pred::BitMatrix, seg_gt::BitMatrix, points=true)
get_mask_edges(seg_pred::BitArray, seg_gt::BitArray, points=true)
get_mask_edges(seg_pred::BitArray, seg_gt::BitArray, points=true)
See Monai
ComputerVisionMetrics.hausdorff_metric
— Methodhausdorff_metric
hausdorff_metric(
prediction::AbstractArray, ground_truth::AbstractArray;
per::Union{Nothing, Real}=nothing, directed::Bool=false
)
Compute the Hausdorff distance between two masks, prediction
and ground_truth
.
This function has multiple methods depending on the arguments provided:
- Without
per
: Computes the standard Hausdorff distance. - With
per
: Computes the Hausdorff distance at the specified percentile.
Arguments
prediction
: Predicted mask, 2D or 3D array of::Bool
or::Int
.ground_truth
: Ground truth mask, 2D or 3D array of::Bool
or::Int
.per
: Percentile for the Hausdorff distance (optional).directed
: Iftrue
, computes one-sided Hausdorff. Default isfalse
.
Returns
- Hausdorff distance or Hausdorff distance at the specified percentile.