httomolibgpu.misc.morph
#
Module for data type morphing functions
- httomolibgpu.misc.morph.data_resampler(data: <cp.ndarray>, newshape: list, axis: int = 1, interpolation: str = '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’.
- Raises
ValueError – When data is not 3D
- Returns
Up/Down-scaled 3D cupy array
- Return type
cp.ndarray
- httomolibgpu.misc.morph.sino_360_to_180(data: <cp.ndarray>, overlap: int = 0, rotation: 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 [10].
- Parameters
data (cp.ndarray) – Input 3D data.
overlap (scalar, optional) – Overlapping number of pixels.
rotation (string, optional) – ‘left’ if rotation center is close to the left of the field-of-view, ‘right’ otherwise.
- Returns
Output 3D data.
- Return type
cp.ndarray