httomolibgpu.misc.morph#
Module for data type morphing functions
- httomolibgpu.misc.morph.data_resampler(data: <cp.ndarray>, newshape: list, axis: int = 1, interpolation: ~typing.Literal['linear', 'nearest', 'slinear', 'cubic', 'quintic', 'pchip'] = 'linear') <cp.ndarray>[source]#
Down/Up-resampler of the input data implemented through interpn function. Please note that the method will leave the specified axis dimension unchanged, e.g. (128,128,128) -> (128,256,256) for axis = 0 and newshape = [256,256].
- Parameters:
data (cp.ndarray) – 3d cupy array.
newshape (list) – 2d list that defines the 2D slice shape of new shape data.
axis (int, optional) – Axis along which the scaling is applied. Defaults to 1.
interpolation (str, optional) – Selection of interpolation method. Defaults to ‘linear’. Supported “linear”, “nearest”, “slinear”, “cubic”, “quintic” and “pchip”.
- Raises:
ValueError – When data is not 3D:
- Returns:
cp.ndarray
- Return type:
Up/Down-scaled 3D cupy array
- httomolibgpu.misc.morph.sino_360_to_180(data: <cp.ndarray>, overlap: float | int = 1, side: ~typing.Literal['left', 'right'] = 'left') <cp.ndarray>[source]#
Converts 0-360 degrees sinogram to a 0-180 sinogram. If the number of projections in the input data is odd, the last projection will be discarded. See [15].
- Parameters:
data (cp.ndarray) – Input 3D data.
overlap (float,int) – Overlapping number of pixels. Floats will be converted to integers.
side (string) – ‘left’ if rotation center is close to the left of the field-of-view, ‘right’ otherwise.
- Returns:
Output 3D data.
- Return type:
cp.ndarray