httomolibgpu.misc.corr#

Module for data correction. For more detailed information see Data correction module.

httomolibgpu.misc.corr.median_filter(data: <cp.ndarray>, kernel_size: int = 3, dif: float = 0.0) <cp.ndarray>[source]#

Applies 3D median filter to a 3D CuPy array. For more detailed information, see Median filter.

Parameters
  • data (cp.ndarray) – Input CuPy 3D array either float32 or uint16 data type.

  • kernel_size (int, optional) – The size of the filter’s kernel (a diameter).

  • dif (float, optional) – Expected difference value between outlier value and the median value of the array, leave equal to 0 for classical median.

Returns

Median filtered 3D CuPy array either float32 or uint16 data type.

Return type

ndarray

Raises

ValueError – If the input array is not three dimensional.

httomolibgpu.misc.corr.remove_outlier(data: <cp.ndarray>, kernel_size: int = 3, dif: float = 0.1) <cp.ndarray>[source]#

Selectively applies 3D median filter to a 3D CuPy array to remove outliers. Also called a dezinger. For more detailed information, see Outliers removal filter.

Parameters
  • data (cp.ndarray) – Input CuPy 3D array either float32 or uint16 data type.

  • kernel_size (int, optional) – The size of the filter’s kernel (a diameter).

  • dif (float, optional) – Expected difference value between outlier value and the median value of the array.

Returns

Dezingered filtered 3D CuPy array either float32 or uint16 data type.

Return type

ndarray

Raises

ValueError – Threshold value (dif) must be positive and nonzero.