pyfli.data_cc.preprocessing#

Apply threshold masks and shared boolean masks to one or more data arrays.

This module belongs to pyfli.data_cc and is part of PyFLI array preprocessing helpers for normalization, masking, ROI extraction, and IRF alignment. Public API includes classes DataPreprocessing.

Classes

DataPreprocessing(*data[, mask])

Apply reusable masks and threshold filters to one or more aligned data arrays.

class DataPreprocessing(*data, mask=None)[source]#

Bases: object

Apply reusable masks and threshold filters to one or more aligned data arrays. It is useful before fitting, visualization, and statistical comparison steps that need shared valid-pixel selection.

Parameters:
  • *data (Any) – Additional positional values accepted by the object.

  • mask (np.ndarray | None) – Boolean mask selecting valid pixels or samples.

threshold_masking(lower=None, upper=None, data_index=0)[source]#

Generates a mask based on intensity thresholds. If lower and upper are both None, a mask of all ones is returned.

Parameters:
  • lower (float, optional) – Minimum intensity threshold.

  • upper (float, optional) – Maximum intensity threshold.

  • data_index (int) – Index of the dataset to use for generating the mask.

Return type:

ndarray

apply_mask(mask=None)[source]#

Apply mask.

Parameters:

mask (np.ndarray | None) – Boolean or labeled mask selecting pixels for the operation.

Returns:

Tuple containing masked data and mask metadata.

Return type:

tuple[Any, ]