dice

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

dice(input1: str, input2: str, *, output: str | None = None, mask_keyword: str = 'masks', label_id: int = 1) → DataFrame[source]

Compute pairwise Dice coefficients between two mask batches.

Thin wrapper around habit.utils.dice_calculator.run_dice_calculation() that optionally returns the results table instead of only writing CSV.

Parameters:
  • input1 – First input directory or YAML path list.

  • input2 – Second input directory or YAML path list.

  • output – Optional CSV destination; when omitted, results are returned only.

  • mask_keyword – Subfolder keyword used to locate mask files.

  • label_id – Label value to compare inside each mask.

Returns:

DataFrame with columns Subject, MaskType, Dice, and paths.