Spiky: An ImageJ Plugin for Data Analysis of Functional Cardiac and Cardiomyocyte Studies

Introduction and objective: Nowadays, investigations of heart physiology and pathophysiology rely more and more upon image analysis, whether for the detection and characterization of events in single cells or for the mapping of events and their characteristics across an entire tissue. These investigations require extensive skills in image analysis and/or expensive software, and their reproducibility may be a concern. Our objective was to build a robust, reliable and open-source software tool to quantify excitation–contraction related experimental data at multiple scales, from single isolated cells to the whole heart. Methods and results: A free and open-source ImageJ plugin, Spiky, was developed to detect and analyze peaks in experimental data streams. It allows rapid and easy analysis of action potentials, intracellular calcium transient and contraction data from cardiac research experiments. As shown in the provided examples, both classical bi-dimensional data (XT signals) and video data obtained from confocal microscopy and optical mapping experiments (XYT signals) can be analyzed. Spiky was written in ImageJ Macro Language and JAVA, and works under Windows, Mac and Linux operating systems. Conclusion: Spiky provides a complete working interface to process and analyze cardiac physiology research data.


Introduction
Recording of action potentials, intracellular calcium transients and contraction evoked by electrical stimulation in cardiomyocytes and cardiac tissue are key steps in physiological and pathological studies of the heart. Experimental exploration of the cardiac system now tends to focus on imaging techniques: action potentials are more and more often recorded by optical mapping techniques [1], intracellular calcium by confocal microscopy, and contraction by video microscopy of isolated cardiomyocytes [2,3] or echocardiography of the whole heart [4]. These new methods provide spatially resolved information which require a new analysis paradigm. Added to this are novel optogenetic methods which explore the behavior of small numbers of targeted cells within tissues [5], requiring spatially resolved data acquisition and analysis.
At the same time, the additional spatial information given by imaging techniques leads to an increased complexity of data analysis. Traditional graphics software cannot perform such analysis. The extraction of raw image data and its analysis requires either the expertise of an image analyst with programming skills or several steps of conversion to make it usable by a biologist, which can be particularly time consuming. Hence, the use of modern techniques, such as optical mapping, is often hampered by the absence of specialists in image analysis and programmers in cardiac laboratories. Therefore, it is important to simplify the analysis methods to make them accessible to more laboratories and to improve reproducibility by bridging the gap between experimental results and image analysis and interpretation.
Several programs exist for the analysis of this type of data, but these are not fully open source and may require licensed software (e.g., Matlab ® ). They may also therefore be difficult to adapt to the user's specific needs. Moreover, the types of image format that can be processed by these programs are often limited.
Thus, we developed Spiky as an open source working interface dedicated to the analysis of functional data obtained from experiments going from action potentials to contractions, and from single cells to the whole heart. The final purpose of Spiky was to provide a tool which could be integrated to the data acquisition software (ImageJ) and be able to perform the whole pipeline from data acquisition to results interpretation. It avoids data conversion, exportation, importation and use of multiple software which make the analysis time consuming and possibly error prone.

Materials and Methods
The datasets generated and analyzed during the current study are available from the corresponding authors on request.

Code Availability
Spiky has been written in JAVA and ImageJ Macro Language. The complete source code is available at http://pccv.univ-tours.fr/ImageJ/Spiky, accessed on 4 February 2022 and GitHub at https://github.com/PCCV/Spiky, accessed on 4 February 2022.

Action Potentials
Action potentials from single cardiomyocytes were recorded within rat left atria with the sharp microelectrode technique, as described previously [6].

Calcium Transients and Calcium Waves in Isolated Myocytes
Isolated cardiomyocytes were obtained from the left ventricle of adult male Wistar rats. Rats were anesthetized with intraperitoneal injection of pentobarbital (60 mg/kg). The heart was rapidly removed and retrogradely perfused through the aorta. The left ventricle cardiomyocyte isolation was achieved with a Langendorff system, as described previously [7].
Calcium transients of isolated ventricular cardiomyocytes were recorded under confocal microscopy, as described previously [8]. Briefly, ventricular cardiomyocytes were loaded with the calcium-sensitive dye Fluo-4 and superfused with a physiological saline solution. Excitation of the dye was performed at 488 nm and emission was collected at 515 ± 10 nm. Calcium transients were evoked by a square wave of electrical stimulation with a pair of platinum electrodes at a frequency of 1 Hz. To record calcium waves, cardiomyocytes were left in a quiescent state until a calcium wave occurred.

Optical Mapping of Action Potentials Data from Whole Heart
Action potentials were optically recorded on isolated perfused heart as described previously [9]. Briefly, the heart was loaded with the voltage-sensitive dye Di-4-ANEPPS and electrically stimulated with a pair of platinum electrodes. The contraction was then abolished by 10 mM of the electromechanical uncoupler 2,3-butanedione monoxime to avoid motion artifacts. The fluorescent dye was excited at 530 nm and emission was collected at 700 ± 50 nm with a Micam Ultima L camera (SciMeasure Analytical Systems) at the sampling frequency of 1 kHz.

General Principle of the Algorithm
The principle of the Spiky algorithm is to first perform a detection of all "temporal" peaks in the input signal, whether these are positive or negative to the signal baseline. Peaks are recognized as data points that can be either higher or lower than surrounding points by more than a specific value defined by the user; in Spiky, it corresponds to a percentage of the range between the signal maximum and minimum data values. A correctly defined value allows the user to exclude noise and false positives from the analysis.
The signal input is either bidimensional XT (e.g., table or csv files) or tridimensional XYT (e.g., image stacks; Figure 1). Image stacks or movies are considered to be multiple bidimensional (XT) signals, which can be analyzed together. Then, for each peak of the input signal, all requested peak parameters are computed without requiring any operator intervention (see http://pccv.univ-tours.fr/ImageJ/Spiky/, accessed on 4 February 2022, for a description of the methodology of calculation of each parameter).   The output consists of a representation of the previously computed peak parameters. Several representations are proposed by Spiky, which depend on the type of input data and user requests (e.g., a table of single myocyte contraction parameters, colored map of calcium transients amplitude, isochronal activation map, action potential duration plot or map).
A description of how to use Spiky for several data types is available at http://pccv. univ-tours.fr/ImageJ/Spiky/, accessed on 4 February 2022.

Validation of Spiky
All analysis algorithms used have been validated on several different samples whose manual analysis results were compared with the automated analysis outputs. To test the efficiency and the limits of the peak analyzer, a peak simulator has also been implemented within the plugin. This is accessible in the parameters menu. It allows the creation of "realistic" peaks, so as to help the user to validate their own experimental conditions. Moreover, checking the "Make video" button of this module in the peak simulator window allows the creation of a simulated map.

XT Analysis
XT analysis applies to raw experimental data of only two dimensions or parts of XYT files. For example, the data may be action potentials recorded with a microelectrode (Figure 2 The output table contains a number of lines equal to the number of events (action potentials, calcium transients or contractions) detected in the file and each column corresponds to one parameter of the event. The table can be exploited directly in ImageJ by creating plots where parameters are plotted against each other, or exported as an .xls file for further investigation or display.

XYT Analysis
XYT analysis particularly applies to image stacks and movies with raw data obtained from optical mapping experiments and confocal microscopy. These techniques allow the optical recording of action potentials and evoked calcium transients at multiple scales, from single cells to the whole heart.
Spiky performs the analysis of two types of information from XYT data: first, signal propagation through the tissue, characterized by the temporal shift of the appearance of the signal in all pixels of the image; second, the shape and parameters of each signal in different areas of the preparation. The analysis allows the creation of isochronal maps where each area of the image is colored according to the signal onset delay, or vector maps showing the direction and speed (norm of the vector) of the signal propagation. It can be applied either to a single cardiomyocyte or to the whole heart, as shown for a spontaneous calcium wave in an isolated cardiomyocyte ( Figure 3A) and for action potential propagation in a whole heart ( Figure 3B). Thus, this analysis outputs a static visual image of the propagation characteristics (speed, direction, isotropy . . . ) of a signal across a preparation.  The XYT analysis can also be used to compare the behavior of different areas of a preparation. The requested parameter of the signal (e.g., duration, decay constant (τ)) can be computed over time for each pixel of the image. Then, a color is assigned to the pixel depending on the parameter value. If several signals are detected over time, the output parameter map is an average of the parameter values computed for each signal. This analysis can be applied to either a single cardiomyocyte or the whole heart, as shown in Figure 4.  Figure 3B is shown here. The isochronal map (Ba) can be overlaid on the original image.

Comparison with Other Existing Algorithms
To our knowledge, there is no existing software with a graphic user interface available for the extraction and analysis of bidimensional peaks from image stacks data. Therefore, the comparison will be performed with other optical mapping analysis software. The main differences between Spiky and other three widely used optical mapping analysis software are presented in Table 1.

Discussion
To our knowledge, Spiky is the first fully open-source software to propose a wide range of analysis of experimental cardiac XT and XYT data, as well as analysis of optical mapping data. Indeed, despite the existence of two programs whose authors provided the software code, they only apply to optical mapping data analysis [9,10]. The code cannot be adapted in order to fit user's specific needs without a Matlab ® license.
Moreover, Spiky does not require data conversion or programming skills to perform a detailed analysis of excitation-contraction parameters obtained with imaging techniques, since ImageJ opens almost all image file types. The software has been especially developed for a translational use at multiple scales, from single cardiac cell to the whole heart, and from fundamental to clinical research. Though Spiky has been developed for cardiac experimental data, its use can be extended to other cell types and research applications which involve periodic phenomena or peak analysis.
Spiky is free and works under ImageJ, which is a widely used image analysis software for Windows, Mac and Linux operating systems. Moreover, analysis can be performed on any data format that can be opened by ImageJ, from a single XT signal to XYT multichannel images or videos. For those with programming skills, the source code of Spiky is open and can be improved or adapted to fit the user needs.
Limitations: Spiky has been designed for a wide range of applications with different types of data. Therefore, the parameters used for the detection of a peak (positive or negative) have to be entered, tested and validated by the user. Spiky does not support a fully blind analysis and its use does not exempt the user from careful interpretation of the output results. For example, the decay constant map of the calcium transient close to the edge of the cell in Figure 4A is impaired by the contraction of the myocyte, and the measurements of action potential duration on the margins of the tissue in Figure 4B are distorted by edge effects.
Finally, to make it applicable to the largest range of applications yet easy to use, some very specialized functions were not implemented. For example, processing of data from panoramic optical mapping systems. To perform such an analysis, software like RHYTHM would be more appropriate [9].

Conclusions
Spiky improves the pipeline of cardiac data analysis by making it free, faster and easier for both experienced and inexperienced investigators.