binarize_image_with_threshold#

petpal.preproc.image_operations_4d.binarize_image_with_threshold(input_image_numpy: numpy.ndarray, lower_bound: float = -np.inf, upper_bound: float = np.inf)#

Threshold an image above and/or below a pair of values, and return a binary mask.

Parameters:
  • input_image_numpy (np.ndarray) – Input image data to binarize with threshold (upper and/or lower).

  • lower_bound (float) – Lower bound of the threshold.

  • upper_bound (float) – Upper bound of the threshold.

Returns:

bounded_image (np.ndarray) – Binary mask of original image where voxels within threshold are 1, and 0 elsewhere.