normalizeBSLN

normalizeBSLN - Normalize by baseline


Normalizes image time series or image time series split by events using a baseline time period.

Description


This function calculates the relative response change from the median value of the frames from a baseline time period at the beginning of the recording (for image time series) or trial (for image time series split by events). The baseline time period is set by the parameter baseline_sec.

Input


This function accepts image time series with dimensions Y,X,T or image time series split by events with dimensions E, Y, X and T as input.

The algorithm


For each trial (or the whole recording, for image time series), the function calculates the response amplitude as the pixel values over time minus the baseline (ΔR). Then this result is divided by the baseline resulting in pixel values expressed as ΔR/R. Here, the baseline corresponds to the median value of the pre-event period. The pre-event period is a value (in seconds) stored in the parameter baseline_sec.

The input signal S(e,i,t), for each trial/recording e, and pixel i, the relative signal change (ΔR/R(t)) is calculated as:

calculateDR_R_byEvent_eq1

where Si(t) is the pixel value for a given time t and bslni is the baseline value. The baseline is calculated as the median of the pixel values between the first frame of the trial/recording (t0) and the last frame of the baseline period (tevnt):

calculateDR_R_byEvent_eq2

Output


The output of this function is a numerical matrix with the same dimensions of the input data containing the normalized data.

Parameters


For the auto setting, this function calculates the baseline time period differently depending on the type of input data. If the input data is an image time series, the baseline time period corresponds to the first frames encompassing 20% of the recording duration. However, if the input data is an image time series split by events, this function will use the time period stored in the preEventTime_sec variable and use it as baseline.

If this parameter is set to a number, the value will be used to calculate the number of frames to be used as baseline.

Important
If the input data is an image time series split by events and this parameter is set to a number, the meta data's variables preEventTime_sec will be updated to the value of baseline_sec as well as the postEventTime_sec as the trial duration minus the baseline time period.

Set this parameter to true, to center the normalized data to one (data average ≈ 1). Otherwise, the data will be centered at zero (data average ≈ 0).

Tip
Centering the normalized data to one is useful if other calculations of value changes (Δ) will be performed later on the analysis. In those cases, centering the data at one will avoid any divisions by zero or values too close to zero.


Back to top

Copyright © LabeoTech 2024. This work is licensed under the GNU General Public License, Version 3.0.