CaliAli remove background
CaliAli_remove_background
Description
CaliAli_remove_background: Preprocess video by removing background noise and enhancing features.
This function applies background removal techniques to enhance neuronal or dendritic structures in an image or video. It supports detrending, noise scaling, and feature enhancement using the MIN1PIPE algorithm.
Function Inputs:
| Parameter Name | Type | Description |
|---|---|---|
| Y | 3D array | Input image or video as a 3D array. |
| CaliAli_options | Structure | Structure containing preprocessing parameters. See CaliAli_demo_parameters() for details. |
Function Outputs:
| Parameter Name | Type | Description |
|---|---|---|
| Y | 3D array | Background-corrected image or video. |
Example usage:
Notes:
- Detrending removes slow fluctuations in brightness.
- Noise scaling adjusts pixel noise levels for consistency.
- Neuronal and dendritic enhancement is performed based on the specified structure type ('neuron' or 'dendrite').
- A second noise scaling pass is applied after background removal.
- When
force_non_negativeis enabled, the data are lifted byforce_non_negative_toleranceand clipped after noise scaling, yielding non-negative intensities without over-suppressing dim fluctuations. Status messages are printed with coloured output. - Set
preprocessing.median_filtering = [m n]to apply a per-framemedfilt2pass (kernel[m n]) before enforcing non-negativity, clipping the extreme pixels that noise scaling can amplify near vignetted borders while keeping broader features intact.