Commit 5d0aa962 authored by Christian Weymann's avatar Christian Weymann
Browse files

Add the option to not average in projected_average

parent ccbce8ad
......@@ -3683,7 +3683,7 @@ def radial_average(data, angle=None, tol=np.pi/18):
return index, ndimage.mean(data, labels=labels, index=index)
def projected_average(data, angle=0, symmetrical=True):
def projected_average(data, angle=0, symmetrical=True, mean=True):
Project an image along an axis passing through its center
......@@ -3693,7 +3693,8 @@ def projected_average(data, angle=0, symmetrical=True):
angle : the direction of the axis on which to project, as an angle in radians
symmetrical : if True, the projection is done symmetrically around the center of the image
else, it is done from one edge of the image to the other
mean : if False, the projection is summed instead of averaged
index : 1d array of the distances along the projection axis from the center, in pixel
......@@ -3711,8 +3712,11 @@ def projected_average(data, angle=0, symmetrical=True):
labels = P.round().astype(
index = np.unique(labels)
return index, ndimage.mean(data, labels=labels, index=index)
if mean:
return index, ndimage.mean(data, labels=labels, index=index)
return index, ndimage.sum(data, labels=labels, index=index)
def gaussian_blur(data, r=1, padding='wrap'):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment