httomolib.misc.morph#
Module for data type morphing functions
- httomolib.misc.morph.data_reducer(data: <np.ndarray>, axis: ~typing.Literal[0, 1, 2] = 0, method: ~typing.Literal['mean', 'median'] = '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) – Axis along which the reduction is applied. Defaults to 0.
method (str) – 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:
xp.ndarray
- Return type:
data reduced 3d array where the reduced dimension is equal to one.