deepcell_types.preprocess_fov#

deepcell_types.preprocess_fov(raw: ndarray, mask: ndarray, *, native_mpp: float, channel_names: Sequence[str], percentile: float = 99.9, target_mpp: float = 0.5) PreprocessedFov#

Canonical preprocessing for a single FOV.

Parameters:
rawnp.ndarray

(C, H, W) numeric array of native intensity values.

masknp.ndarray

(H, W) integer cell-id labels (0 = background).

native_mppfloat

Microns-per-pixel of the input.

channel_namesSequence[str]

Sequence of length C of canonical marker names.

percentilefloat, optional

Per-channel percentile used for the bright-spot clip. Default 99.9 matches the production recipe.

target_mppfloat, optional

Output MPP (default 0.5 = TARGET_MPP).

Returns:
PreprocessedFov

raw/mask resampled to target_mpp, with raw normalized to [0, 1] per channel.

Raises:
ValueError

On shape / length / sign mismatches.