A computational toolbox for identifying neurons, recorded with in vivo calcium imaging using miniaturized epifluorescence microscopes (miniscopes), post hoc in histology. Identifying in vivo recorded neurons post hoc allows a cell-type specific discrimination of neuronal subtypes. in vivo recorded calcium imaging data was pre-processed using Inscopix Mosaic software. The best way to start is by looking at the example data provided.
- Semi-automatic alignment and tracking of the same neurons recorded across multiple in vivo Ca2+ imaging experiments
- 3D histology reconstruction from laser confocal microscopy scans
- Manual cell segmentation tool in histology images
- Automatic matching of in vivo recorded cells, post hoc in histology images
If you use this code please cite the paper:
Anner, P., Passecker, J., Klausberger, T., & Dorffner, G. (2020). Ca2+ imaging of neurons in freely moving rats with automatic post hoc histological identification. Journal of Neuroscience Methods, 341(January), 108765. https://doi.org/10.1016/j.jneumeth.2020.108765
The following Matlab toolboxes are required:
- Statistics and Machine Learning Toolbox
- Image processing toolbox
- Optimization toolbox
The following Matlab implementations are required from the Mathworks File Exchange repository:
- Hessian based Frangi Vesselness filter by Dirk-Jan Kroon
- B-spline Grid, Image and Point based Registration by Dirk-Jan Kroon
- Region Growing (2D/3D grayscale) by Daniel Kellner
- sort_nat: Natural Order Sort by Douglas Schwarz
The main script is Main.m that will guide you through the processing operations. Sampledata.mat stores manually derived parameters for processing the sample data provided.
The script InVivo_Align_CaImagingSessions.m loads in vivo recorded Ca2+ imaging data. Ca2+ imaging data was pre-processed with Inscopix Mosaic software. For further details on required structure of in vivo recorded Ca2+ imaging data, please refer to section in vivo Ca2+ imaging data . First, the final experiment for the detection of blood vessels (RECDSA) is loaded and processed. All following experiments are loaded and co-registered with RECDSA. Sampledata.mat data includes all manually defined control points for registration.
Volumetric laser confocal microscope scans are provided within the sample data. Histology was not labeled with antibodies and endogenous Green fluorescence protein (GFP) signals from the Calciun indicator GCaMP6f were scanned. Histology imaging data is processed within Main.m.
Image stacks from volumetric histology scans are loaded using load_histology_imagestack.m. A new window opens, allowing to select all images belonging to the scan of the first histology section. You can select multiple images by using clicking the while pressing the [Shift] button. When you are done with selecting the images click Open to proceed selecting the scanned images of histology section 2. You can repeat the steps until you loaded the images of all histology sections. When done, press cancel to proceed loading the selected files.
If you performed co-labeling of neurons in histology, you must export z-stacks of all channels separately and load them within Main.m. All transformations must then also be applied to the data structures of histology channel 2. When you assess the expression of fluorescent markers of matched cells using plot_interactive_identifiedcells.m, you can switch the displayed channels of the histology scans.
In the sample data, three individual in vivo Ca2+ imaging recordings are provided:
Each in vivo Ca2+ recording consists of:
- a Minimum intensity projection image of the original movie (*.minrec.tif)
- a .csv file containing calcium transients and calcium events
- and a folder IC containing all independent component images (IC) of all identified neurons.
Each .csv file must follow a specific structure:
- The first row contains variable names (export them from Mosaic)
- The first column includes a time code
- The following columns contain dF/F traces, optionally calcium event traces as well.
Further, a final experiment a fluorescent dye was injected into the tail vein of the anaesthetized animal. Prior to the injection of the fluorescent dye, a three-minute-long recording was obtained. Following the injection of the fluorescent dye, another three-minute-long recording was obtained. In this experiment no neuronal activity was recorded. Instead, projection images of the original movies are provided:
- min-natice.tif is a minimum intensity projection image of the recording acquired prior to the injection of the fluorescent dye.
- mean-native.tif is a mean intensity projection image of the recording acquired prior to the injection of the fluorescent dye.
- maxIP-CE.tif is a standard deviation projection image of the recording acquired following the injection of the fluorescent dye.
If you have any questions and comments, please use Github discussions and I will answer as soon as possible. If you find any bugs, please create an issue.
This program is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) license. Non-commercial use of the software is free.
This program is distributed in the hope that it will be useful for research, but without any warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. See the CC BY-NC-ND License for more details.