Skip to content

Matlab implementation of a source extraction and spike inference algorithm for large scale calcium imaging data analysis, based on a constrained matrix factorization approach.

License

Notifications You must be signed in to change notification settings

gitter-badger/ca_source_extraction

 
 

Repository files navigation

ca_source_extraction

The code implements a method for simultaneous source extraction and spike inference from large scale calcium imaging movies. The code is suitable for the analysis of somatic imaging data. Implementation for the analysis of dendritic/axonal imaging data will be added in the future.

The default options for the algorithm require the following packages:

  1. The constrained deconvolution package maintained separately in https://github.com/epnev/constrained-foopsi
  2. The CVX library which can be downloaded from http://cvxr.com/cvx/download/ (follow the installation instructions provided there)

The algorithm is presented in more detail in

Pnevmatikakis, E. A., Gao, Y., Soudry, D., Pfau, D., Lacefield, C., Poskanzer, K., ... & Paninski, L. (2014). A structured matrix factorization framework for large scale calcium imaging data analysis. arXiv preprint arXiv:1409.2903. http://arxiv.org/abs/1409.2903

function name description
demo_script.m wrapper code
demoMovie.tif Sample dataset for running the code (by W. Yang and D. Peterka)
update_spatial_components.m update spatial components given temporal components and data
update_temporal_components.m update temporal components given spatial components and data
merge_ROIs.m merge spatially overlapping components that are temporally correlated
utilities/arpfit.m estimation of noise level for every pixel and global time constants
utilities/bigread2.m read (parts of) large tiff stacks
utilities/com.m: calculation of the center of mass of each component
utilities/correlation_image.m calculates the correlation image of the movie
utilities/extract_DF_F.m transforming the temporal components in the DF/F domain
utilities/graph_connected_comp.m finds the connected components in a graph
utilities/greedyROI2d.m Greedy method for initializing the spatial and temporal components
utilities/interp_missing_data.m Filling in missing data using linear interpolation
utilities/lars_regression_noise.m solve a basis pursuit denoising problem using the LARS algorithm
utilities/make_G_matrix.m construct a convolution/deconvolution matrix
utilities/make_patch_video.m construct a video that displays the results of the algorithm
utilities/order_ROIs.m order found components based on their temporal activation and spatial size
utilities/plain_foopsi.m projection of fluorescence onto the cone formed by the indicator dynamics
utilities/plot_contours.m contour plot of found components and creation of a json file
utilities/tiff_reader.m loading a tiff stack into matlab
utilities/threshold_components.m mild post-processing of spatial components
utilities/view_patches.m plotting of each found component and its temporal activation

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

About

Matlab implementation of a source extraction and spike inference algorithm for large scale calcium imaging data analysis, based on a constrained matrix factorization approach.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • MATLAB 96.5%
  • C++ 3.5%