A multicellular analysis calcium imaging toolbox for ImageJ
John Hageter, Audrey DelGaudio, Maegan Leathery, Braxton Johnson, Tegan Raupp, James Holcomb, Axel Faz Treviño, Julius Jonaitis, Morgan S. Bridi, Andrew Dacks, Eric J. Horstick

TL;DR
The paper introduces MCA, an open-source ImageJ plugin for analyzing calcium imaging data, validated across multiple organisms and sensory responses.
Contribution
MCA is a modular, user-friendly, open-source functional imaging analysis toolbox for ImageJ.
Findings
MCA was validated using zebrafish calcium imaging data.
MCA supports analysis of multiple sensory responses and model organisms like Drosophila and mouse.
MCA includes features like motion correction and data annotation.
Abstract
Functional imaging using genetically encoded indicators has become a foundational tool for cellular dynamics and communication analysis. However, large or complex experiments pose analytical challenges. Many programs address these challenges; however, most require proprietary software, impose restrictions, or require programming knowledge, which limits their utility. To address this, we designed MCA (Multicellular Analysis toolkit) to work with ImageJ, a widely used open-source software. MCA utilizes ImageJ to generate new images based on completed tasks, allowing visualization of the analysis pipeline. MCA also implements a user-friendly graphical user interface (GUI) resembling native ImageJ plugins. We incorporated rigid registration for motion correction, cell prediction algorithms, and data annotation and exporting features. We validated MCA using previously published zebrafish…
Genes, proteins, chemicals, diseases, species, mutations and cell lines named across the full text — each resolved to its canonical identifier and authoritative record.
Click any figure to enlarge with its caption.
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNeural dynamics and brain function · Cell Image Analysis Techniques · Single-cell and spatial transcriptomics
Introduction
Functional imaging using genetically encoded indicators (GEIs) has become an invaluable and widely used strategy to assess cellular function. Arguably, the most prominent and widely used GEIs are genetically encoded calcium indicators, such as GCaMP, a fluorescent reporter of calcium concentrations and a proxy for cellular activity.1^,^2^,^3 However, calcium is not the only relevant GEI. GEI tools are available for glutamate, GABA, voltage, glucose, dopamine, and many other key biological factors.2^,^4^,^5^,^6 Availability of such tools has given researchers an unprecedented ability to assess the function of nearly every cell type and organ system in the body, often with cellular resolution and in vivo. The utility of GEIs is evident in the rapidly growing evolution of these tools to fluorescently observe and evaluate diverse neurotransmitters, cell types, or regions.4^,^5^,^7 The ability to leverage genetic control has also enabled localization of indicators with genetic tags. For example, nuclear localization, synaptic localization, or other tagged localization of GCaMP have allowed improved single-cell segmentation or synapse characterization in neurons, respectively.4^,^8 Moreover, the advancement of GEIs, in combination with ever-improving imaging technologies such as multiphoton and light sheet imaging strategies, has allowed functional characterization to expand to whole tissue, multi-regional brain planes, and even whole brains. Therefore, GEIs are capable of cell-to-system-scale characterization, which is viable across numerous species.6^,^9^,^10^,^11 However, despite the widespread usage and application of functional imaging with GEIs, a major challenge is performing analyses that extract meaningful, quantifiable data from datasets containing hundreds, if not thousands, of cells. For instance, extracting cell- or region-specific signals from large-scale imaging datasets, sample-to-sample registration for rigorous spatial comparison, and predicting neuronal locations are non-trivial and can readily become computationally complex or excessively time-consuming if performed manually. Therefore, many functional imaging analyses require software specifically developed for the task. Indeed, several programs have been developed, yet most cases require optimization through command-line inputs or access to proprietary software.12^,^13^,^14^,^15 An alternative is that many labs develop custom code,7^,^14^,^16 yet these may not be readily adopted by other labs depending on programming skill or available hardware or software. Therefore, a gap exists between the accessibility of GEI tools for functional imaging acquisition and the ability to readily and rigorously extract these data.
To address this gap, we developed MCA, a Multicellular Analysis toolkit developed in the Java programming language for use with ImageJ, a completely open-source and widely used scientific image analysis program.17 MCA’s primary software tool, the Cell Manager plugin, mimics the functionality of ImageJ’s built-in regions of interest (ROIs) Manager, providing a simple user interface with methods designed specifically for functional imaging analysis by extending the functionality of plugins already available in ImageJ, as well as providing new functionality not currently available. MCA provides a simple graphical user interface (GUI), executed within ImageJ, and performs image registration for motion correction, single-cell segmentation, custom ROI-based annotation, data standardization based on user-selected parameters, averaging across replicates, background subtraction, and writing of functional imaging data from every form of image type available for use in ImageJ. Moreover, MCA includes spreadsheet-format output for simplified analysis in programs such as Microsoft Office or Libre Office. We validated MCA using GCaMP imaging in larval zebrafish in response to visual and auditory stimuli spanning several brain regions. In addition, we leverage GCaMP imaging datasets from Drosophila melanogaster and Mus musculus to show that MCA is tractable for multiple species analyses and detection of cellular or regional activity. Collectively, we demonstrate that MCA provides a straightforward analysis application for complex functional imaging data that is tractable and integrated into widely used and open-source image analysis software.
Results
MCA is a GUI plugin for ImageJ to analyze functional imaging datasets
We designed a functional imaging software for ImageJ for two main reasons: (1) ImageJ is one of the most widely used tools for scientific imaging analysis while remaining open source and freely available to the public,17^,^18 and (2) many of the current functional imaging packages available pose specific challenges, such as steep learning curves or reliance on proprietary software, impeding accessibility. We propose that integration with ImageJ would provide access to diverse and powerful resources for image analysis, especially if coupled with functional imaging capabilities. Thousands of plugins have been developed for ImageJ that have provided expansive resources for image analysis.19^,^20^,^21 However, what remains lacking is a centralized, flexible, and user-friendly functional imaging analysis plugin for ImageJ that could leverage the currently available applications associated with this widely used resource.
The main interface of the MCA plugin is the Cell Manager GUI. The GUI consists of two primary sections: (1) a list of ROIs and (2) a list of buttons that facilitate key processes in functional imaging analysis (Figure 1A). In addition, we added two tabs for organizing ROIs, where the user can look at individual ROIs in the “Cells” tab or user-defined groups of cells in the “Groups” tab. GUI functional buttons assist in key processes of calcium imaging analysis. These functions are designed to be modular, meaning they can be used in any order or with any other available ImageJ function (Figure 1B). Each one of the functions listed is designed to provide visual user feedback, with output that shows how the function processed the image (Figure S1A). The goal of MCA’s architecture is to allow researchers to visually understand how their data is being processed and the restrictions or processes happening “behind the scenes” throughout analytical steps. This allows the researcher to visually analyze their data rather than searching for trends in spreadsheets or coding-based methods, which highlights human pattern recognition and potentially reveals trends that would be tedious to determine using numerical methods. In addition, this software is supported by the ImageJ Bio-Formats plugin, which allows for the conversion of most proprietary imaging formats to ImageJ’s ImagePlus format used by MCA (Figure 1C).22Figure 1MCA is a calcium imaging toolbox integrated with ImageJ(A) Screenshot of the Cell Manager GUI and functional layout.(B) Functions available in the Cell Manager and representative functions that can integrate with the Cell Manager from Fiji/ImageJ.(C) Representative import of most imaging formats into the ImageJ ImagePlus format, which is used for all analysis in MCA.(D) Representative example of motion correction used by MCA, integrating the OpenCV template matching algorithm.(E) Representative cell segmentation of a sum projection of an imaging series using a trained H2B-GCaMP model for cell detection in Cellpose.(F) Representative examples of polygonal grouping of cells or point grouping.(G) Illustrative example of an imaging series converted from an acquired 8-bit gray value image into a 32-bit image series that represents the ΔF/F values at each pixel.
In the Cell Manager, we integrated processing functions for motion correction, ROI detection, cellular annotation, and signal extraction for analyzing data, and lastly a function that exports data from ImageJ to a spreadsheet-based format. Typically, functional imaging videos are subject to motion artifacts from animal moving, minor vibrations from imaging equipment, or external factors such as human disruption. To correct this, we implemented OpenCV’s template matching algorithm, which is the main method used in the “Template Matching” plugin developed for ImageJ (Figure 1D).23^,^24 This is an intensity-based method for correcting motion artifacts, which has been widely used for simple rigid motion correction in calcium imaging and other time-series imaging.24^,^25^,^26
A main function of the Cell Manager is ROI detection. The goal for this method was to integrate into MCA an approach that automates cell detection and segmentation from an image rather than manually curating cells with a variety of native ImageJ functions. To achieve this, we incorporated two machine learning model-based approaches for detecting cells from an image: Cellpose and StarDist.27^,^28^,^29^,^30 These tools are machine learning models that are regularly used to detect cell boundaries and are designed to aid in segmentation of cell nuclei (StarDist) or detection of different types of cells (Cellpose). Both of these model-based approaches have been utilized for cell segmentation of biologic data31^,^32^,^33^,^34 and advanced biologic image processing applications.35^,^36^,^37 When used in MCA, Cellpose returns an image of predicted cell locations from an input image, while StarDist imports cell ROIs directly into ImageJ’s ROI Manager (Figure 1E). However, these model-based approaches require that cells have sufficient spatial separation to be properly labeled; otherwise, manual labeling can be completed with the “Add cell” function in MCA or with the ROI Manager in ImageJ. From either of these outputs, cell ROIs can be directly imported from the ROI Manager to the Cell Manager with the “Load from ROI Manager” function, which syncs ROI data between each manager.
To maintain MCA as a user-friendly plugin, we integrated the capacity for annotation of data prior to exporting data. These methods facilitate quick renaming of cellular ROIs and the ability to group ROIs together. The main annotation methods are grouping functions, which allow users to group cell ROIs together using the reference map by either manually drawing a grouping ROI around multiple cells with the “Polygon grouping” function or by selecting multiple cells individually with the “Point grouping” function (Figure 1F). This method of annotating groups of cells together prepares them for export by specific user-defined groups, providing easy organization of large imaging areas with cells that may belong to unique categories.
Next, we wanted to design a clear way to make raw data immediately accessible and understandable through visualization, reducing the need for users to explore data through typical file formats such as binary or CSVs. To achieve this, we sought to convert an imaging series from the original pixel values to values that would be directly used when exporting data. Standard image pixel values are not useful for measuring activity because they vary wildly among samples and are sensitive to GEI expression levels. Through the “Convert stack to DF/F” function, pixel values from the recording are converted to standardized change in fluorescence (ΔF/F) relative to a user-defined baseline period, which is calculated for every pixel (Figure 1G). This transformation standardizes fluorescence intensity values among cells and across individuals in a visual manner rather than a spreadsheet-based format.
Data also typically needs to be filtered to reduce noise, which supports identifying where biologically relevant activity is occurring. MCA accomplishes this through two distinct functions that can be applied when exporting data: (1) signal filtering and (2) peak detection. Currently, MCA uses a Gaussian filter, which smooths fluctuations across data points in the raw fluorescent signal. The algorithm for detecting peaking activity is a sliding window-based method, which has been widely used in a variety of applications requiring accurate estimation of changes during time series data.38^,^39^,^40^,^41^,^42 This method looks for sudden changes or “peaks” in the calcium signal over time using a user-defined time window and comparing signal change across preceding windows. The threshold for significance is based on the number of standard deviation changes, which is also user defined. This peak detection algorithm indicates within the recording where there was no change (value = 0), a significant increase (value = 1), or a significant decrease (value = −1) in signal activity. We reasoned that this peak detection output would provide a simple interface for further analysis and data exploration. Data is then exported from MCA through the “Generate Data” function. This function compiles data from all the ROIs in the Cell Manager, group annotations, and image stacks from multiple recordings and generates two tables in ImageJ, which represent the average signal within each ROI and predicted significant peaking activity (0, 1, −1 format). Using the “Generate Data” function with a converted stack will generate the ΔF/F signal within each ROI. Generated data contain columns for every slice of the image stack and the corresponding signal value. Additional columns denote the name of the file recorded from (“Name” column), the name of the ROI (“ROI” column), X and Y coordinates for the center point of the ROI (“X” and “Y” columns), as well as the method used for filtering (“Filter” column) and detecting peaking activity (“Detection.Method” column) from the signal data.
MCA can be leveraged in many ways to process functional imaging data, for which we outline a generic workflow using MCA (Figure 2A). Broadly, there are two paths that can be flexibly used and adjusted based on experimental goals, which we refer to as the “analysis” and “annotation” paths. The analysis path encompasses the steps required for exporting data and includes motion correction, cell labeling (either manual or using a model), converting the stack to ΔF/F, and exporting data to CSV format. This path can, at any step, be accompanied by the annotation path, which includes functions for organizing and labeling ROIs, easing post-data export analyses. Generating a “map” is not a function contained within MCA but can be accomplished with basic ImageJ functions. For example, creating a sum or max projection of a recording would generate a map of all cells. In contrast, another type of cell map could be a multichannel image identifying groups of cells in different channels. ROIs can be easily labeled or grouped using the available methods and across multiple images. After grouping cells together, these groups and the ROIs contained within will be available to visualize from the “Groups” tab in the GUI or in a dedicated “Groups” column within the exported CSV. Together, these features and the architectural design make MCA a comprehensive and user-friendly plugin for working with functional imaging data in ImageJ.Figure 2. Workflow for using MCA(A) Representative workflow following the import of an imaging series into ImageJ. There are two main paths for working in the Cell Manager: an analytical path and an annotation path. The annotation path consists of using external functions, such as creating a composite image or maximum projections to create a map that can be annotated. From here, the user can set standard naming to ROIs and then group ROIs using two methods: polygonal grouping or point-based grouping.The analytical path is required to generate a dataset from the imaging series. Initially, it begins with the motion correction step, continues to the cell detection step using either Cellpose or Stardist2d to predict cellular ROIs or manually label them. Next, and then the imaging series is converted to raw data, which is finally exported into spreadsheets.
MCA is validated against manually analyzed data
To validate the accuracy of MCA, we repeated an analysis of a previously published calcium imaging dataset. In the previous analysis, visual stimulation evoked distinct patterns of neuronal activity across thalamic regions and brain hemispheres.31^,^43 We reasoned that these differential responses would provide an ideal dataset to test the ability of MCA to extract biologically relevant signals. This experiment used a pan-neuronal nuclear localized GCaMP line crossed to reporter lines, Tg(elavl3:H2B-GCaMP6f; y279:Gal4; UAS:epNTR-tagRFPt), to visualize thalamic neurons of interest and surrounding unlabeled neuronal populations. Therefore, this analysis provided regionally distinct functional differences to detect, as well as neuron- and brain region-level segmentation, for which to test MCA. Initially we wanted to determine how accurately our Cellpose model detected cellular ROIs. To do this, we applied sum projections to all 19 larvae in our dataset and applied the H2BGCaMP model we trained in Cellpose (see STAR Methods). For comparison, we manually counted all cells across these 19 larvae. We found that the number of cells identified by our trained Cellpose H2BGCaMP model and manual counts were highly similar, which supports the efficacy of the cell segmentation used in MCA (Figure S2A; Table 1; paired t test, t(18) = 1.87, p = 0.08). In addition, we compared how our model performed across multiple optical zoom levels, where cells can appear blurrier at low zoom and clearer when at high zoom levels. We found that at low zoom levels, our model over-labeled cells compared to the manual count, while at higher zoom levels, model output remained like manual labeling (Figure S2B). For this experiment, larvae were exposed to a light-off stimulus, and we filtered neurons that responded to light extinction (Figure 3A). From our new analysis using MCA, we quantified neurons as being light responsive if a response was 1) at least 3 standard deviations greater than the standard deviation of the 30 previous time points using our implemented peak detection algorithm, and 2) if at least 3 consecutive time points had values above this threshold. Based on their responses to the light stimulus, we grouped neurons into OFF-responsive neurons, ON-responsive neurons, or OFF/ON-responsive neurons according to their intensity change following the loss of illumination, return of illumination, or both, respectively. Using MCA, we grouped neurons into the same regions as described in the previous publication: greater thalamus (Great Th.), lateral thalamus (Lat Th.), and posterior tuberculum (PT), along with grouping these regions by hemisphere and association with behavior (Figure 3B).16^,^31^,^44 The MCA analysis and Cellpose segmentation produced similar quantification and hemispheric asymmetric patterns as previously reported (Figures 3C, 3D, and S3A–S3D). Using MCA, we were able to extract a total of 958 responsive neurons across 19 fish (OFF-responsive = 644; ON-responsive = 163; OFF/ON-responsive = 151). This compares to our published analysis, where we were able to extract 976 responsive neurons across the same 19 fish (OFF-responsive = 718; ON-responsive = 224; OFF/ON-responsive = 34) (Figures 3E and S3E). In our previous analysis, we were able to visualize asymmetric strength in response to the loss of illumination across different regions of the thalamus, yet not the PT. This difference in response strength was compared to a turning behavior that zebrafish engage in following the loss of illumination, where they circle in either a leftward or rightward direction. We then grouped responses based on whether the cell was in the hemisphere that matched the direction of the behavior (leftward turning and left hemisphere) or opposed to the direction of the behavior (left turning and right hemisphere). To compare our previous findings with the MCA analysis, we averaged OFF-responsive neurons’ responses for the 3 time points following the loss of illumination. Across all three major ROIs (Great Th., Lat. Th., and PT), we noted an increased response strength. For the Great Th., automated ROI detection using MCA replicated the prior observation (which was obtained by manual ROI placement) that responses in the hemisphere matched to the behavior have a larger response than those located in the opposed hemisphere (Figure 3F, green box MCA: t(162) = 4.94, p < 0.0001; Prior data: t(141) = 4.71, p < 0.0001). We also recapitulated significance in lateral thalamic asymmetry maintaining neurons (AMNs), where responses are stronger in the hemisphere opposed to the motor behavior (Figure 3F, orange box; MCA: t(78) = −3.86, p = 0.0002; Prior data: t(183) = −2.22, p = 0.028). Lastly, we show that no asymmetry was present in the PT, consistent with previous findings (Figure 3F, purple box MCA: t(248) = 0.913, p = 0.362; prior data: t(316) = −0.885, p = 0.377). This analysis shows that MCA was able to successfully delineate key ROIs, perform automated segmentation, and recapitulate functional and hemispheric differences previously identified through laborious manual processing of functional imaging data. One difference we observed was that the MCA responses showed higher ΔF/F, likely due to the background subtraction included with the MCA toolkit. To test this hypothesis, we randomly selected 7 fish from our previous dataset and ran them through MCA without applying background subtraction. We selected all OFF-responsive neurons identified from the dataset with background subtraction and matched them to their non-background-subtracted equivalents. By comparing the maximum change in signal, we found that adding background subtraction increased signal strength by 14% ± 2% (paired t test: t(912) = 13.1, p < 0.0001; Figure S3F). This validation work shows that automated ROI detection using MCA reliably and accurately generates output consistent with prior observations using manual methods of functional imaging analysis.Figure 3MCA maintains previous trends in calcium imaging data(A) Representative calcium imaging assay showing OFF (magenta) or ON (cyan) responses. Larvae were imaged for 3 min: light on for 1 min, light off for 1 min, and light back on for 1 min. This series was repeated twice, and the data were averaged together.(B) Representative sectioning of the thalamus into the lateral thalamus (Lat Th., orange), which contains the AMNs (magenta); the greater thalamus (Great Th., green), which includes every cell medial and anterior to the lateral thalamus; and the posterior tuberculum (PT, purple). Scale bars, 20 μm.(C) Averaged output for OFF-responsive neurons in the AMNs between matched (cyan) and opposed (red) hemispheres for published data (Prior data: matched: N = 79; opposed, N = 106). ∗ Indicates p < 0.05 between matched and opposed for at least 10 consecutive time points.(D) Same as (C), but using MCA (matched: N = 50, opposed: N = 60). ∗ Indicates p < 0.05 by two-tailed t test between matched and opposed, where p < 0.05 for at least 20 consecutive time points. Envelope on lines shows standard error of the mean (SEM).(E) Relative frequency of response types among regions between analysis methods: Prior data: Great Th., none (black), N = 1,799 (83.2%); OFF (purple), N = 143 (6.1%); OFF/ON (teal), N = 13 (0.5%); ON (yellow), N = 72 (3.2%); Lat Th., none, N = 939 (79.9%); OFF N = 252 (20.5%); OFF/ON, N = 5 (0.4%); ON, N = 35 (2.8%); and PT, none, N = 1,706 (79.2%); OFF N = 318 (14.7%); OFF/ON, N = 16 (0.7%); ON, N = 115 (5.3%).MCA: Great Th., none, N = 1,799 (86.1%); OFF, N = 164 (7.9%); OFF/ON, N = 57 (2.7%); ON, N = 69 (3.3%); Lat Th., none, N = 606 (79.9%); OFF N = 89 (12.2%); OFF/ON, N = 30 (4.1%); ON, N = 5 (0.7%); PT, none, N = 2,421 (86.8%); OFF N = 250 (9.0%); OFF/ON, N = 45 (1.6%); ON, N = 74 (2.7%).(F) Average peak OFF response between matched (cyan) and opposed (red) OFF-responsive neurons in the greater thalamus (green; prior data: matched N = 63, opposed N = 80; MCA: matched N = 84, opposed N = 80), lateral thalamus AMN+ (orange; prior data: matched N = 79, opposed N = 106; MCA: matched N = 36, opposed N = 44), and posterior tuberculum (purple; prior data: matched N = 170, opposed N = 148) ∗ indicates p < 0.05 by two-tailed t test between matched and opposed within each method. Error bars represent SEM.
MCA is versatile for a variety of experimental formats
Next, we wanted to demonstrate the flexibility of the MCA platform for analyzing functional imaging of sensory-driven activity in the brains of other model organisms and sensory modalities. We first expanded our analysis by applying MCA to auditory responses in the larval zebrafish stato-acoustic ganglia (SAG). First, we designed a method to test acoustic responses from the SAG in zebrafish in response to an auditory stimulus. The SAG connects hair cells within the inner ear to the brain and is necessary for hearing and maintaining balance.45^,^46^,^47 We recorded zebrafish responses to a series of progressively increasing amplitude auditory cues, which were delivered through a speaker mounted to the bottom of the imaging dish (Figure 4A). We used the Tg(y256:Gal4; UAS:epNTR-mCherry; elavl3:H2B-GCaMP6f) line, which allowed visualization of the SAG and pan-neuronal expression of nuclear localized GCaMP6f (Figure 4B). GCaMP-expressing cells were then automatically identified using the Cellpose function in MCA, while SAG cells were manually identified and grouped using the “Point grouping” function in MCA. From this stimulation series, using MCA, we were able to extract auditory responses across all stimulus amplitudes (Figures 4C and 4D). We categorized significant cellular responses if at least two of five responses to the auditory cues were significant for one or more frames following stimulus onset. We found that MCA was able to extract responses from 26.7% of SAG cells following an auditory stimulus (Figures 4E and 4F). Typically, only ∼2% of neurons in the zebrafish SAG respond to vibrational stimuli, whereas 40% respond to changes in balance orientation.48^,^49^,^50 This is a larger percentage of responses compared to previous evidence; however, we posit that this is due to the aggressive amplitudes used for delivering stimuli, which could disrupt zebrafish balance sensation.Figure 4MCA is versatile for a variety of stimulus delivery techniques(A) Representative diagram of an acoustic calcium imaging series where larvae are exposed to an acoustic stimulus of increasing amplitude every 30 s.(B) Representative imaging plane indicating SAG cells (red) and pan-neuronal GCaMP6f (white). Scale bars, 20 μm.(C) Raster plot where every row represents a different cell that responds to at least one of the acoustic stimuli (denoted by red arrows). Color indicates ΔF/F value.(D) Average of all responsive cells across the imaging series. Line and ribbon indicate mean ± SEM. Dotted red lines indicate stimulus points.(E) Pie chart indicating the percentage of SAG cells that responded to at least one of the acoustic stimuli(response: light gray, N = 70; no response: dark gray, N = 192).(F) Same as (E), indicating the percentage of responsive cells to each amplitude (1V, N = 48; 2V, N = 36; 3V, N = 31; 4V, N = 8; 5V, N = 15).
To further demonstrate the utility of MCA, we wanted to show that this is a valuable toolkit for assessing functional imaging data from other model systems. Compared to our previous pipeline for extracting responses from nuclear localized GCaMP, our other model organism datasets used cytosolic GCaMP. Using ImageJ’s native ROI drawing tools, we were able to adjust our workflow to manually draw ROIs. We applied this adjusted MCA pipeline to a regional calcium imaging recording from the Drosophila antennal lobe, where individual glomeruli were segmented to record responses from individual neuronal compartments to a timed exposure to apple cider vinegar (ACV), a common and potent olfactory stimulus (Figure 5A).51^,^52 The MCA pipeline was able to extract responses from local interneurons with electrotonically isolated compartments that innervate individual glomeruli (Figures 5B and 5C).53 We next applied MCA to a calcium imaging dataset from putative pyramidal cells in the mouse visual cortex. A visual stimulus of a grating pattern moving across a screen at randomized orientations was presented to test visual acuity.54 Using native ImageJ tools, we manually labeled cells within the imaging series, and MCA’s “Convert to DF/F” function was able to visualize neurons that showed strong increases or decreases in activity during the recording (Figures 5D and 5E). MCA was then able to extract these cellular responses and, when plotted in accordance with the stimulus presented, was able to easily visualize cells that increased activity in response to stimulus onset and those that decreased activity when the stimuli were removed (Figure 5F). Both analyses highlight the versatility of MCA to be applied to widely used experimental model systems and different sensory modalities.Figure 5MCA is viable for multiple model organisms(A) Representative imaging plane for recording odor-evoked responses from local interneurons in the antennal lobe of Drosophila (scale bars, 20 μm). The yellow circles indicate locations of individual glomeruli.(B) Raster plot where every row represents a different glomerulus (N = 16) and responses to ACV stimulation at frame 23. Color indicates ΔF/F values.(C) Average glomeruli response.(D) Representative mouse calcium imaging plane in V1 of the superficial visual cortex (scale bars, 20 μm).(E) Activity map generated from the recording used in (D). Green outline highlights an example cell where cell signal was significantly increasing, while blue outlines highlight cells with significantly decreasing signals.(F) Number of significant decreases (top, blue) or increases (bottom, green) in signal activity among all neurons measured (N = 98). Gray bars indicate when the visual stimulus was presented.(G and H) Representative images of a zebrafish tail: (G) prior to spontaneous movement and (H) during spontaneous movement. Yellow outline indicates the cell being plotted in (I).(I) Calcium signal for the single muscle cell outlined in yellow in (G) and (H). The red arrow denotes the time point shown in (H).
Last, we wanted to demonstrate that MCA is also viable for extracting activity from non-neuronal tissue types. Calcium imaging in muscle cells is a common practice used to understand cellular dynamics caused by genetic disorders, tissue damage, or following regeneration.55^,^56^,^57^,^58^,^59 To demonstrate this, we recorded spontaneous muscle contractions in the zebrafish tail during a 3-min recording. Zebrafish engage in spontaneous bouts of movement even when embedded in agar.6 Using this approach, we were able to manually label cells using native ImageJ functionality and record from muscle cells along the tail using Tg(actc1b:GCaMP5)60 which is expressed in skeletal muscle.61^,^62 We were able to visualize spontaneous calcium flux in skeletal muscle cells (Figures 5G and 5H). Using ImageJ ROI tools, we were able to isolate single muscle cells and record calcium transients (Figure 5I). These data combined provide robust support for the use of MCA in a wide range of functional imaging applications across model organisms and tissue types.
Discussion
Fluorescent imaging strategies have emerged as a fundamental experimental technique for understanding functional dynamics by capturing the activity of cells.63 The utility of calcium imaging has been particularly impactful for studying the brain and neural circuit function. In the brain, many functional imaging strategies often record from hundreds, if not thousands, of neurons, which results in technically complex datasets that require sophisticated computation. Moreover, analyzing calcium imaging data is further complicated due to the diversity of file formats, proprietary software limitations, and the need for programming knowledge.24^,^64 Considering these hurdles, many research groups develop custom software solutions.16^,^65 However, limitations of such custom approaches are that these boutique packages may be challenging for other groups to broadly apply, as they require advanced coding or proprietary software.12^,^13 To address these challenges, we developed the MCA toolkit for ImageJ, a widely used open-source image processing software. Our goal is to provide a streamlined, flexible, and user-friendly tool that enables researchers to efficiently process and analyze functional imaging data.
Our MCA plugin has addressed many challenges posed by other functional imaging analysis solutions and offers a user-friendly, widely applicable, and easily accessible alternative. A major contributor to the increased accessibility of the MCA toolkit is that it is built within ImageJ, which has been an industry-standard image analysis platform for over 30 years17^,^18^,^66 We demonstrate that our plugin has a variety of functionalities applicable to calcium imaging analyses such as motion correction, cell detection, data conversion, annotation, and activity prediction. Many of these methods have been previously developed in ImageJ, yet were not organized to work together in one application intended for functional imaging. Moreover, MCA has the flexibility to leverage all other ImageJ functions and the vast repertoire of plugins available for image analysis.
While there are a variety of established tools for functional imaging analysis, such as CaImAn or Suite2p, these tools require programming knowledge (CaImAn) or can only be applied to functional imaging analyses (Suite2p).12^,^13 These tools, on their own, have demonstrated themselves to be powerful and designed for very specific purposes.2^,^67^,^68^,^69^,^70 We wanted to allow functional imaging analysis to be completed alongside other analytical techniques to reduce the necessity of employing multiple software for each unique experiment. Therefore, completing functional imaging analysis in ImageJ, while having access to other processes in ImageJ, streamlines the analysis of scientific imaging data.
Limitations of the study
A primary goal of MCA was to provide unified software for completing routine analyses. As such, the choice was made to design this program within ImageJ compared to developing it in other languages such as Python or MATLAB. This poses a future challenge, as many analytical techniques are not natively developed using Java, although Java remains one of the most popular programming languages today. Many newer image analysis applications are developed with Python, which sometimes are not readily portable to an ImageJ plugin. However, ImageJ/Fiji have has been addressing this as they continue to expand resources for different development suites within ImageJ, providing methods for designing macros in a variety of languages that can be incorporated with plugins. The ability to easily add or extend functionality in MCA through Java-based methods or ImageJ macro-based methods highlights the ability for MCA to remain a modular and user-friendly application for functional imaging analyses. MCA provides a powerful, user-friendly option for analyzing functional imaging data in ImageJ. However, MCA is designed to primarily focus on single-plane recordings and currently is not readily adaptable to volumetric imaging. In addition, MCA is oriented at providing visual output for nearly all available functions, and generating images for display is inherently computationally expensive. Other software that provides visual output optionally, such as CaImAn or Suite2p, benefits from faster processing and higher throughput of datasets.
Resource availability
Lead contact
Further information and requests for materials used in this manuscript should be directed to and fulfilled by the lead contact, Eric Horstick ([email protected]).
Materials availability
This study did not generate any unique materials or reagents.
Data and code availability
- •All original data were uploaded to Mendeley and can be found at https://doi.org/10.17632/f675cbz84s.2. Previously published, publicly available data used in this manuscript can be found using the accession numbers listed in the key resources table.
- •Source code and documentation for the MCA toolkit can be found at the GitHub repository (https://www.github.com/JohnHageter/Multi-Cell-Analysis) or the Zenodo repository (https://doi.org/10.5281/zenodo.17610802).
- •Any additional information required to re-analyze the data reported in this study is available from the lead contact upon request.
Acknowledgments
We want to thank Kevin Daly, Jeff Mumm, and Sadie Bergeron for their helpful insights during the development of this work. We also thank Curtis Reuden and colleagues for the maintenance and future development of Fiji and ImageJ. This work was supported by 10.13039/100000001National Science Foundation cooperative agreement OIA2242771, 10.13039/100000053National Eye Institute R15EY036226, and National Institute of General Medicine P20GM144230 awarded to E.J.H.; 10.13039/100000002NIH DC-016293, 10.13039/100000154NSF IOS 2114775, and 10.13039/100000181AFOSR DURIP awards FA9550-19-1-0179 and FA9550-20-1-0098 awarded to A. Dacks; and 10.13039/100014885Hussman Foundation grant HIAS18001 and National Science Foundation (NSF) 10.13039/100005714Established Program to Stimulate Competitive Research (EPSCoR) Track-1, Award OIA-2242771 awarded to M.S.B.
Author contributions
E.J.H. and J. Hageter conceived the project and wrote the manuscript. J. Hageter developed software, analyzed data, and performed experiments. J.J. and M.S.B. performed experiments. A. DelGaudio, M.L., B.J., T.R., J. Holcomb, A.F.T., and J.J. analyzed data. M.B., A. Dacks, and E.J.H. acquired funding.
Declaration of interests
The authors declare no competing interests.
STAR★Methods
Key resources table
REAGENT or RESOURCESOURCEIDENTIFIERChemicals, peptides, and recombinant proteinsMS-222 (tricane methanesulfonate)Syndel200–226Low-melting temperature agaroseLonza500841-phenyl 2-thiourea (PTU)SigmaP7629-10GDrosophila extracellular physiological saline (103 mM NaCl, 3 mM KCl, 5 mM TES, 8 mM Trehalose, 10 mM Glucose, 26 mM NaHCO3, 1 mM NaH2PO4, 1.5 mM CaCl2, 4 mM MgCl2)Sigma7647-14-5, 7447-40-7, 7365-44-8, 6138-23-4, 492-62-6, 144-55-8, 7558-80-7,10043-52-4, 7786-30-3.Deposited dataRaw and analyzed dataMendeleyhttps://doi.org/10.17632/f675cbz84s.2Experimental models: Organisms/strainsTL Wildtype ZebrafishZIRCZFIN:ZL86Tg(y279: Gal4)Horstick et al.16ZFIN:ZDB-ALT-151216-33Tg(y256: Gal4)Tabor et al.71ZFIN:ZDB-ALT-151216-14Tg(UAS: nsfb-mCherry)Davison et al.72ZFIN:ZDB-TGCONSTRCT-070314-2Tg(UAS: epNTR-tagRFPt)Tabor et al.73ZFIN:ZDB-TGCONSTRCT-141113-4Tg(elavl3: H2B-GCaMP6f)Dunn et al.74ZFIN:ZDB-TGCONSTRCT-150916-4Dmel\w^1118^FlyBase:FBal0018186Tg(UAS-GCaMP7f/+;R32F10-Gal4/UAS-GCaMP6f)Sizemore, et al.51RRID: BDSC_49725, RRID: BDSC_42747B6.129(Cg)-Cntnap2^tm1Pele^/JThe Jackson LaboratoryRRID:IMSR_JAX:017482Recombinant DNAPlasmid: actc1b:GCaMP5Lo et al.60Addgene 126563pAAV.Syn.GCaMP6s.WPRE.SV40Chen et al.75AddGene# 100843Software and algorithmsMCAThis paper: Githubhttps://github.com/JohnHageter/Multi-Cell-AnalysisFiji/ImageJSchneider et al.17https://imagej.nih.gov/ij/RStudioRStudio Team76https://cran.r-project.org/ScanImagePologruto et al.77https://www.mbfbioscience.com/products/scanimageZEN (black edition)Zeisshttps://www.micro-shop.zeiss.com/en/us/softwarefinder/software-categories/zen-black/MATLABMathWorkshttps://www.mathworks.com/products/matlab.htmlPsychToolBoxPTB Developershttp://psychtoolbox.org/
Experimental model and subject details
Animal husbandry
Zebrafish
All usage of animal and experiments were approved by the West Virginia University Institutional Animal Case and Use Committee. All experiments utilized the Tupfel long-fin wildtype genetic background. All functional imaging experiments took place at or prior to 7 days post fertilization. Larvae were raised at 28.5°C in a 14/10 h light/dark cycle prior to use. Larvae were raised in E3 embryo media buffered with 1M HEPES to a working concentration of 1mM and adjusted to a pH of 7.40 with 1M NaOH. Transgenic lines used were Tg(y279:Gal4), Tg(elavl3:H2B-GCaMP6f), Tg(UAS:nsfb-mCherry), and Tg(y256:Gal4). Experiments were performed prior to sexual differentiation so sex was not considered as a variable. All animals used were deemed healthy by visual inspection.
Drosophila
All fly stocks were raised on a standard cornmeal/agar/yeast medium at 24°C on a 12:12 light/dark cycle at ∼60% humidity. Male and female, 3–5 day old flies were used for recordings. Transgenic lines used were w1118;UAS-GCaMP7f/+;R32F10-Gal4/UAS-GCaMP7f. All animals used were deemed healthy by visual inspection.
Mice and mouse welfare
Cntnap2^−/−^ mice (https://www.jax.org/strain/017482, stock number 017482, The Jackson Laboratory) were bred as heterozygous (HET) pairs, resulting in Cntnap2^+/+^ (wild type, WT), Cntnap2^−/−^ (KO), and Cntnap2^+/−^ (HET) offspring. Cntnap2 KO mice and WT littermate controls of either sex were used beginning at eight weeks of age. Data presented is from a confirmed wildtype animal. Animals were housed in a vivarium with ad libitum access to food and water, on a 12/12 h light/dark cycle. All animal procedures were performed in accordance with the Hussman Institute for Autism animal care committee’s regulations and those of the University of Maryland Baltimore IACUC where recordings were performed. All animals used were deemed healthy by visual inspection.
Method details
MCA development
The MCA plugin was developed to utilize the IJ 1.54f library. MCA was designed in IntelliJ and is built with Maven3 and compiled for Java 8. All UI components were developed using Javax or the abstract widget toolkit (AWT). Motion correction algorithm was based on the “Template_matching” plugin developed for ImageJ and used the OpenCV library for the template matching function.23 Annotation tools such as the “Point grouping” and “Polygon grouping” functions utilized tools available through the toolbar and ROI manager in ImageJ. The Cell Manager UI framework was based on the native ROI Manager in ImageJ. ROI signal was extracted from each ROI using the average pixel value within each ROI for every frame and exported using the “ResultsTable” class available in the IJ 1.54f library. Single peaks were determined using a sliding window method described in.78^,^79^,^80^,^81 This method takes the standard deviation of the window size for every subsequent frame beyond the size of the window and adjusts the window based on an influence factor of the signal set by the user. Then with a set threshold of standard deviation, points falling outside the threshold are considered “1” for a significant increase in signal, or “-1” for a significant decrease in signal, or “0” for no change in signal. Signal data was filtered using a Gaussian smoothing filter described in.82 The model for Cellpose was trained using 117 sum projection images of the zebrafish thalamic region expressing Tg(elavl3:H2B-GCaMP6f) using Cellpose’s built in training method which started by using their pretrained “nuclei” model. Training was completed by Cellpose’s recommended protocol which involves automatically labeling and correcting multiple images.83 We did this for each of the 117 sum projections of the thalamic region. Model iterations we trained for 1000 epochs, weight decay of 0.0001, and a learning rate of 0.1. Previous versions of the H2BGcaMP model are available upon request while the most recent version is installed with MCA and can be found at https://www.github.com/JohnHageter/Multi-Cell-Analysis.
Zebrafish visual calcium imaging
Visual stimulus calcium imaging data was used from Hageter et al. 2023.31 All individuals from the prior publication were reanalyzed. Cellular maps containing Tg(elavl3:H2b-GCaMP6f) and Tg(y279:Gal4) were used for cellular annotation. Cell ROIs were generated using a custom trained Cellpose model (H2BGCaMP), a binary threshold was applied, and segmented using a watershed segmentation algorithm.84 These were then grouped together based on anatomical landmarks into 3 regions in the thalamus. The greater thalamus, the lateral thalamus, or the posterior tuberculum. Cells expressing Tg(y279:Gal4; UAS:nsfb-mCherry) were point labeled. All images had a rolling ball radius of 20 pixels of background subtraction prior to conversion to 32-bit ΔF/F format. Each recording consisted of 5 min of baseline acclimation to the recording environment, followed by a 180 s recording with a 690nm light on for 60 s, light off for 60 s, and light returned for 60 s. Larvae were given 5 min under baseline illumination following the recording to reacclimate to baseline conditions. Images were captured at 1 frame per second and recorded using 940 nm wavelength illumination from a multiphoton microscope (MaiTai, Scientifica). Each fish had two acquisitions which were averaged together prior to exporting. All data was smoothed with a Gaussian filter. Peaks were detected using a lagging window of 30 frames, and a threshold of 3 times the standard deviation of the window for each subsequent timepoint following the width of the window.
Zebrafish acoustic calcium imaging
Acoustic stimulus calcium imaging data was collected for this manuscript. Larvae were housed under normal conditions and raised in 200 μM PTU until 5–6 dpf where they were anesthetized using tricane and embedded in 2% LMP agarose. Larvae were acclimated to the imaging environment for 5 min prior to recording. Larvae were imaged at 1 frame per second on a Scientifica Vivoscope two-photon with a 16× water immersion objective, and Spectra-Physics MaiTai laser tuned to 940nm. Acoustic stimulation was provided using a skinny mini excited 9mm, 1W, 4Ohm (DaytonAudio).85 The auditory stimulation was delivered to the speaker by a 2 × 15W class D audio amplifier board (DaytonAudio). Stimulus was controlled through a custom script written in IDL eventtimer.86 Generated stimulus consisted of incrementally increasing voltage sent through the amplifier to deliver a 300 msec acoustic stimulus with 10 msec of ramp. Stimulus were generated with 1000 samples and consisted of 1000 Hz. Larvae were imaged for two repeats of 5 auditory stimulus separated by 30 s. Cells expressing the Tg(elavl3:H2B-GCaMP6f) were automatically identified and imported into MCA through the Cellpose function. Cells expressing Tg(y256:Gal4,UAS:epNTR-mCherry) were manually labeled using the “Point grouping” function in MCA. All data was smoothed with a Gaussian filter and peaks were detected similar to the visual calcium imaging with a lagging window of 30 frames and a threshold of 3 times the standard deviation of the window.
Fly olfactory calcium imaging
Drosophila calcium imaging was completed on a Scientifica Vivoscope two-photon microscope with a Spectra-Physics MaiTai sapphire laser at 940 nm wavelength. Imaging was conducted on flies expressing GCaMP7f under the control of the R32-GAL4 driver line. Images were acquired using ScanImage acquisition software for MATLAB. Images were acquired at 3.4 Hz. Flies were prepared by anesthetizing on ice and fixed with LED-UV plastic welder (BONDIC, SK8042, NY). ACV was perfused onto the antennae from a 1:100 dilution in distilled water and odor stimuli were delivered as a 1-s puff directed at the antennae using a custom built odor deliver system.87 ROIs were manually drawn with native ImageJ ROI tools to manually define unique glomeruli. These ROIs were synced to MCA and imaging series were converted to ΔF/F format using the “Convert to DF/F” in MCA with a set baseline of 10 frames. Peaking activity was determined using a sliding window of 5 frames and glomeruli with >3 standard deviations of change in signal for at least 3 frames following ACV perfusion were considered significant responses.
Mouse visual calcium imaging
Mouse calcium imaging was completed on a Zeiss LSM-780 microscope tuned to 940 nm with 20× immersion objective using a head fixed wildtype mouse expressing GCaMP6s and 3 different fields of view of the superficial primary visual cortex (V1). Images were acquired using ZEN Black software at a frame rate of 4.2 Hz. Stimulus presented was a randomly displayed set of full-field drifting sinusoidal gratings at 100% contrast, with temporal frequency of 1 Hz, and with a spatial frequency of 0.02 series cycle per degree. The stimulus presented cycled pseudo-randomly through 8 different angular orientations each 45° apart, and the sequence was repeated ten times. Visual stimuli were generated in MATLAB using PsychoPhysicsToolbox, and presented on a gamma-corrected computer monitor (32″ display) placed 20 cm distant from the animal. Visual stimulation was presented for 4 s at a time separated by 4 s of a blank gray screen. Imaging files were imported into ImageJ and cells were manually labeled from a sum projection of the recording series and imported into the ImageJ ROI manager. From the ROI manager, ROIs were synced to the Cell Manager and image stacks were converted to ΔF/F format using a set baseline of 20 frames. Peaking activity was determined from a sliding window of 10 frames and cells with ±3 standard deviations at the timepoint following the sliding window were considered significant increases or decreases in cell activity, respectively.
Zebrafish muscle calcium imaging
Calcium imaging of the zebrafish skeletal muscle was completed using wildtype (TL) zebrafish injected with Tg(actc1b:GCaMP5) plasmid acquired from Addgene. Zebrafish were injected at the single cell stage with 4.6 nL of plasmid at a concentration of 25 ng/L diluted in 1x Evans solution. Zebrafish were raised in normal housing conditions with media replaced daily and sorted on an epifluorescent dissecting microscope at 5 dpf. Zebrafish were anesthetized with 0.1% Tricaine MS-222 for two minutes prior to being mounted laterally in 1% low melting point agarose (LMP). Mounted zebrafish were stored at 28°C for 10 min prior to imaging. Imaging was completed on the same multiphoton microscope described in other zebrafish imaging experiments. Zebrafish were recorded for two 3-min videos at 1 Hz under 690 nm LED illumination with no stimulation provided. Zebrafish were reacclimated to baseline between recordings for 5 min. Recordings were loaded into ImageJ and concatenated in sequence. ROIs were manually drawn around unique muscle cells. We used a baseline period of the first 60 frames of the recording to calculate ΔF/F using MCA’s “Convert stack to DF/F″ function. Peaking activity was determined like previously stated zebrafish imaging using a sliding window of 5 frames and ±3 standard deviations.
Quantification and statistical analysis
Data analysis
All statistical analysis was completed in R using package rstatix.76^,^88 All t-tests are two tailed. Significance was determined based on an alpha value of 0.05. Data presented represents the mean ± standard error of the mean.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Bando Y.Grimm C.Cornejo V.H.Yuste R.Genetic voltage indicators BMC Biol.1720197110.1186/s 12915-019-0682-031514747 PMC 6739974 · doi ↗ · pubmed ↗
- 2Zhang Y.Rózsa M.Liang Y.Bushey D.Wei Z.Zheng J.Reep D.Broussard G.J.Tsang A.Tsegaye G.Fast and sensitive G Ca MP calcium indicators for imaging neural populations Nature 615202388489110.1038/s 41586-023-05828-936922596 PMC 10060165 · doi ↗ · pubmed ↗
- 3Yang Y.Liu N.He Y.Liu Y.Ge L.Zou L.Song S.Xiong W.Liu X.Improved calcium sensor G Ca MP-X overcomes the calcium channel perturbations induced by the calmodulin in G Ca MP Nat. Commun.92018150410.1038/s 41467-018-03719-629666364 PMC 5904127 · doi ↗ · pubmed ↗
- 4Aggarwal A.Liu R.Chen Y.Ralowicz A.J.Bergerson S.J.Tomaska F.Mohar B.Hanson T.L.Hasseman J.P.Reep D.Glutamate indicators with improved activation kinetics and localization for imaging synaptic transmission Nat. Methods 20202392593410.1038/s 41592-023-01863-637142767 PMC 10250197 · doi ↗ · pubmed ↗
- 5Marvin J.S.Shimoda Y.Magloire V.Leite M.Kawashima T.Jensen T.P.Kolb I.Knott E.L.Novak O.Podgorski K.A genetically encoded fluorescent sensor for in vivo imaging of GABA Nat. Methods 16201976377010.1038/s 41592-019-0471-231308547 · doi ↗ · pubmed ↗
- 6Mu Y.Bennett D.V.Rubinov M.Narayan S.Yang C.-T.Tanimoto M.Mensh B.D.Looger L.L.Ahrens M.B.Glia Accumulate Evidence that Actions Are Futile and Suppress Unsuccessful Behavior Cell 17820192743.e 1910.1016/j.cell.2019.05.05031230713 · doi ↗ · pubmed ↗
- 7de Melo Reis R.A.Freitas H.R.de Mello F.G.Cell Calcium Imaging as a Reliable Method to Study Neuron–Glial Circuits Front. Neurosci.14202056936110.3389/fnins.2020.569361 PMC 756617533122991 · doi ↗ · pubmed ↗
- 8Chen W.Natan R.G.Yang Y.Chou S.-W.Zhang Q.Isacoff E.Y.Ji N.In vivo volumetric imaging of calcium and glutamate activity at synapses with high spatiotemporal resolution Nat. Commun.122021663010.1038/s 41467-021-26965-734785691 PMC 8595604 · doi ↗ · pubmed ↗
