clearex.stats.intensity

Functions

compare_intensity(fixed, moving, *[, ...])

Compare two intensity distributions with KS and Wasserstein metrics.

clearex.stats.intensity.compare_intensity(fixed, moving, *, max_sample=100_000, use_hist_wasserstein=True, hist_bins=256, alpha=0.05, seed=0)

Compare two intensity distributions with KS and Wasserstein metrics.

Parameters:
  • fixed (array-like or ANTsImage) – Images or array-like objects. Any object exposing .numpy() is also accepted.

  • moving (array-like or ANTsImage) – Images or array-like objects. Any object exposing .numpy() is also accepted.

  • max_sample (int, default=100000) – Maximum number of pixels drawn from each image before statistics are computed.

  • use_hist_wasserstein (bool, default=True) – If True, approximate the Wasserstein distance from histograms to reduce memory use.

  • hist_bins (int, default=256) – Number of histogram bins used when use_hist_wasserstein is enabled.

  • alpha (float, default=0.05) – Significance threshold used for the printed KS-test verdict.

  • seed (int, default=0) – Seed for the random subsampling step.

Returns:

(D, p_value, emd) where D is the KS statistic, p_value is the KS p-value, and emd is the Wasserstein distance.

Return type:

tuple of float