tools.roi_stat

Contents

tools.roi_stat#

bartorch.tools.roi_stat()#

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"}, default='mean') – count is the sum of the weights; sum of the weighted values; mean their ratio; energy the sum of squared deviations from the mean, not of squared values; variance energy over count; std its root.

  • bessel (bool, default=False) – Divide by count minus one; std and variance only.

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