Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2022 Jan 21:15:797421.
doi: 10.3389/fnins.2021.797421. eCollection 2021.

Decontaminate Traces From Fluorescence Calcium Imaging Videos Using Targeted Non-negative Matrix Factorization

Affiliations

Decontaminate Traces From Fluorescence Calcium Imaging Videos Using Targeted Non-negative Matrix Factorization

Yijun Bao et al. Front Neurosci. .

Abstract

Fluorescence microscopy and genetically encoded calcium indicators help understand brain function by recording large-scale in vivo videos in assorted animal models. Extracting the fluorescent transients that represent active periods of individual neurons is a key step when analyzing imaging videos. Non-specific calcium sources and background adjacent to segmented neurons contaminate the neurons' temporal traces with false transients. We developed and characterized a novel method, temporal unmixing of calcium traces (TUnCaT), to quickly and accurately unmix the calcium signals of neighboring neurons and background. Our algorithm used background subtraction to remove the false transients caused by background fluctuations, and then applied targeted non-negative matrix factorization to remove the false transients caused by neighboring calcium sources. TUnCaT was more accurate than existing algorithms when processing multiple experimental and simulated datasets. TUnCaT's speed was faster than or comparable to existing algorithms.

Keywords: decontamination; fluorescence calcium imaging; neuroimaging; non-negative matrix factorization; one-photon imaging; signal unmixing; two-photon imaging.

PubMed Disclaimer

Conflict of interest statement

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Figures

FIGURE 1
FIGURE 1
Neural signal contamination arises from neighboring cells, neural processes, or background. (A) An example temporal trace from one neuron showed multiple false transients. Four labeled transients (i)–(iv) show four examples with different origins, corresponding to the images below the trace. Each image is the corresponding spatial profile of fluorescence at the peak of each labeled transient. The colored contours in each image show the boundary of the segmented neuron (thick blue), the boundary of a neighboring neuron (orange), and the background region (purple) surrounding the segmented neuron (scale bar: 5 μm). Only transient (iv) was a true transient of the neuron (green), where the spatial profile of activation matched the neuron shape. The remaining transients were false transients (red) caused by contamination with spatial profiles not matching the neuron shape. Transient (i) came from a dendrite, transient (ii) came from background fluctuation, and transient (iii) came from an active neighboring neuron. (B) A schematic shows multiple typical contaminating sources around the neuron of interest (N1; blue); we show a neighboring neuron (N2; orange), an axon perpendicular to the imaging plane (A; gray), and a dendrite in the imaging plane (D; gray). In practice, multiple instances of each type of contaminating source may exist. The purple disk is the background region (BG) near the neuron. We defined the outside region (OS) as all pixels within the background region but not belonging to any neuron mask. (C) Matrix multiplication can represent the fluorescence contamination between regions. The mixture of the uncontaminated neuron traces (c1 and c2), the outside trace (c0), and the background trace (b0) generated the measured traces c1, c2, and c0. This work produced the uncontaminated traces from the measured traces. (D) A flow chart of our unmixing algorithm, TUnCaT. The inputs are the video and the neuron masks, and the outputs are the unmixed traces and the mixing matrix.
FIGURE 2
FIGURE 2
Temporal unmixing of calcium traces (TUnCaT) was more accurate than peer algorithms on experimental two-photon dataset. (A) TUnCaT can remove false transients from the raw trace (top) caused by background fluctuation (middle). The background-subtracted trace (bottom) correctly retained two true neuron transients [(i) and (iv), green] of four example transients detected in the raw trace, and suppressed two transients caused by background fluctuations [(ii) and (iii), red]. Each image below the traces is the corresponding spatial profile of fluorescence at the peak of each transient. The thick blue contour in each image shows the boundary of the neuron, and the purple contour shows the background region surrounding the segmented neuron (scale bar: 5 μm). (B) TUnCaT can remove false transients caused by neighboring neurons and dendrites for an example neuron. The first trace is the background-subtracted trace of an example neuron representing the trace before unmixing; the magenta transients show the manually determined GT transients. The four remaining traces are the unmixing results of four different methods (FISSA, CNMF, the Allen SDK, and TUnCaT) from that neuron. Subpanels (i)–(vii) show example transients detected by at least one unmixing algorithm. The neuron transients correctly identified by each algorithm are highlighted green, while transients incorrectly identified by each algorithm as false positives are highlighted red. Transients (i)–(iii) came from a neighboring neuron, and transient (vii) came from a dendrite. Each image below the traces is the corresponding spatial profile of fluorescence at the peak of each transient. The thick blue contour in each image shows the boundary of the neuron, and the orange and yellow contours show the boundary of two different neighboring neurons (scale bar: 5 μm). (C) The F1 scores of TUnCaT during 10-round cross-validation were superior to that of the other methods both when processing raw videos and when processing SNR videos (**p < 0.005, two-sided Wilcoxon signed-rank test, n = 10 videos; error bars are standard deviations). The gray dots represent scores for the test data on each round of cross-validation. (D) The processing time of TUnCaT was comparable to or faster than the other methods both when processing raw videos and when processing SNR videos (**p < 0.005, two-sided Wilcoxon signed-rank test, n = 10 videos; error bars are standard deviations). The gray dots represent the processing times of the test data on each round of cross-validation.
FIGURE 3
FIGURE 3
Two-step spatial segmentation and temporal unmixing was more accurate than one-step spatiotemporal unmixing. We also showed the results of applying TUnCaT on GT neurons as a reference, whose processing time did not include manual neuron segmentation. (A,B) The SUNS masks matched the GT masks better than the CaImAn masks. The neurons in an example ABO video found by manual labeling as GT (yellow) and (A) SUNS (dark green) or (B) CaImAn (purple) are overlaid on top of the imaging data. The grayscale images are the projection of the maximum pixel-wise SNR (Scale bar: 20 μm). (C) The F1 scores of CaImAn during 10-round cross-validation were significantly lower than that of SUNS + TUnCaT and SUNS + CNMF both when processing raw videos and when processing SNR videos (*p < 0.05, **p < 0.005, two-sided Wilcoxon signed-rank test, n = 10 videos; error bars are standard deviations). We evaluated the accuracy by considering transients from all ground truth and algorithm-generated neurons. The gray dots represent scores for the test data on each round of cross-validation. (D) The processing time of CaImAn was significantly longer than SUNS + TUnCaT and SUNS + CNMF both when processing raw videos and when processing SNR videos (*p < 0.05, **p < 0.005, two-sided Wilcoxon signed-rank test, n = 10 videos; error bars are standard deviations). We used the α of TUnCaT that optimized the F1 scores considering transients from all ground truth and algorithm-generated neurons. The gray dots represent the processing times for the test data on each round of cross-validation. (E) The F1 scores of SUNS + TUnCaT during 10-round cross-validation were significantly higher than that of CaImAn and SUNS + CNMF both when processing raw videos and when processing SNR videos (**p < 0.005, n.s. - not significant, two-sided Wilcoxon signed-rank test, n = 10 videos; error bars are standard deviations). We evaluated the accuracy by considering only neurons spatially segmented by all methods. The gray dots represent scores for the test data on each round of cross-validation. (F) The processing time of CaImAn was significantly longer than SUNS + TUnCaT and SUNS + CNMF both when processing raw videos and when processing SNR videos (*p < 0.05, **p < 0.005, n.s. - not significant, two-sided Wilcoxon signed-rank test, n = 10 videos; error bars are standard deviations). We used the α of TUnCaT that optimized the F1 scores considering only neurons spatially segmented by all methods. The gray dots represent the processing times for the test data on each round of cross-validation.
FIGURE 4
FIGURE 4
Temporal unmixing of calcium traces (TUnCaT) was more accurate than peer algorithms when processing simulated two-photon videos. (A) TUnCaT removed false transients caused by neighboring neurons. The first trace is the ground truth trace exported from the simulation process. The four remaining traces are the unmixed traces of the neuron of interest from four different methods (FISSA, CNMF, the Allen SDK, and TUnCaT). The labels (i)–(iv) indicate examples transients correctly (green) or incorrectly (red) detected by at least one unmixing algorithm. Each image below the traces is the corresponding spatial profile of fluorescence at the peak of each transient. We subtracted the median image over time from each image to remove the static fluorescence. The thick blue contour in each image shows the boundary of the neuron of interest, and the orange and yellow contours show the boundary of two different neighboring neurons (scale bar: 5 μm). (B) The F1 scores of TUnCaT during 10-round cross-validation were superior to that of the other methods both when processing raw videos and when processing SNR videos (*p < 0.05, **p < 0.005, two-sided Wilcoxon signed-rank test, n = 10 videos; error bars are standard deviations). The gray dots represent scores for the test data on each round of cross-validation. (C) The processing time of TUnCaT was comparable to or faster than the other methods both when processing raw videos and when processing SNR videos (**p < 0.005, n.s. - not significant, two-sided Wilcoxon signed-rank test, n = 10 videos; error bars are standard deviations). The gray dots represent the processing times for the test data on each round of cross-validation.
FIGURE 5
FIGURE 5
Temporal unmixing of calcium traces (TUnCaT) was more accurate than peer algorithms when processing experimental one-photon videos. (A) TUnCaT can remove false transients caused by neighboring neurons. The first trace is the background-subtracted trace of the SNR video of an example neuron representing the trace before unmixing, and the magenta transients show the manually determined ground truth transients. The four remaining traces are the unmixed traces of that neuron from four different methods (FISSA, CNMF, the Allen SDK, and TUnCaT). The labels (i)–(v) indicate example transients correctly (green) or incorrectly (red) detected by at least one unmixing algorithm. Each image below the traces is the corresponding SNR image at the peak of each transient. The thick blue contour in each image shows the boundary of the neuron of interest, and the orange and yellow contours show the boundary of two different neighboring neurons (scale bar: 10 μm). (B) The F1 scores of TUnCaT during 9-round cross-validation were superior to that of the other methods both when processing raw videos and when processing SNR videos (**p < 0.005, n.s. - not significant, two-sided Wilcoxon signed-rank test, n = 9 videos; error bars are standard deviations). The gray dots represent scores for the test data on each round of cross-validation. (C) The processing time of TUnCaT was comparable to or faster than the other methods both when processing raw videos and when processing SNR videos (*p < 0.05, **p < 0.005, n.s. - not significant, two-sided Wilcoxon signed-rank test, n = 9 videos; error bars are standard deviations). The gray dots represent the processing times for the test data on each round of cross-validation.

Similar articles

Cited by

References

    1. Akerboom J., Carreras Calderón N., Tian L., Wabnig S., Prigge M., Tolö J., et al. (2013). Genetically encoded calcium indicators for multi-color neural activity imaging and combination with optogenetics. Front. Mol. Neurosci. 6:2. 10.3389/fnmol.2013.00002 - DOI - PMC - PubMed
    1. Allen Institute (2019). Allen Brain Atlas [Online]. Availble online at: http://help.brain-map.org/display/observatory/Documentation (accessed Feb. 18, 2021).
    1. Bao Y. (2021). Data from: YijunBao/Shallow-UNet-Neuron-Segmentation_SUNS, v1.1.0. Zenodo.
    1. Bao Y., Soltanian-Zadeh S., Farsiu S., Gong Y. (2021). Segmentation of neurons from fluorescence calcium recordings beyond real time. Nat. Mach. Intell. 3 590–600. 10.1038/s42256-021-00342-x - DOI - PMC - PubMed
    1. Biscay R. J., Bosch-Bayard J. F., Pascual-Marqui R. D. (2018). Unmixing EEG inverse solutions based on brain segmentation. Front. Neurosci. 12:325. 10.3389/fnins.2018.00325 - DOI - PMC - PubMed

LinkOut - more resources