File Exchange

image thumbnail


version (308 KB) by Eran Mukamel
Toolbox for automated sorting of cellular calcium signals from optical imaging data.


Updated 25 Aug 2016

From GitHub

View Version History

View license on GitHub

This toolbox includes routines for using principal component analysis (PCA) and independent component analysis (ICA) to extract cellular signals from imaging data sets. A full description and validation of the method is provided in the paper, "Automated Analysis of Cellular Signals from Large-Scale Calcium Imaging Data," Neuron, 63:747 (2009):

Cite As

Eran Mukamel (2021). emukamel/CellSort (, GitHub. Retrieved .

Comments and Ratings (11)

Adriaan Taal

Ok, the function call had a missing input, as I was calling it. It works if I use the statement as stated in the function script.

I'm trying to run CellSort using mu = 0.1 and receive the error message -

Error using CellsortICA (line 55)
Spatio-temporal parameter, mu, must be between 0 and 1.

Error in runCellSort (line 103)
[ica_sig, ica_filters, ica_A, numiter] =
CellsortICA(mixedsig, mixedfilters, PCuse, mu, nIC,
ica_A_guess, termtol, maxrounds);

Now, if I were to check if mu = 0.1; isempty(mu)||(mu>1)||(mu<0); I get -

ans =



However, the error message still occurs and the code breaks.
Is there something I'm doing wrong? Is there any sample code explaining how to specify "mu"?

Eran Mukamel

Dear Phanindra - You can find sample code that will illustrate the appropriate parameters here:

The processing time depends on the size of your data set. The majority of computation time is in the PCA dimensional reduction pre-processing; subsequent cell sorting is relatively fast.


I need to image segment a tiff calcium image data.I am unable to correctly specify the parameters smwidth and thresh? Can u please tell me what are the typical values? Also how much time does it take to run the whole code till segmentation?

Alexander Dumont

What does movm and movtm mean?

Eran Mukamel

Hi Alex - The CellSortPCA function requires a TIFF image stack.

Alexander Dumont

What file input is necessary for CellSortPCA to work?



The associated publication in Neuron 63, 747–760 makes this look promising. However, getting this to run based on the instructions provided in the supplementary publication is very trying for those with less than a mastery of Matlab.

Rob Campbell

These functions are well presented and a lot of care has gone into the code. Well worth a look. However, I have had trouble getting this to work reliably with my data since it has tendency to identify noise as the signal.

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!