ComputerVisionMetrics._hausdorff_metricMethod

_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:

  1. Without per: Computes the standard Hausdorff distance.
  2. 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: If true, computes one-sided Hausdorff. Default is false.

Returns

  • Hausdorff distance or Hausdorff distance at the specified percentile.
ComputerVisionMetrics.compute_min_euc_distancesMethod

compute_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_metricMethod

dice_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.eucMethod

euc

euc(u::CartesianIndex{2}, v::CartesianIndex{2})
euc(u::CartesianIndex{3}, v::CartesianIndex{3})

Euclidean distance

ComputerVisionMetrics.get_mask_edgesFunction

get_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_metricMethod

hausdorff_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:

  1. Without per: Computes the standard Hausdorff distance.
  2. 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: If true, computes one-sided Hausdorff. Default is false.

Returns

  • Hausdorff distance or Hausdorff distance at the specified percentile.