httomolib.misc.morph#

Module for data type morphing functions

httomolib.misc.morph.data_reducer(data: <np.ndarray>, axis: int = 0, method: str = 'mean') <np.ndarray>[source]#

Reduce the data along the given axis dimension using the preferred method.

Parameters
  • data (xp.ndarray) – 3d np or cp array.

  • axis (int, optional) – Axis along which the reduction is applied. Defaults to 0.

  • method (str, optional) – Selection of the reduction method. Defaults to ‘mean’.

Raises
  • ValueError – When data is not 3D.

  • ValueError – When the method is not mean or median.

  • ValueError – Only 0,1,2 values for axes are supported.

Returns

data reduced 3d array where the reduced dimension is equal to one.

Return type

xp.ndarray