run_HemoCorrection

run_HemoCorrection


Performs hemodynamic correction of the fluorescence signal.

Description


This function removes the hemodynamic fluctuations from a fluorescence signal using data acquired with the LabeoTech's optical imaging systems.The function uses multi-channel recordings to measure the light absorption of the hemoglobin in order to remove it from the fluorescence channel. In brief, this function applies a pixelwise linear regression of the fluorescence signal onto the reflectance signals (Algorithm = LinearRegression, default). The algorithm is described in details by [1]. Alternatively, a ratiometric correction based on the normalized fluorescence and the normalized reflectance of a single reference channel can be selected (Algorithm = Ratiometric).

Input


The fluorescence data, given as a .dat file or as a numeric array, with dimensions Y,X,T or, for data split by events, Y,X,T,E. UMT structures and .umt files are not supported. The reference reflectance channels are continuous Y,X,T .dat files stored in the SaveFolder (events.mat must also be there for event-split fluorescence). AcqInfos.mat is not read. This function uses one to three files containing reflectance (red, yellow and green) data and applies the hemodynamic correction to the file containing the fluorescence data. The file names must be the following:

  • fluo.dat | fluo_475.dat: fluorescence channel
  • red.dat: red channel
  • yellow.dat: yellow/amber channel
  • green.dat: green channel

The abovementioned files are created using the run_ImagesClassification function.

Output


The corrected fluorescence signal, with the same dimensions as the input fluorescence data. A .dat input gives the file hemoCorr_fluo.dat in the SaveFolder (same axes as the input); a numeric array input gives a numeric array of the same size.

Frame rates and reference channels

Every reference channel uses the frame rate stored in its own .dat header and is resampled to the frame rate of the fluorescence data. A reference faster than the fluorescence is low-pass filtered (0.45 x the fluorescence rate) before it is resampled.

Event-split fluorescence (Y,X,T,E)

Each E slice is a trial that is corrected independently, with its own fluorescence and reference means and its own regression over the trial frames. The E axis must hold one slice per event instance of events.mat (as saved by split_data_by_event). The continuous reference channels are cut by the same events: the frame times of every trial are sampled in each reference channel by linear interpolation.

Parameters


If true, the function includes the Red channel in the hemodynamic correction algorithm.

If true, the function includes the Green channel in the hemodynamic correction algorithm.

If true, the function includes the Amber channel in the hemodynamic correction algorithm.

LinearRegression regresses the fluorescence onto one or more reflectance channels, pixel by pixel. Ratiometric uses a single reference channel.

Name of a custom reference channel file to include in the correction.

Frame rate (in Hz) of the fluorescence data, never of a reference channel. It is provided automatically by the pipeline or by the .dat header; a numeric array input needs it explicitly.

References


  1. Valley, M. T., M. G. Moore, J. Zhuang, N. Mesa, D. Castelli, D. Sullivan, M. Reimers, and J. Waters. 2020. ‘Separation of Hemodynamic Signals from GCaMP Fluorescence Measured with Wide-Field Imaging’. Journal of Neurophysiology 123 (1): 356–66. https://doi.org/10.1152/jn.00304.2019.

Back to top

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