apply detrending

apply_detrend - Linear detrending


Removes linear trends of image time series.

Description


This function removes linear tends from the time domain of image time series (dimensions Y,X,T) or image time series split by events (dimensions E,Y,X,T) data. In the first case, the linear trend will be calculated from the whole recording whereas in the second, the trends will be calculated for each trial.

Input


This function accepts only image time series (with dimensions Y,X,T) or image time series split by events (with dimensions E,Y,X,T).

The algorithm


The first and last few frames are used to solve for the linear function:

apply_detrend_eq1

Then, the linear trend is substracted from the data as:

apply_detrend_eq2

Here is an example showing the the temporal profile of a pixel (in blue) and the linear trend of the signal (in orange):

apply_detrend_fig1

And here is the comparison between the original data (in blue) and the detrended signal (in orange):

apply_detrend_fig2

Output


The output of this function is the detrended data with the same dimensions as the input data.


Back to top

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