TrackMate Analysis of Calcium Imaging (TACI) is an open-source ImageJ plugin for 3D calcium imaging analysis that examines motion on the z-axis and identifies the maximum value of each z-stack to represent a cell’s intensity at the corresponding time point. It can separate neurons overlapping in the lateral (x/y) direction but on different z-planes.
Research in neuroscience has evolved to use complex imaging and computational tools to extract comprehensive information from data sets. Calcium imaging is a widely used technique that requires sophisticated software to obtain reliable results, but many laboratories struggle to adopt computational methods when updating protocols to meet modern standards. Difficulties arise due to a lack of programming knowledge and paywalls for software. In addition, cells of interest display movements in all directions during calcium imaging. Many approaches have been developed to correct the motion in the lateral (x/y) direction.
This paper describes a workflow using a new ImageJ plugin, TrackMate Analysis of Calcium Imaging (TACI), to examine motion on the z-axis in 3D calcium imaging. This software identifies the maximum fluorescence value from all the z-positions a neuron appears in and uses it to represent the neuron's intensity at the corresponding t-position. Therefore, this tool can separate neurons overlapping in the lateral (x/y) direction but appearing on distinct z-planes. As an ImageJ plugin, TACI is a user-friendly, open-source computational tool for 3D calcium imaging analysis. We validated this workflow using fly larval thermosensitive neurons that displayed movements in all directions during temperature fluctuation and a 3D calcium imaging dataset acquired from the fly brain.
The level of intracellular calcium is a precise marker of neuronal excitability. Calcium imaging measures the changes in intracellular calcium to understand neuronal activity1. Studies in neuroscience have increasingly used this method due to the development of techniques for measuring intracellular calcium concentration, including genetically encoded calcium indicators (GECIs), such as GCaMP2,3, which can be noninvasively expressed in specific sets of neurons through genetic approaches. The lower costs of lasers and microscope components have also increased the use of calcium imaging4. Importantly, calcium imaging allows for recording and studying single neurons as well as large neuron populations simultaneously in freely moving animals5.
Nevertheless, the analysis of calcium imaging data is challenging because (1) it involves tracking the changes in fluorescence of individual cells over time, (2) the fluorescence signal intermittently disappears or reappears with neuronal responses, and (3) the neurons may move in all directions, specifically in and out of a focal plane or appearing on multiple planes4,6. Manual analysis is time-consuming and becomes impractical as the length of recordings and the number of neurons increases. Various software programs have been developed to accelerate the process of analyzing calcium imaging. Previously, software was designed in a limited experimental context, making it difficult for other laboratories to adopt it. Recent efforts to meet modern standards for software sharing have led to the development of several tools that can consistently analyze calcium imaging data across different groups7,8,9,10,11,12,13,14,15,16,17,18,19. However, most of these tools require programming knowledge and/or depend on commercial software. A lack of programming knowledge and software paywalls deter researchers from adopting these methods. Moreover, many of these tools focus on correcting the x/y motion, although motion on the z-axis also needs to be explicitly diagnosed and corrected6. There is a need for a computational tool to analyze 3D calcium imaging that focuses on neurons exhibiting z-drift and appearing on multiple z-planes. Ideally, this tool should use open-source software and not require programming knowledge to allow other laboratories to readily adopt it.
Here, we developed a new ImageJ plugin, TACI, to analyze 3D calcium imaging data. First, the software renames, if needed, and organizes the 3D calcium imaging data by z-positions. The cells of interest are tracked in each z-position, and their fluorescence intensities are extracted by TrackMate or other computational tools. TACI is then applied to examine the motion on the z-axis. It identifies the maximum value of a z-stack and uses it to represent a cell's intensity at the corresponding time point. This workflow is suited to analyzing 3D calcium imaging with motion in all directions and/or with neurons overlapping in the lateral (x/y) direction but appearing in different z-positions. To validate this workflow, 3D calcium imaging datasets from fly larval thermosensitive neurons and mushroom neurons in the brain were used. Of note, TACI is an open-source ImageJ plugin and does not require any programming knowledge.
1. Calcium imaging
2. Analysis of the 3D calcium imaging data
Workflow of 3D calcium imaging analysis
In this study, we developed a new ImageJ plugin, TACI, and described a workflow to track z-drift and analyze 3D calcium imaging that pinpoints the responses of individual cells appearing in multiple z-positions (Figure 1). This tool has four functions: RENAME, ORGANIZE, EXTRACT, and MERGE. First, if the image names are not compatible with the ORGANIZE function, the RENAME function can convert the image names to the required structure. Then, the ORGANIZE function grayscales (if needed) and organizes the 3D calcium imaging TIFF data by z-positions. Images from the same z-position are saved in one folder. Next, different imaging analysis tools can be used to detect and track the ROIs and extract their fluorescence intensities over time for every z-position. An ImageJ plugin, TrackMate, was used to accomplish this step. TrackMate is an open-source ImageJ plugin for tracking single particles21. It has been widely used to track particles in various biological studies involving live-cell imaging, including calcium imaging11,21,22,23. TrackMate, in an automated manner, tracks cells in the lateral (x/y) direction, detects ROIs, and extracts signals from a live-imaging data set4,12. For every cell of interest, the EXTRACT function sorts the fluorescence intensities from all the z-positions by t-positions, identifies the maximum values of each t-position, subtracts the background, and calculates and plots ΔF/F0. Last, the MERGE function calculates and plots the average of ΔF/F0 of multiple cells.
Calcium responses of fly larval cool neurons to temperature changes
We validated this method using the calcium changes in response to temperature fluctuations in fly larval cool neurons. A genetically encoded calcium indicator, GCaMP6m24, was expressed in larval cool neurons by Ir21a-Gal425. When exposed to approximately 27 °C, the neurons had low intracellular calcium levels (Figure 2A and Figure 3). When the temperature was decreased to approximately 10 °C and held there, the intracellular calcium levels rapidly increased and were sustained (Figure 2B and Figure 3). The calcium levels rapidly dropped when the temperature was increased (Figure 3).
Analyzing a fly brain 3D calcium imaging dataset
We also validated this method using a fly brain 3D calcium imaging dataset11. The imaged transgenic flies (VT50339-Gal4;UAS-GCaMP6f) expressed GCaMP6f in the mushroom body in the brain11. Data from 45 z-positions (spaced at 1.5 μm intervals) were collected at 50 Hz for 225 s (250 time points), and the first half of the dataset (125 time points) was analyzed. When the recording began, seven neurons had obvious fluorescence, and four of them were analyzed (Figure 4A). The intensities in these neurons decreased over time (Figure 4B). When octanol was applied (Figure 4C), multiple neurons brightened. The fluorescence of 10 neurons was found to increase simultaneously at time point 92 (Figure 4D), suggesting that these mushroom neurons respond to octanol odor. Although octanol was applied for 5 s, high fluorescence in these neurons was observed in only one time point (0.9 s) and then quickly dropped, suggesting that the response is phasic and transient.
Separation of overlapping cells
Figure 5A presents a maximal projection image of three neurons. The white arrowhead points to two neurons that overlapped in the x/y plane but were separate in the ortho view (blue and orange arrowheads in Figure 5B), indicating that these neurons appeared in different z-positions; the orange cell had the strongest signal on z7 (Figure 5C), while the blue cell had the strongest signal on z10 (Figure 5D). The tool distinguished these two cells and revealed the delayed but strong activation of the orange cell (Figure 5E).
Figure 1: Workflow using TACI to analyze 3D calcium imaging. TACI has four functions: RENAME, ORGANIZE, EXTRACT, and MERGE. First, if the TIFF names are not compatible with the ORGANIZE function, the RENAME function can convert the image names to the required structure. Then, the ORGANIZE function grayscales (if needed) and organizes the 3D calcium imaging TIFF data by z-positions. Images from the same z-position are saved in one folder. Next, different imaging analysis tools can be used to detect and track the ROIs and extract their fluorescence intensities in every z-position. For every cell of interest, the EXTRACT function sorts the fluorescence intensities by the corresponding time points, identifies the maximum values of each t-position, subtracts the background, and calculates and plots ΔF/F0. Last, the MERGE function calculates and plots the average of ΔF/F0 of multiple cells. Abbreviations: TACI = TrackMate Analysis of Calcium Imaging; ROIs = regions of interest; ΔF/F0 = ratio of change in fluorescence to initial fluorescence intensity. Please click here to view a larger version of this figure.
Figure 2: Calcium imaging of fly larval cool cells in inactive and active states. (A) The cells are barely visible in the inactive state. (B) The cells are strongly fluorescent in the active state. Different color arrowheads indicate different cells. The genotype is Ir21a-Gal4;UAS-GCaMP6m. z5-13: images at z-positions from 5 to 13. In B, the cell indicated by the white arrowheads is shown on z5 to z8; the cells indicated by orange and blue arrowheads are shown on z8 to z13. Scale bar = 10 μm. Please click here to view a larger version of this figure.
Figure 3: Quantification of fluorescence as the change in fluorescence intensity (F) compared to the initial intensity (F0). The genotype is Ir21a-Gal4;UAS-GCaMP6m. n = 7 cells from three animals. Traces = mean ± SEM. Please click here to view a larger version of this figure.
Figure 4: Analyzing a fly brain 3D calcium imaging dataset. (A) The maximal projection image at time point 1 (t1). The numbers 0-3 indicate the four analyzed neurons. (B) Fluorescence changes of neurons 0-3 in A during time points 0 to 125. (C) The maximal projection image at time point 92 (t92). The numbers 0-9 indicate the 10 analyzed neurons. (D) Fluorescence changes of neurons 0-9 in C during time points 0 to 125. Either 5 s of air or 5 s of octanol were applied, as shown in gray. Scale bar = 10,000 units of raw fluorescence intensity. Abbreviation: OCT = octanol. Please click here to view a larger version of this figure.
Figure 5: Separation of overlapping cells based on the maximum value. (A) Two neurons are overlapping (white arrowhead) in a maximal projection image (m). The genotype is Ir21a-Gal4;UAS-GCaMP6m. (B) These neurons are separate in the ortho view (blue and orange arrowheads). (C,D) The orange cell appears on z7 (C), while the blue cell appears on z10 (D). Scale bar = 10 μm. (E) The fluorescence changes of the orange and blue cells are quantified using the maximum values from individual z-positions. Abbreviation: ΔF/F0 = ratio of change in fluorescence to initial fluorescence intensity. Please click here to view a larger version of this figure.
Supplementary Figure 1: Two neurons with weak calcium signals are analyzed using DoG and LoG detectors at different thresholds. (A–C) The first neuron (Ir21a-Gal8026/UAS-GCaMP6;Ir93a-Gal427) is analyzed by DoG and LoG at different thresholds. (A) The threshold is set at 0.1. Both DoG and LoG detect all 36 time points. (B) The threshold is set at 0.3. Among the 36 time points, DoG detects 36, and LoG detects 35. (C) The threshold is set at 1.0. Among the 36 time points, DoG detects 34, and LoG detects 15. (D–F) The second neuron (UAS-GCaMP6;Ir68a-Gal428) is analyzed by DoG and LoG at different thresholds. (D) The threshold is set at 0.1. DoG detects all 36 time points, and LoG detects 34. (E) The threshold is set at 0.3. Among the 36 time points, DoG detects 33, and LoG detects 18. (F) The threshold is set at 1.0. Among the 36 time points, DoG detects 14, and LoG detects only one. Of note, increasing the threshold does not affect its intensity reading if an ROI is recognized. Please click here to download this File.
Supplementary Figure 2: The maximum value is a good representative of a cell's intensity. (A) Z-stacks with different z-distances are simulated. (B) Z-stacks with different z-positions are simulated. (C) Z-stacks are created from simulated cells with different intensities. Abbreviations: max = the maximum value of a z-stack; ground_truth = the product of the simulated cell's volume and its filled intensity. Please click here to download this File.
Supplementary Figure 3: Comparison between TACI and 3D-ROI methods. (A) Fluorescence changes in two cells indicated by orange and blue are quantified using TACI and a custom software written in IGOR Pro. The genotype type is R11F02-Gal429;UAS-GCaMP6m. (B) Fluorescence changes in two cells indicated by orange and blue are quantified using TACI and IMARIS. The genotype type is Ir21a-Gal4;UAS-GCaMP6m. Abbreviation: ΔF/F0 = ratio of change in fluorescence to initial fluorescence intensity. Please click here to download this File.
This study developed a new ImageJ plugin, TACI, and described a workflow analyzing 3D calcium imaging. Many currently available tools focus on correcting the x/y motion, although motion on the z-axis also needs to be explicitly diagnosed or corrected6. During image acquisition in a live organism, movement on the z-axis is unavoidable even when the organism is immobilized, and some stimuli, such as temperature change, often cause significant z-drift. Increasing the height of the z-stacks will allow for recording the cells of interest during the whole imaging process; however, it is not trivial to analyze motion on the z-axis, especially when individual cells appear in multiple z-positions. If such movement is ignored, researchers will not obtain the precise calcium responses of these cells. TACI corrects the z-drift by extracting the fluorescence signals from every z-position. A critical step of TACI is to sort the maximum value at each time point and use it to represent a cell's intensity. Therefore, it is key to include all the z-positions of the cells of interest during the imaging process. Additionally, we recommend allowing a cell appearing in five or more z-positions so that the z-distances and z-positions do not affect the maximum value (Supplementary Figure 2A,B). In addition, TACI allows for the separation of cells that overlap in the lateral (x/y) direction but appear in different z-positions.
Z-drift can also be corrected by extracting fluorescence intensities from 3D ROIs8,11,29. We compared TACI with two 3D-ROI methods. First, Klein et al. created a custom software written in IGOR Pro that uses the brightest 100 pixels in each 3D ROI to generate the raw signal29. This method and TACI produced similar results (Supplementary Figure 3A). Second, we applied IMARIS (version 9.8.2), a commercial software, to model the 3D ROIs and extract their mean intensities. Although the results from TACI and IMARIS displayed similar trends, the fold changes were different (Supplementary Figure 3B). This discrepancy may be due to algorithms. Of note, the maximum value extracted by TACI is proportional to the ground truth intensity (Supplementary Figure 2C).
Although this workflow is semi-automatic and still requires manual efforts from researchers, it provides a computational approach for 3D calcium imaging analysis. Importantly, this workflow is based on ImageJ and does not require commercial software or programming knowledge. The limitations and potential solutions for this workflow are as follows. First, TACI only accepts TIFF files and a specific file name structure: filename_h#t#z#c#.tif (h# and c# are optional). However, other file formats compatible with ImageJ can be easily converted to TIFF files by ImageJ. Moreover, the plugin has a RENAME function that converts the image names to the required structure so that it is compatible with calcium imaging data obtained from different systems.
Second, the plugin is designed for calcium imaging data with constant backgrounds. Subtracting the corresponding background information from the ROI intensities at each time point is one way to correct fluctuating backgrounds. The tool provides ROI intensities at each time point in the python_files folder. The background intensities could be represented by (1) the images' mean intensities or (2) the mean intensities of the ROIs with no active cells. ImageJ provides methods to obtain the images' mean intensities (by clicking on Image | Stack | Measure Stack) and the mean intensities of random ROIs (by clicking on Analyze | Tools | ROI Manager | Multi Measure). If photobleaching happens during calcium imaging, the Bleach Correction function (by clicking on Image | Adjust | Bleach Correction) may be run before TrackMate.
Finally, cell registration across z-positions needs to be included in this workflow if using TACI to analyze a large number of neurons simultaneously. Accordingly, an additional function needs to be developed that organizes the information on fluorescence intensities into the data structure required by the MERGE function.
The authors have nothing to disclose.
A Zeiss LSM 880 in the Fralin Imaging Center was used to collect the calcium imaging data. We acknowledge Dr. Michelle L Olsen and Yuhang Pan for their assistance with the IMARIS software. We acknowledge Dr. Lenwood S. Heath for constructive comments on the manuscript and Steven Giavasis for comments on the GitHub README file. This work was supported by NIH R21MH122987 (https://www.nimh.nih.gov/index.shtml) and NIH R01GM140130 (https://www.nigms.nih.gov/) to L.N. The funders had no role in the study design, data collection and analysis, decision to publish, or preparation of the manuscript.
Blunt Fill Needel | BD | 303129 | |
Calcium chloride dihydrate | Fisher Scientific | 10035-04-8 | Fly food ingredient |
Carbon dioxide | Airgas | UN1013 | Size 200 High Pressure Steel Cylinder |
CO2 bubbler kit | Genesee | 59-180 | |
Confocal microscope LSM880 | Zeiss | 4109002107876000 | An inverted Axio Observer Z1, equipped with 5 lasers, 2 standard PMT detectors, 32-channel GaAsP dectectors, an Airyscan detector, and Definite Focus.2. |
DAQami software | Measurement Computing | ||
Dextrose | Genesee | 62-113 | Fly food ingredient |
Drosophila Agar | Genesee | 66-111 | Fly food ingredient |
Ethanol | Decon Labs, Inc. | 64-17-5 | Fly food ingredient |
Fly line: Ir21a-Gal4 | Dr. Paul Garrity lab | A kind gift | |
Fly line: Ir21a-Gal80 | Dr. Lina Ni lab | ||
Fly line: Ir68a-Gal4 | Dr. Aravinthan DT Samuel lab | A kind gift | |
Fly line: Ir93a-Gal4 | Dr. Paul Garrity lab | A kind gift | |
Fly line: UAS-GCaMP6 | Bloomington Drosophila Stock Center | 42750 | |
Flypad | Genesee | 59-114 | |
General purpose forged brass regulator | Gentec | G152 | |
Gibco PBS pH 7.4 (1x) | Thermo Fisher Scientific | 10010-031 | |
Green Drosophila tubing | Genesee | 59-124 | |
Heat transfer compound | MG Chemicals | 860-60G | |
Heatsink | Digi-Key Electronics | ATS2193-ND | Resize to 12.9 x 5.5 cm |
Illuminator | AmScope | LED-6W | |
Inactive Dry Yeast | Genesee | 62-108 | Fly food ingredient |
Incubator | Pervical | DR-41VL | Light: dark cycle: 12h:12h; temperature: 25 °C; humidity: 40-50% RH. |
Methyl-4-hydroxybenzoate | Thermo Scientific | 126965000 | Fly food ingrediete |
Micro cover glass | VWR | 48382-126 | 22 x 40 mm |
Microscope slides | Fisher Scientific | 12-544-2 | 25 x 75 x 1.0 mm |
Nail polish | Kleancolor | ||
Narrow Drosophila vials | Genesee | 32-113RL | |
Objective | Zeiss | 420852-9871-000 | LD LCI Plan-Apochromat 25x/0.8 Imm Corr DIC M27 |
Peltier cooling module | TE Technology | TE-127-1.0-0.8 | 30 x 30 mm |
Plugs | Genesee | 49-102 | |
Power Supply | Circuit Specialists | CSI1802X | 10 volt DC 2.0 amp linear bench power supply |
Princeton Artist Brush Nepture | Princeton Artist Brush Co. | Series 4750, size 2 | |
Sodium potassium L-tartrate tetrahydrate | Thermo Scientific | 033241-36 | Fly food ingredient |
Stage insert | Wienecke and Sinske | 432339-9030-000 | |
Stereo Microscope | Olympus | SZ61 | Any stereo microscope works |
T-Fitting | Genesee | 59-123 | |
Thermocouple data acquisition device | Measurement Computing | USB-2001-TC | Single channel |
Thermocouple microprobe | Physitemp | IT-24P | |
Yellow Cornmeal | Genesee | 62-101 | Fly food ingredient |
Z-axis piezo stage | Wienecke and Sinske | 432339-9000-000 |