tools.roi_stat#
- bartorch.tools.roi_stat()#
Statistic of
inputover the regionroi. BART’sroistat.- Parameters:
roi (torch.Tensor) – Weights, binary for the plain statistics, broadcasting against
input. An axis where only one of the two exceeds one (several images, or several regions) is kept in the result.input (torch.Tensor) – Values the statistic is taken of.
stat ({"count", "sum", "mean", "std", "energy", "variance"}, default='mean') –
countis the sum of the weights,sumthat of the weighted values,meantheir ratio;energyis the sum of squared deviations from the mean,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
- Raises:
ValueError – If
statis unknown,besselis given for another statistic, or the shapes do not broadcast.