pyfli.io.utils#
Provide ROI mask loading, hot-pixel detection, and assorted data I/O helpers.
This module belongs to pyfli.io and is part of PyFLI detector importers, file
readers, saving helpers, and processed-data loaders. Public API includes classes
DataIOUtils.
Classes
Collect utility methods for ROI loading, mask handling, and hot-pixel detection. |
- class DataIOUtils[source]#
Bases:
objectCollect utility methods for ROI loading, mask handling, and hot-pixel detection. These helpers support detector import and preprocessing workflows.
- load_phasors_hdf5(file_path)[source]#
Load phasors hdf5.
- Parameters:
file_path (
str) – Path to the file being loaded.- Returns:
Tuple containing phasor arrays and metadata read from HDF5.
- Return type:
tuple[Any,]
- static hot_pixels(background, threshold_sigma=5.0, save_path=None)[source]#
Detect hot pixels from loaded SPAD background data.
- Parameters:
background (
np.ndarray) – Background cube (H, W, T) or stack (N, H, W, T).threshold_sigma (
float) – MAD threshold used for hot-pixel detection.save_path (
str | None) – Optional path used to save the resulting mask.
- Returns:
Hot-pixel map, sum, mean, and median background cubes.
- Return type:
tuple[np.ndarray,np.ndarray,np.ndarray,np.ndarray]
- detect_hot_pixels(bg_path, threshold_sigma=5.0, save_path=None, gate_group_path=None, gate_prefix=None)[source]#
Detect hot pixels from a SPAD HDF5 file or directory.
- Parameters:
bg_path (
str) – Background HDF5 file or directory.threshold_sigma (
float) – MAD threshold used for hot-pixel detection.save_path (
str | None) – Optional path used to save the resulting mask.gate_group_path (
str | None) – Optional HDF5 gate group.gate_prefix (
str | None) – Optional split-gate dataset prefix.
- Returns:
Hot-pixel map and background statistics.
- Return type:
Any