tools.roi_stat#
- bartorch.tools.roi_stat()#
Statistic of
inputover the regionroi.- Parameters:
roi (torch.Tensor) – Weights, binary for the plain statistics. Broadcasts against
input; an axis whereroihas size one andinputdoes not (or the reverse, several regions along it) is kept.stat ({"count", "sum", "mean", "std", "energy", "variance"}, default='mean') –
countis the sum of the weights;sumof the weighted values;meantheir ratio;energythe sum of squared deviations from the mean, not of squared values;varianceenergy over count;stdits root.bessel (bool, default=False) – Divide by count minus one;
stdandvarianceonly.
- Returns:
Broadcast shape of
roiandinput, with size one on the axes where both exceed one. Complex forsumandmean, real otherwise.- Return type:
torch.Tensor