httomolib.misc.segm#

Modules for data segmentation and thresholding

httomolib.misc.segm.binary_thresholding(data: <Mock name='mock.ndarray' id='140216232299248'>, val_intensity: float = 0.1, otsu: bool = False, foreground: bool = True, axis: int = 1) <Mock name='mock.ndarray' id='140216232299248'>[source]#

Performs binary thresholding to the input data

Parameters
  • data (ndarray) – Input array.

  • val_intensity (float, optional) – The grayscale intensity value that defines the binary threshold. Defaults to 0.1

  • otsu (bool, optional) – If set to True, val_intensity will be overwritten by Otsu method.

  • foreground (bool, optional) – Get the foreground, otherwise background.

  • axis (int, optional) – Specify the axis to use to slice the data (if data is the 3D array).

Returns

A binary mask of the input data.

Return type

ndarray