bartorch.roi_stat

Contents

bartorch.roi_stat#

bartorch.roi_stat(roi, input, stat='mean', *, bessel=False)#

Statistic of input over the region roi.

Parameters:
  • roi (torch.Tensor) – Weights, binary for the plain statistics. Broadcasts against input; an axis where roi has size one and input does not (or the reverse, several regions along it) is kept.

  • stat ({"count", "sum", "mean", "std", "energy", "variance"}) – count is the sum of the weights (-C); sum of the weighted values (-S); mean their ratio (-M); energy the sum of squared deviations from the mean, not of squared values (-E); variance energy over count (-V); std its root (-D).

  • bessel (bool) – Divide by count minus one; std and variance only (-b).

Returns:

Broadcast shape of roi and input, with size one on the axes where both exceed one. Complex for sum and mean, real otherwise.

Return type:

torch.Tensor