1 Introduction

The calcium (Ca2+) ion is a ubiquitous second messenger that impacts nearly all aspects of cellular functioning, by binding and modulating thousands of proteins in the cell. This ion has a wide range of physiological functions such as muscle contraction, neurogenesis, oxidative stress, and the release of neurotransmitters and gliotransmitters from neurons and astrocytes [1]. Ca2+ functions are achieved through the Ca2+-mediated regulation of enzymatic activity, ion pumps or channels, and other components of the cytoskeleton [2]. A universal mechanism for Ca2+ signaling is the release of this ion from the intracellular stores [3], such as the endoplasmic reticulum (ER) and the mitochondria. This mechanism is usually triggered by the activation of a G-protein coupled receptor, primarily the Gq/11 subtype which leads to the activation of phospholipase C (PLC) cleaving the phosphatidylinositol 4,5 bisphosphate (PIP2) into 1,4,5-inositol triphosphate (IP3) and diacylglycerol (DAG). IP3 then binds to the IP3 receptor (IP3R) in the ER allowing the Ca2+ to diffuse from the ER to the cytosol [4]. Conversely, Ca2+ is expelled through transporters and pumps found in the endoplasmic reticulum (ER) or cytoplasmic membrane, which aids in restoring the basal level of free Ca2+ in the cytoplasm. In a healthy cell, these levels typically remain within the low nanomolar range.

Astrocytes are a glial cell type in the central nervous system (CNS) that play an important role in brain homeostasis by maintaining the extracellular ionic environment, through the control of extracellular K+ levels, the levels of neurotransmitters in the synapses, and the “feeding” of neurons through the astrocyte–neuron lactate shuttle system [5]. Moreover, astrocytes can modulate the vascular function and neuronal synaptic transmission and plasticity by sensing and responding to environmental signals, through increases in the intracellular concentration of Ca2+ ([Ca2+]i) with specific spatial and temporal properties that can be used as a readout of astrocytic function [6]. Thus, although astrocytes do not carry nerve impulses since they cannot generate action potentials, they are considered excitable cells, mainly due to variations in their [Ca2+]i [7]. The astrocytic [Ca2+]i change leads to the release of gliotransmitters that can modulate synaptic function, generating a bidirectional neuron-astrocyte communication within the synapses [1, 8]. Such properties make astrocytes not only able to modulate synaptic transmission but essential for it [9, 10]. The study of Ca2+ signaling in astrocytes sheds light on cell physiology and its response to certain conditions (i.e., drug testing). However, astrocytes display a complex range of Ca2+ signaling within the cell itself and/or across astrocytic networks. Decrypting the meaning of these signals has presented a major challenge and new tools are needed [2].

Studies on Ca2+ signaling are mostly centered on fluorescence imaging approaches, by using Ca2+ sensitive indicators, and quantifying concentration shifts over some time at a visually based delimitation of a region of interest (ROI), usually, comprising a single cell [11]. Alternatives to the visually based ROI definition have been proposed [12, 13]. Such methods move away from a single-cell intracellular Ca2+ signal approach to a Ca2+ wave-based study, aiming for inter-astrocyte connection and causality. Indeed, ROI-based analysis is still the prevalent method while studying Ca2+ imaging in astrocytes. Astrocytic Ca2+ signaling studies using ROIs are, in many cases, performed with minimal to no computer assistance which is time-consuming and prone to inter-subject variability and bias, such as video drift. Therefore, it is important to develop novel computational approaches to automate and accelerate the study of Ca2+ signaling with minimal human error.

Here, we describe a new tool named SIGAA—signaling automated analysis—that consists of a MATLAB script that performs a drift correction of the recorded Ca2+ imaging videos with a template matching algorithm followed by astrocyte identification using ROIs through morphological reconstruction techniques. Even though some tools are already developed, many of them if not all are tailored for single wavelength dyes [14,15,16], and to the best of our knowledge this is the first tool of Ca2+ imaging with a ratiometric dye in mind. In this study, only FURA-2-acetoxymethyl ester (FURA-2 AM) was used but any other ratiometric dyes can be integrated by this script. SIGAA generates intracellular Ca2+ evolution functions for all the identified ROIs, detects the occurrence of the Ca2+ transients, the Ca2+ transients amplitude, as well as a set of features calculated for each signal, such as slope, duration, rise, and decay.

The Ca2+ imaging videos were recorded from primary cultures of astrocytes incubated with the ratiometric Ca2+ fluorophore, FURA-2 AM, to measure the variation of [Ca2+]i over time. FURA-2 AM [17] is a high-affinity Ca2+ selective fluorescent indicator that is rapidly metabolized, by cytoplasmic esterase, to the active dye FURA-2 (Kd = 145 nM), whose excitation spectrum depends on [Ca2+]i since FURA-2 has an emission peak at 505 nm and changes its excitation peak from 340 nm (when it is bound to Ca2+) to 380 nm (when it is free) in response to Ca2+ binding. The intracellular Ca2+ evolution signals were generated from two videos that were obtained while performing the Ca2+ imaging recording, and each video was captured for a single wavelength corresponding to the 340 nm or the 380 nm wavelength excitation, respectively. Therefore, the 340/380 nm ratio gives a representation of the evolution of intracellular Ca2+. The Ca2+ imaging videos were obtained using specific software, the MetaFluor® Fluorescence Ratio Imaging Software which is not prepared to cope with artificial cell movement that occurs due to human handling of the laboratory setup throughout drug administration to the cells during the experimental procedure. To overcome this issue, the correction of cell position is essential for the precise Ca2+ concentration function extraction, which by itself presents a time-consuming task and error-prone procedure.

With the analytic tool SIGAA, we are proposing a method to accelerate ROI-based fluorescent imaging analysis, allowing for quicker results extraction and conclusions over astrocyte communication characteristics. By using as input the laboratory-recorded experiment videos for the 340 nm and 380 nm wavelengths, SIGAA can automate video drift correction, minimize artificial cell movement, automate the identification of the astrocytes, and generate the respective Ca2+ signaling allowing to systematize the extraction of the relevant parameters to characterize astrocyte function. This is achieved with a set of template matching algorithms for drift correction together with morphological reconstruction for cell identification and segmentation.

In this paper, we describe our results as follows. We started Sect. 2 by describing the procedure for the acquisition of astrocyte ROI-based Ca2+ fluorescent imaging, and the consequent correction of cell movement due to human handling, as one of the main motivations for SIGAA system implementation. In Sect. 3, the proposed system implementation is presented, as well as the corresponding methods used to overcome the concern with video drift correction and to achieve astrocyte cell automatic identification. In Sect. 4, results and discussion are presented, including generated function comparisons for SIGAA generation vs. previously used manual procedure as well as runtime performance benchmarks. Finally, Sect.  5 concludes the paper and also gives directions for future work.

The software is freely available at https://github.com/ISEL-DEETC/SIGAA, where detailed documentation and example applications can be found.

2 Experimental setup and data extraction

2.1 Ca2+ Imaging setup

Primary astrocyte cultures were prepared as previously described [18]. The cells were positioned on an inverted epifluorescent optics microscope (Axiovert 135TV, Zeiss, Germany) and image pairs obtained every 250 ms by exciting the preparations at 340 and 380 nm were recorded to obtain the 340/380 ratio images. Excitation wavelengths were changed through a high-speed wavelength switcher, Lambda DG-4 (Sutter Instrument, Novato, CA), and the emission wavelength was set to 510 nm. Image data were recorded with a cooled CCD camera (Photometrics CoolSNAP fx) and processed using the software MetaFluor (Universal Imaging, West Chester, PA). Throughout all experiments, cells were kept at 36ºC with 5% CO2 and visualized with a 40 × oil-immersion objective (Zeiss).

2.2 Astrocyte ROI-based fluorescent ratio imaging

The resulting 340 and 380 nm recorded images are used as input to a specific imaging software (MetaFluor) that calculates the 340/380 ratio and can generate functions of Ca2+ concentration evolution over time, based on the images' brightness levels variation. From the acquired sequence of images, before SIGAA, there was a manual selection of a set of ROIs from the cells with interest to study. From these ROIs, it is possible to extract the resulting Ca2+ functions which are then studied to allow for conclusions over specific cell characteristics, being the baseline, the number of transients, the transient slopes, and amplitudes of the main Ca2+ features usually evaluated. The main issue with the previously described procedure is the induction of minimal vibration in the laboratory setup that will result in an artificial frame-to-frame movement over the experiment-recorded frames/videos. Such movement is unavoidable since it is caused by human handling of the laboratory setup and is mostly raised during drug incubations. Thus, this minimal vibration of the system results in a position displacement between the manually defined ROI (that is always in the same place) and the astrocyte that is being studied (that will change location), during function generating and running on the software that processes the acquired images. This will lead to a considerable error in the output Ca2+ functions. Consequently, to overcome this issue, the function extraction procedure must be stopped on each displacement, to redefine the new ROI over the new cell position, and then resume. For optimal function, this manual adjusting has to be performed on every frame change, over multiple cells, resulting in an iterative process that will represent the major time spent for the study, thus facilitating the automation of procedures that would normally require hours while having minimal substantive impact on the study's conclusions and is prone to errors.

Moreover, once all Ca2+ functions are generated, these are often studied with the extraction of relevant parameters, with little computer assistance, which is also a time-consuming step that is prone to errors.

2.3 Proposed system and methods

The system that we are now proposing (Fig. 1) follows a three-function block structure. The first block of SIGAA is responsible for computing the 340/380 ratio values, using both input experimental frames/videos, and for performing automatic video drift correction from the input recorded videos of an experiment. This block is achieved with a two-step template matching algorithm using normalized cross-correlation. The second block takes the videos with drift correction from block one and applies morphological reconstruction techniques to automatically detect and segment detectable astrocytes that were collected as defined ROIs. The third block is responsible for preprocessing Ca2+ functions, generating and extracting a set of numeric parameters, such as function baseline identification, duration of the transient, and slopes, which are relevant for cellular experimental conclusions.

Fig. 1
figure 1

SIGAA’s Block Structure. SIGAA follows a three-function block structure. The first block computes the 340/380 ratio values using both input laboratory videos and performs automatic video drift correction. The second block automatically detects and segments astrocytes cells from the drift correction video and generates Ca2+ evolution functions over time. The third block is responsible for processing Ca2+ functions previously generated and extracting a set of numeric parameters

2.4 Block 1: ratio values and input video drift correction

SIGAA’s first block considers the laboratory-recorded 340 nm and 380 nm videos of astrocyte response to a specific test substance as input and is responsible for computing 340/380 ratio values and performing video drift correction.

Since Ca2+ intracellular levels are represented by the 340/380 ratio values, the first block starts by dividing 340 nm frames by 380 nm frames, which will be used by the second block to generate Ca2+ functions. For the second part of the first block, the video drift correction will be made since the input videos, due to artificial movement previously described, inherently pose two obstacles:

  1. (1)

    Repeated vibrations to the camera focus throughout the recording procedure can move some astrocytes out of the same video frames. Such cells are not valid for the study, as it is not possible to extract a valid function for these cases, and thus, should not be considered for Ca2+ function extraction;

  2. (2)

    Other astrocytes are shown in the visual field during the whole duration of the recorded videos, but still, less significant vibrations can displace the cells away from the initial ROI, compromising brightness value extraction inside the ROI for the cell Ca2+ function extraction.

The SIGAA system tackles both issues with a two-step template matching algorithm, based on normalized cross-correlation. Template matching [19] is a high-level machine vision method that distinguishes the parts on an image that match a predefined layout. Cross-correlation represents, by definition, one of such methods as a measure of similarity between two different signals (images in this case), by sliding the first shorter template signal over the tested signal [20, 21]. The resulting coefficients will define a measure of the probability of the template signal to be found on a specific position on the second signal. Consider in Eq. 1 the cross-correlation coefficients \(r(k)\) for signals \(x(i)\) and \(y(i)\) with \(i=\mathrm{0,1},2\dots N-1\), at position \(k\):

$$r\left(k\right)=\frac{\sum_{i}\left[\left(x\left(i\right)-mx\right)\left(y\left(i-k\right)-my\right)\right]}{\sqrt{{\Sigma }_{i}{\left(x\left(i\right)-mx\right)}^{2}}\sqrt{{\Sigma }_{i}{\left(y\left(i-k\right)-my\right)}^{2}}} ,$$
(1)

where \(mx\) and \(my\) are the corresponding means for signals \(x(i)\) and \(y(i)\). Function normalization is used meaning that \(-1\le r\left(k\right)\le 1\). For \(r\left(k\right)=1\), cross-correlation represents the maximum similarity between the template and the tested signal. When \(\left(k\right)=0\), no similarities are found between the two signals. Negative values express symmetric similarity (negative image). Thus, the first step of the implemented algorithm determines the relevant window for the region that only contains ROIs that are present during the whole video’s duration. The second step uses this resulting window to perform video drift correction and output a new video with minimized inter-frame cell movement.

Since the 340 nm and 380 nm videos result from one recording of a laboratory experiment over two different wavelengths, both videos will have the same artificial movement offset values, meaning that video drift correction will only be generated for one wavelength of the two (in SIGAA’s approach only for the 380 nm version) and the resulting offset values are then applied to the other wavelength video. Considering the naturally superior image contrast at 380 nm, we decided to utilize the 380 nm video frames in both the stabilizing video algorithm and the automated cell identification process, instead of relying on the 340/380 ratio. Importantly, both the 340 nm and 380 nm video frames share identical dimensions and pixel counts. Consequently, the cell identified at 380 nm maintains the same coordinates when mapped onto the 340 nm video frame, thereby facilitating the automatic calculation of the ratio. The ratio is computed as the initial step in the analysis pipeline, as stabilizing the 380 nm video inherently stabilizes the ratio video simultaneously. This approach ensures that the spatial relationship between the dimensions of the 380 nm video and the ratio video remains intact throughout the processing steps.

Thus, SIGAA first block uses the first frame of the video as a template versus each frame using normalized cross-correlation as in Eq. 1. This step will output a smaller image that will represent the significant window of the experimental acquired video; hence, this image will contain only the astrocytes that do not move out of the video focus during laboratory recording. Once the significant window is found, it will become the new template image for the second step of Eq. 1, again, versus the entire video. This second run will output inter-frame movement offset values that are then applied to both 340 nm and 380 nm videos to produce a new set of frames that, when aggregated back in order, result in new drift correction versions of the laboratory videos for the relevant window.

2.5 Block 2: laboratory video analysis and function extraction

The second block is responsible for analyzing the output drift correction videos from block one and generating Ca2+ functions for further analysis. Thus, Block 2 detects and segments every visible astrocyte, with no human interaction. These segmented astrocytes are the ROI for brightness probing and function extraction. To achieve this segmentation, the system applies morphological reconstruction for the first frame of the input drift correction video.

Morphological reconstruction [21,22,23] is applied between two images and a structuring element, which defines connectivity during the reconstruction process. It allows building an image from small components removing non-desired features while maintaining the initial shape of the present objects. The marker image is the starting point for the transformation. The mask image limits the transformation inside its contours. The basic reconstruction procedure \(R(F)\), starting on marker image \(F(k)\), with \(\mathrm{k}=1\) is described on Eq. 2:

$$R\left(F\right)= \left(F\left(k\right)\oplus B\right)\cap G, $$
(2)

where \(k\) represents the number of dilation necessary for F with \(B\), the structuring element until the reconstruction matches \(G\)’s limits. Dilation is a basic morphological operation that expands F borders based on the structuring element \(B\). SIGAA applies a speed-up version of the previous iterative algorithm, proposed and fully detailed in Vincent, 1993 [25], to detect and segment detectable astrocytes on a given image.

Astrocyte morphology can be lost after the ROI definition process, cell detection, and segmentation; therefore, morphological reconstruction cannot be performed using the ratio values between the two input experimental videos. This means that cell detection and segmentation can only be performed either on 340 nm or 380 nm input video. Like video drift correction in block one, detection and segmentation need to be performed only on one of the input videos, since cell position is the same for both, as justified in Sect. 2.4. In our case, Block 2 uses a 380 nm drift correction video to perform astrocyte detection and segmentation.

Considering that astrocytes’ nuclei are mainly of rounded shape and because the accuracy of the reconstruction procedure depends on the similarity between the object shapes and the structuring element [22, 24] SIGAA uses an almost-circular structuring element for the ROI reconstruction procedure. During system execution, after cell automated identification and segmentation, these ROIs are presented to the system operator for manual correction (if needed) and/or manual addition of new unidentified ROI by the system. This is the only (eventual) human interaction during runtime and helps avoid false positives for automatic cell detection. Once all automatic (and manual) defined ROIs are approved by human interaction, SIGAA will run defined regions through the stabilized obtained 340/380 ratio video and extract Ca2+ evolution functions over time based on the mean pixel-brightness value attained (Fig. 2). In this study, we explored the activation of the cannabinoid type 1 receptor (CB1R) in astrocytes. The activation of CB1R in astrocytes triggers intracellular Ca2+ transients, which play a role in modulating synaptic function [26]. To achieve CB1R activation, we used Arachidonyl-2'-chloroethylamide (ACEA), a selective CB1R agonist. ACEA specifically targets CB1R activation without affecting other cannabinoid receptors or non-cannabinoid receptors.

Fig. 2
figure 2

Ca2+ Cell detection and function extraction performed using SIGAA. The first 300 s corresponds to the baseline. From 1200 to 2400 s, the function corresponds to the detection of Ca2+ by the incubation of a specific drug that elicits Ca2+ transients in astrocytes (a specific Cannabinoid type 1 receptor (CB1R) agonist, ACEA). From 2400 s to the end, the function corresponds to incubation of ionomycin, a Ca2+ ionophore whose Ca2+ rise effect in cells is linked to their viability

To this end, the baseline was established in the first five minutes of the experiment, and after 1200 s (20 min) ACEA was added and Ca2+ transients were detected. However, the time limits of the second segment can be edited directly in the MATLAB script. To confirm cell viability, at 2400 s (40 min), ionomycin salt (2 µM) was added to the medium, in which viable cells had a considerable increase in their intracellular Ca2+ [27]. These functions will constitute block two’s output.

2.6 Block 3: feature extraction

The third block takes as input the previously generated Ca2+ functions (second block output), and extracts a set of numeric features that are relevant for the specific experiment’s conclusions on astrocyte Ca2+ signaling characteristics: function baseline; the number of transients; the transient amplitude, and slopes; the transients rise/decay time; and inter-transient duration. All of these are extracted according to the defined features previously established by the user such as the basal end-time estimation, and minimum and maximum transient duration (Table 1).

Table 1 Description of the script setup parameters

However, before attempting to detect transients and extract features, it is important to understand the structure of the Ca2+ functions. Ca2+ concentration is measured by the ion Ca2+ ratio bound to fluorescent markers (340 nm) with the measure of the same markers that were not bound to Ca2+ (380 nm). Generated functions are divisible in three different segments (Fig. 2): a first segment for which Ca2+ concentration is roughly constant when the astrocyte is at resting state; a second segment caused by the drug administration phase which leads to substantial basal Ca2+ level variation and transients occurrence, with a stable increase corresponding to the function baseline; and the third segment with an accentuated increase of Ca2+ concentration, caused by the ionomycin salt. This last segment is not featured in the subsequent data analysis and can be cut off by incorporating it into the second segment. Feature extraction performed by SIGAA’s Block 3 focuses on the second segment of the Ca2+ functions. The time boundaries of these segments are manually defined by the research team since they depend on the substance administration signature.

In the event of an increasing baseline, baseline functions are estimated by Lagrange polynomial interpolation [28], for the input Ca2+ functions over the first and second segments. The polynomial order is defined empirically and is manually adjustable if needed. This baseline function is then subtracted from the Ca2+ function (Fig. 3), allowing to better distinguish function transients after substance administration. This feature can be switched on or off according to the user (Table 1).

Fig. 3
figure 3

Baseline compensation and detected function transients. Cell 1 (blue) represents the Ca2+ function derived from SIGAA with baseline compensation, contrasting with the raw Ca2+ function in Fig. 2. Correspondent transient threshold (red) and detected transients (orange). Correspondent 6th order polynomial baseline estimated function (yellow)

After baseline subtraction, SIGAA’s third block can apply noise reduction. If the user feels that the use of a filter interferes with the signal in a substantial manner, they can choose to switch off this part of the block (Table 1). The noise reduction is performed by using a moving average filter described by Eq. 3:

$$r\left[n\right]=\frac{1}{M+1}\sum_{m=-M/2}^{M/2}s\left[n-m\right], $$
(3)

where \(r\left[n\right]\) are the output signal and \(s\left[n\right]\) the input signal (in this case, the Ca2+ function subtracted by the baseline function), and \(M=4\) is the filter order.

Function transients represent the astrocyte’s response to the administrated substance during laboratory testing and are distinguishable as higher amplitude peaks on the Ca2+ function signal, after baseline subtraction and noise reduction steps. Transients are very important for the Ca2+ signaling study of cells; hence, SIGAA’s final output is a set of numerical features based on these function peaks. Transient identification is automated by the system’s third block using Eq. 4:

$$th=\overline{r }+\mathrm{margin}*{\sigma }_{r},$$
(4)

as a sequence of adjacent function points with a value above a threshold (\(th\)), defined as the function’s mean (\(\overline{r }\)) estimated during the second segment, added by a factor \(\mathrm{margin}\) of its standard deviation (\({\sigma }_{r}\)) for the same segment.

Once all cells (Fig. 4), and subsequently all transients are identified, the system will estimate a set of numeric features to allow for experiment conclusions, being these features outputted as SIGAA’s result in an Excel spreadsheet (.xls format). There are seven spreadsheets with Ca2+ transient information: (1) transient amplitude: amplitude of each transient for the selected cells (Fig. 4); (2) nonzero amplitudes: transients amplitudes of all responding cells; (3) transient slopes: Rise and decay slopes of each transient; (4) duration of the transient rise and decay: Rise and decay duration of each transient; (5) time between transients: time between consecutive transients; (6) transient starting time: starting time of each transient; and (7) transient duration: duration of each transient. Beyond this, an additional sheet is included with the 5-min slope of the Ca2+ function per cell through the whole experiment. As an example, the transient amplitude spreadsheet is shown in Fig. 4 (bottom panel), where columns 1 to n correspond to the n-selected astrocytes. The first row corresponds to the transient frequency of occurrence, and the remaining rows correspond to the transient amplitudes, respectively. Moreover, the final column of the amplitude spreadsheet contains system setup parameters, namely: (1) margin, (2) on/off baseline compensation, (3) start time, (4) minimum transient duration, (5) maximum transient duration, and (6) baseline estimation polynomial order. In the other spreadsheets, similarly to the first one, each column corresponds to the identified astrocytes, and the parameters of each astrocyte are presented in the following rows.

Fig. 4
figure 4

Overview and design principles of SIGAA. In laboratory videos captured at wavelengths of 340 nm and 380 nm (a), we employ an automated video stabilization process to identify potential cells of interest. Subsequently, we extract, process, and analyze the functionality of calcium ions (Ca2+) (c) from the identified potential cells (b). In the lower section of the figure (d), we present a transient amplitude spreadsheet. The columns in this spreadsheet, numbered from 1 to n, correspond to the n-selected astrocytes. The first row, labeled as “Freq,” represents the frequency of transient occurrences per minute. Subsequent rows contain amplitude data for these transients. Additionally, the penultimate column in the amplitude spreadsheet contains essential system setup parameters, including (1) margin; (2) on/off baseline compensation; (3) start time; (4) minimum transient duration; (5) maximum transient duration; and (6) baseline estimation polynomial order. The nomenclature for these parameters is indicated in the final column

Overall, Ca2+ function extraction can be fully automated in a few minutes, for multiple cells. As an example, Fig. 4 represents an output spreadsheet containing the transient amplitudes. In this experiment, 10 astrocytes were studied, and the first row displays the transient frequency of occurrence. Two transients were identified for the second, fourth, and tenth cell. The fifth cell had five transients, and the seventh and ninth cell had three transients each. However, no functional transients were identified in the first, sixth, and eighth cells, which can suggest that these cells may not react to the drug tested.

3 Results and discussion

In this section, we discuss the obtained results while using SIGAA, to assist in astrocyte ROI-based fluorescent imaging recorded videos. The following tests were performed on a setup computer, with 6 CPU cores running at 3.2 GHz, 8 GB RAM, and a 4 GB RAM GPU.

3.1 Automated cell detection

SIGAA automates cell detection using morphological reconstruction techniques from the experimental recorded frames/video. This means that, ideally, by using SIGAA the researcher no longer needs to manually define ROI for every detectable cell.

For SIGAA, we have opted for Luc Vincent's morphological reconstruction [25] as the method of ROI detection. This preference is grounded in its distinct advantages, particularly in the context of cell morphology analysis. Luc Vincent's morphological reconstruction is specifically tailored to preserve the precise shape and size of objects within an image, a crucial factor in the analysis of cell morphology. This preservation is vital for maintaining the integrity of essential cellular structures like membranes and nuclei, ensuring accurate results. In contrast, the Hough Transform and the Watershed Transform may not consistently deliver the same level of fidelity in preserving these features. Furthermore, this method is suitable for ensuring connectivity between adjacent regions of interest, a fundamental requirement for the accurate segmentation of cells and their substructures. This connectivity is not always guaranteed with the Hough Transform [29] or the Watershed Transform [30], particularly when dealing with touching or overlapping cells. Luc Vincent's morphological reconstruction further demonstrates its versatility by effectively handling images with varying intensity levels, a common occurrence in cell imaging. Its adaptability to different gray-level gradients within cells makes it well suited for a wide spectrum of cell morphology analysis scenarios.

As previously mentioned, the similarity between the detectable object and the structuring element is important for correct segmentation. These parameters were defined empirically, for this test, and are fully adjustable, as a system setup. Correct object segmentation is a complex task, due to the low contrast and resolution of the images. Morphological reconstruction works well in removing image noise and segmenting objects correctly; however, cell shape variability may hamper this task. Since astrocytes can be round-shaped, hexagonal, or elongated-shaped cells, morphological reconstruction may be harder to achieve. Nevertheless, the structuring element for the reconstruction is of utmost importance and should be adapted for better cell segmentation. Segmented astrocytes are validated by the system operator who can manually ignore one cell, or more, from the study. New cells can also be added to the study via manual ROI definition at this stage. Figure 4 shows 10 automatically detected cells, using SIGAA, and considers an almost-circular shape structuring element with a 0.85 circular shape threshold and a 7-pixel radius. The system generated Ca2+ functions for all these cells with no need for manual ROI adjustment on every cell movement that occurred during the video. Additionally, in Fig. 5 we show the Ca2+ function generated using both the script SIGAA (Cell 1, blue) with drift correction and ROI identification and the previous manual procedure (MetaFluor®, Cell2, red), including manual drift correction and manual ROI identification, and a similar profile can be observed, thus demonstrating the reliability of SIGAA.

Fig. 5
figure 5

Cell detection and Ca2+ function generation. The blue line represents the Ca2+ function generated using SIGAA of Cell 1, while the red line represents the same cell Ca2+ function generated using the previous manual procedure (MetaFluor®)

3.2 Function form

The following test verifies if SIGAA can generate the same function form for a single cell when compared to the manually produced using MetaFluor®. Figure 5 shows two functions extracted through the manually produced using MetaFluor® (red line) and the SIGAA system (blue line). When compared, both the manual and the automated functions follow generically the same pattern. The slight differences observed arise from the differences in the ROI shape obtained by ROI hand-made drawn or by the SIGAA’s almost-circular automat drawn. Around the 1200-s time mark, a difference in function form is visible as an artificial function transient on the manually generated function (red line), created by a human error by adjusting the ROI to the new cell’s position, between video frames. SIGAA does not produce this error by performing automatic video drift correction before function extraction.

3.3 Time performance benchmarks

To obtain benchmark runtime execution of automated Ca2+ function extraction performance two different experiments videos were analyzed (Fig. 6A and B). The extraction is performed cell by cell with 50-min long videos.

Fig. 6
figure 6

Time performance benchmark (A) Frame 1 of video of experiment 1 with 7 cells automatically detected. (B) The frame of the video of experiment 2 with 7 astrocytes automatically detected. (C) Runtime for Ca2+ function extraction experiments 1 and 2. (D) Runtime of Ca2+ function extraction for each cell for video experiments 1 and 2

With SIGAA, the 340/380 estimation ratio takes 36.36 s and 42.47 s (Fig. 6C) for the first and second video experiments, respectively. Results show that with SIGAA, video drift correction takes less than five minutes (Fig. 6C), when compared to what would be an hour-long procedure if manual ROI cell adjustment was accomplished, as per the research team’s feedback. Furthermore, this procedure is only performed once by the system for every new experiment execution with SIGAA, even if other cells are studied on a second run. This procedure takes 241.96 s and 259.73 s (Fig. 6C) for the first and second video experiments, respectively.

The results for the runtime of Ca2+ function extraction indicate that (Fig. 6D), for each cell, it will take around 7 s for the first video and 8 s for the second video, being this value depending on the duration of each video. This procedure takes, for the 7 cells, 38.61 s and 48.38 s for the first and second video experiments, respectively (Fig. 6C).

4 Conclusions

In this work, we propose a MATLAB tool for speedup analysis for ROI-based fluorescent ratio imaging, named SIGAA—signaling automated analysis. SIGAA can perform automatic laboratory-recorded video drift correction followed by cell identification (ROI) and intracellular Ca2+ concentration evolution functions extraction and analysis. The proposed method is based on a template matching algorithm for video drift correction, using zero normalized cross-correlation, followed by morphological reconstruction operations for astrocyte (ROI) identification and segmentation, and signal processing tools for functional analysis.

Benchmark tests show that function form is preserved by SIGAA’s signal extraction, after automated drift correction and astrocyte identification, when compared with the previously used manual motion correction and function extraction procedure. SIGAA facilitates the automation of procedures that would normally require hours while having minimal substantive impact on the study's conclusions, as benchmark tests show. Video drift correction methods such as Spatial [31] drift correction and Fast4Dreg[32] are already in place. Furthermore, while there are available Ca2+ imaging analysis tools, the majority of them are primarily tailored for event-based analysis [33] and may not be suitable for ratiometric Ca2+ indicators.

Since SIGAA performs pixel-brightness analysis to define ROI, it is not restricted to Ca2+ signaling testing in astrocytes alone and it can also be used with other cell types such as neurons or microglia [28, 29]. Indeed, this script was already used to unveil the dual influence of adenosine receptors in neuronal cultures Ca2+ levels [36], and to evaluate the Ca2+ concentration changes observed in astrocytes prepared from ALS SOD1 mice [37]. SIGAA can also be used for automated quantification of transient signals obtained with other fluorescent indicators, not being restricted to FURA-2 AM or Ca2+-sensitive fluorescent dyes such as Indo-1 or FURA-2 AM.

In summary, we herein describe in detail and validate an automated method to be used whenever transient light emission-based signals are to be analyzed by living cells. Further improvements on the SIGAA script should focus on a new system block implementation, able to perform cell classification, based on Ca2+ signaling patterns observed. Such classification will allow a better understanding of cell characteristics and, in the case of astrocytes, which likely differ in Ca2+ signaling properties across astrocytic and neuronal networks, will shed further insight into astrocyte function and their relations with different neuronal populations. Such implementation should be possible via deep learning methods if a reasonable dataset is available and labeled. In sum, what SIGAA brings to the table is its unique combination of features. To the best of our knowledge, it stands as the first Ca2+ analysis tool for ratiometric fluorometric indicators that seamlessly integrates video drift correction, automated ROI detection, and feature extraction into a single, comprehensive package.