darsia.reduce_axis#

reduce_axis(image, axis, mode='average', **kwargs)[source]#

Utility function, essentially wrapping AxisReduction as a method.

Parameters:
imageImage

Nd image.

axisint or str

Numeric index (corresponding to matrix indexing) or Cartesian axis.

modestr

Mode used in the reduction (“sum”, “scaled”, “slice”).

**kwargs

Additional arguments:

  • “slice_idx” (int): index of the slice (only for mode “slice”)

Returns:
Image

(n-1)d image.