A MINiscope 1-photon-based Calcium Imaging Signal Extraction PIPEline.
MIN1PIPE is a fully automatic, Matlab-based toolbox, solving the full range problems in 1-photon calcium imaging in one package: data enhancement
→ movement morrection
→ signal extraction
. It requires minimal parameter-tuning and integrates the semi-auto options. Each inidividual module can also be easily adapted for the 2-photon imaging setting.
3/25/2022 New version released (v3.1 & v4.0.1 (beta)):
v4.0.1: MIN1PIPE now automatically detects se
and spatialr
. Please refer to the release notes for syntax.
v3.1: latest stable version, with relatively liberal standards of selecting ROIs. Feedbacks regarding the bugs and/or suggestions are welcome.
11/19/2019 New version released (v2-alpha): new neural enhancing module with noise suppression: reduce the effect of sharp background structures. Add new output variable dff
for dF/F. Feedbacks regarding the bugs and/or suggestions are welcome.
11/01/2018 New version released: updated movement correction module - balanced the running time for extremely large or shading videos; updated neural enhancing module - introduced dirt-cleaning function for dirty videos (potentially with dirts on the imaging sensor); updated seeds cleansing module - better seeds cleansing filters for seeds selection. Feedbacks regarding the bugs and/or suggestions are welcome.
09/26/2018 Updated data loading interface, for Doric scope videos with bit depth of 16.
07/16/2018 Patch version released. The program auto-detects available memory and processes data in chunk. Integrate fast read&write and memory mapping at key steps. The toolbox is undergoing some beta tests, so please expect frequent updates recently.
08/02/2018 Added guide for manual_seeds_select
and real_neuron_select
under the secion Usage.
08/16/2018 Added reading interface for .mat file format.
08/23/2018 Fixed bug of manual_seeds_select
.
MIN1PIPE contains the following three modules:
Neural Enhancing
: remove spatial noise and then adaptively remove non-neural background in the field of view in a framewise manner.Movement Correction
: remove field of view movement with a specially designed hierarchical nonrigid movement correction module (integrating KLT Tracker and LogDemons deformation registration method), which is free of assumption about movement type and amplitude.Neural Signal Extraction
: identify neuronal ROIs and corresponding calcium traces with minimal false positive rates (incorporating GMM, LSTM as true neuron selector and modified CNMF as spatiotemporal calcium signal identifier)
Additional Features
Semi-auto options
: we also provide semi-auto options, including
RNN-LSTM classifier training module
: we provide a module of Recursive Neural Network (RNN) with Long-short Term Memory (LSTM) structure fully implemented in Matlab with which the users can train their specific calcium-dynamical classifier. This Matlab implementation has the following dependencies (included under utilities
):
Additional Matlab toolboxes:
Other modified functions adapted from others are credited the original sources in code documentations.
min1pipe.m
.
min1pipe.m
Manual Options
Key Parameters:
Fsi
: frame rate of original videoFsi_new
: frame rate of temporally downsampled videospatialr
: spatial downsampling scalar, e.g. 0.5 for a spatial downsampling rate of 2 (now optional)se
: structure element size, estimated from typical half-neuron size after spatial downsampling (now optional)Procedure Parameters:
ismc
: whether use movement correction moduleflag
: whether use automatic or semi_automatic seeds selectionisvis
: whether visualize after processing, including results of each stepifpost
: whether use post-processKey Outputs:
roifn
: processed vectorized ROI footprints; contains single cell in each column (vectorized spatial map)sigfn
: processed calcium traces of corresponding ROIs; contains single cell in each row (calcium trace)spkfn
: spike train inferred from refine_sig.m
roifnr
: processed vectorized ROI footprints without calcium deconvolutionsigfnr
: processed calcium traces without calcium deconvolution, meaning "no artificial cleaning"seedsfn
: ROI centers in pixel coordinates; indices of all ROIs and be converted to (h, w) position using ind2sub
Params
: used parametersreg
: data after neural enhancing (and movement correction), saved for reprocessingOther fixed preset parameters can be found in min1pipe.m
, and the table
in the paper.
As a demo, we demonstrate the use of 1-photon calcium imaging video recorded with UCLA miniscope:
demo_min1pipe.m
The same code can also be adapted to custom scripts for the processing.
Here are the visualization of the demo dataset processing:
To use the code on a custom dataset, no specific requirements are needed. The processed data and the data after movement correction are saved in the same folder of the raw data in ".mat" format, with "_data_processed" and "_reg" as endings separately.
If post-process is selected, there will be an additional ".mat" file created with "_data_processed_refined".
Updates
Please cite the MIN1PIPE journal paper if it helps your research.
@article{lu2018MIN1PIPE,
title={MIN1PIPE: A Miniscope 1-photon-based Calcium Imaging Signal Extraction Pipeline.},
author={Lu, J., Li, C., Singh-Alvarado, J., Zhou, Z., Fröhlich, F., Mooney, R., & Wang, F.},
journal={Cell reports},
volume={23},
number={12},
pages={3673--3684},
year={2018},
publisher={Elsevier}
}
Archives
The paper is now accepted by Cell Reports.
Please cite the MIN1PIPE paper if it helps your research.
@article{lu2018MIN1PIPE,
title={MIN1PIPE: A Miniscope 1-photon-based Calcium Imaging Signal Extraction Pipeline.},
author={Lu, J., Li, C., Singh-Alvarado, J., Zhou, Z., Fröhlich, F., Mooney, R., & Wang, F.},
journal={bioRxiv, 311548},
year={2018}
}
or the related arXiv version:
@article{lu2017seeds,
title={Seeds Cleansing CNMF for Spatiotemporal Neural Signals Extraction of Miniscope Imaging Data},
author={Lu, Jinghao and Li, Chunyuan and Wang, Fan},
journal={arXiv preprint arXiv:1704.00793},
year={2017}
}
Please email to min1pipe2018@gmail.com
for additional questions.