/FlyCaImAn

Calcium Imaging Processing Pipeline of 3D time series

Primary LanguageMATLAB

FlyCaImAn - Fly Calcium Imaging Analysis Pipeline

Matlab code for analysis of calcium imaging data from the Drosophila brain, including motion correction, ROI segmentation, and detection of stimulus-modulated ROIs.

Organization of data

Pipeline

To process either 3DxT or 2DxT datasets:

    1. Convert tiffs to mat files (generate image data variable 'Data', and image metadata variable 'iDat').
    1. Pull extra information from metadata files ('.bin', '_vDat.mat', or '.mat' (LEDcontroler)).
    1. Do motion correction (using NoRMCorre).
    1. Do spatial and/or temporal resampling
    • this includes re-slicing for volumetric datasets and aligment relative to stimuli delivery.
    • generates main metadata variable used for ROI segmentation (wDat).
    1. select brain pixels (generate a binary mask).
    1. i) format stacks for ROI segmentation.
    1. ii) stitch (along z axis) and format stacks for ROI segmentation.
    1. ROI segmentation (in progress)
    1. Detect stimulus-modulated ROIs (in progress)

To register image segments to local whole brain and to in vivo atlas

  • (in progress)

Dependencies

For processing of imaging data this pipeline requires the following packages:

For processing of behavior videos with fictrac this pipeline requires the following packages:

  • Fictrac, see link for installation & dependencies (for windows see fic-trac-win).
  • generate calibration-transform.dat, and update that file in /toolbox/fictrac_offline/fictrac_settings

For saving figures install:

For stitching Z-stacks:

For interfacing with a cluster and ROI-related functions:

Usage

To use this package

  1. Copy and edit fiji_fullpathedit.m (see that file for details), and save as fiji_fullpath.m.

For examples see all the demos: FlyCaImAn_demo.m FlyCaImAn_behavior_only_demo.m FlyCaImAn_behavior_plus_stimuli_demo.m FlyCaImAn_behavior_plus_stimuli_plus_imaging_demo.m FlyCaImAn_imaging_only_demo.m FlyCaImAn_Zstack_demo.m

Acknowledgements

Special thanks to:

Citation

If you use this code please cite the following paper: Pacheco, D.A., Thiberge, S.Y., Pnevmatikakis, E. et al. Auditory activity is diverse and widespread throughout the central brain of Drosophila. Nat Neurosci (2020). https://doi.org/10.1038/s41593-020-00743-y