This protocol describes the setup and use of ElectroMap, a MATLAB-based open-source software platform for analysis of cardiac optical mapping data. ElectroMap provides a versatile high-throughput tool for analysis of optical mapping voltage and calcium datasets across a wide range of cardiac experimental models.
Optical mapping is an established technique for high spatio-temporal resolution study of cardiac electrophysiology in multi-cellular preparations. Here we present, in a step-by-step guide, the use of ElectroMap for analysis, quantification, and mapping of high-resolution voltage and calcium datasets acquired by optical mapping. ElectroMap analysis options cover a wide variety of key electrophysiological parameters, and the graphical user interface allows straightforward modification of pre-processing and parameter definitions, making ElectroMap applicable to a wide range of experimental models. We show how built-in pacing frequency detection and signal segmentation allows high-throughput analysis of entire experimental recordings, acute responses, and single beat-to-beat variability. Additionally, ElectroMap incorporates automated multi-beat averaging to improve signal quality of noisy datasets, and here we demonstrate how this feature can help elucidate electrophysiological changes that might otherwise go undetected when using single beat analysis. Custom modules are included within the software for detailed investigation of conduction, single file analysis, and alternans, as demonstrated here. This software platform can be used to enable and accelerate the processing, analysis, and mapping of complex cardiac electrophysiology.
Optical mapping utilizes fluorescent reporters of voltage and/or calcium concentration to interrogate cardiac electrophysiology (EP) and calcium handling in multicellular preparations, with greater spatial resolution than achievable with traditional techniques1,2,3. Therefore, optical mapping has emerged as an important and ever increasingly utilized technique, providing key insights into physiological and pathophysiological electrical behavior in the heart3,4,5,6,7,8. Effective processing and analysis of data obtained from optical mapping experiments is complicated by several factors. The high spatiotemporal resolution nature of optical mapping datasets results in raw videos files composed of thousands of image frames, each made up of a number of individual pixels, giving rise to large data files that necessitate high-throughput and automated processing9. Small pixel sizes, poor and uneven dye loading and small fractional changes in fluorescence result in optical signals with low signal to noise ratio (SNR), requiring pre-processing before effective analysis is achievable10. Processing and analysis can be further complicated by the use of optogenetic pacing protocols which utilize light to initiate activation, potentially distorting the recorded signal from the fluorescent sensors11,12. Furthermore, once data has been processed, several non-consistent techniques and definitions can be applied to measure parameters of interest, with the most applicable techniques varying depending on experimental setup, model and question2,10,13. These limitations prevent further uptake of the technology and hinder truly objective analysis.
To overcome these limitations, several research groups have designed custom processing pipelines tailored towards their experimental model, question and hardware7,14,15,16. Others utilize commercial proprietary software where the underlying algorithms may be difficult to access4,17. As a result, there is a clear need for a freely available open-source software platform for processing and analysis of optical mapping data. It is important that this software is open-source, easy to use, flexible to parameter adjustment, applicable to a range of experimental models with distinct EP properties and crucially allows straightforward and tunable quantification of the range of cardiac parameters that can be studied using optical mapping.
We have recently published and released a comprehensive software platform, ElectroMap, for high-throughout, semi-automated processing, analysis and mapping of cardiac optical mapping datasets13. Here, we present a video manual for the utilization of ElectroMap and demonstrate how it can be used to process, analyze and map several optical mapping datasets. We focus on the use of ElectroMap to quantify standard EP and calcium handling variables and demonstrate the use of standalone conduction velocity, single file analysis and alternans modules.
1. Optical mapping data collection
2. Software installation and start-up
NOTE: Below are detailed the two methods for installing and running ElectroMap – either within MATLAB run from the source (.m) code or as a standalone executable file (.exe for windows). The final software and its functionality are invariant between the two setup options (other than a few differences in directory navigation). Therefore, the main considerations for choosing version to install are access to MATLAB and required toolboxes and whether access to source code is desired. Where possible, it is recommended to use the MATLAB version for faster start up times, shorter processing times, and easier error reporting.
3. Image loading and pre-processing
4. Data segmentation and ensemble averaging
NOTE: Once the file has been processed, peaks in the tissue averaged signal (bottom right trace, Figure 1A) will have been detected and labelled by red circles. Only peaks above a set threshold (blue line on trace that is set by Peak Threshold) are counted. Additionally, peaks are only counted if they are sufficiently delayed compared to the previous peaks, set by the Min Peak Distance input. Signal is then segmented based on the detected peaks. First, the effective cycle length (CL) of each peak is calculated by measuring the time between it and the next peak. If a number of peaks (set by Min Number of Peaks input) have similar CLs (threshold for which is set by Minimum Boundary input) then they are grouped and the average CL for those peaks calculated.
5. Action potential/calcium transient duration and conduction velocity analysis
6. Conduction analysis module
7. Additional analyses and modules
8. Exporting data
All work performed as part of this study was undertaken in accordance with ethical guidelines set out by the UK Animals (Scientific Procedures) Act 1986 and Directive 2010/63/EU of the European Parliament on the protection of animals used for scientific purposes. Experiments were approved by the home office (mouse: PPL 30/2967 and PFDAAF77F, guinea pig: PPL PF75E5F7F) and the institutional review boards at University of Birmingham (mouse) and King’s College London (guinea pig). Detailed methods for collection of the raw data that has been analyzed here can be found in our previous publications5,6,14,19.
The main interface from which ElectroMap is controlled is shown in Figure 1A. The necessary steps to analyze a dataset are controlled primarily by the Load Images, Process Images, and Produce Maps buttons, and are shown highlighted in green, blue, and red, respectively in Figure 1A. Figure 1B-D shows the operations that occur on selection of each of these buttons. Load Images applies the image thresholding options as selected by the user (Figure 1B), while Process Images (Figure 1C) applies filtering and baseline correction. Finally, Produce Maps will first average data according to the time window and segmentation settings (unless single beat segmentation is chosen) and then perform analyses described above.
A key aspect of ElectroMap is its flexibility with respect to camera type and experimental model. This is crucial for the utility of an optical mapping software due to the distinct cardiac EP and anatomical characteristics that exist between widely used models. Figure 2A for example shows the action potential morphology of the murine atria when compared to the guinea pig ventricle, recorded using voltage sensitive dyes as previously reported6,14. Despite the distinct shape of the action potential, and the use of two separate optical mapping cameras with different framerates and pixel sizes, ElectroMap can be utilized to successfully analyze both datasets. However, this requires modification of some parameters within the user interface (Figure 2B). Note that the prolonged guinea pig action potential necessitates a larger time window. Additionally, to prevent top-hat baseline correction unphysiologically modifying the optically recorded signals, its time length must be increased so that it is greater than the time course of the action potential.
ElectroMap offers a multitude of processing options to help improve the SNR of optically recorded signals which may be required to effectively recover EP parameters. An example is automated ensemble averaging of peaks following data segmentation. Figure 3A-C demonstrates how the application of ensemble averaging, in lieu of other methods, can improve SNR from isolated murine left atria (n = 13). This reduces measurement heterogeneity and likelihood of analysis failure (Figure 3D). For example, a change of pacing frequency from 3 Hz to 10 Hz did not alter APD50, when no ensemble averaging is undertaken, yet an expected29 decrease in APD50 at 10 Hz pacing was observed when measured from ensemble averaged data (Figure 3E).
Figure 4 demonstrates the efficacy and utility of automated pacing frequency detection and segmentation offered by ElectroMap. Here, mouse left atria (n = 5) were paced at a 120 ms cycle length and cycle length was incrementally shortened by 10 ms until it reached 50 ms. ElectroMap automatically identified the pacing cycle length and grouped tissue averaged peaks accordingly (Figure 4A). This was achieved with high accuracy in all datasets (Figure 4B). Automated segmentation of the data allowed straightforward and high throughput analysis of the slowing of conduction velocity with increased pacing frequency/shortened cycle length (Figure 4C,D). Concurrently, APD50 (Figure 4E) and diastolic interval (Figure 4F) shortened. Amplitude of the optically measured peaks decreased, while time to peak increased (Figure 4G,H). These are again the expected restitution responses in cardiac tissue29,30 and use of ElectroMap can help therefore elucidate changes in response to pacing frequency in presence of pharmacological agents, genetic modification, or disease states.
An important consideration in the use of a software such as ElectroMap is the presence of artifacts in the underlying data. Figure 5, for example demonstrates that motion artifacts (the distortion of the optically recorded signal by tissue movement) can preclude accurate measurements of activation and especially repolarization within ElectroMap. See Discussion for further considerations.
Figure 1: ElectroMap main processing steps. (A) Graphical user interface of ElectroMap, with the Load Images (green), Process Images (blue), and Produce Maps (red) buttons highlighted. (B) Image thresholding options that can be applied on selecting Load Images. (C) Signal processing options available to the user include spatial and temporal filtering and baseline correction and can be applied to the image stack by pressing Process Images. (D) Ensemble averaging and parameter quantification (shown APD measurement) that is activated by selecting Produce Maps. Figure adapted from O’Shea et al., 201913. Please click here to view a larger version of this figure.
Figure 2: Analysis of mouse and guinea pig data using ElectroMap. (A) Optically recorded action potential from mouse atria and guinea pig ventricles, along with both the first (df/dt) and second (d2f/dt2) derivate of these signals. The various definitions for activation and repolarization times employable within ElectroMap are highlighted. (B) Screenshots of Image and signal processing settings utilized in ElectroMaps interface. Red boxes highlight settings that required modification between analyses of mouse and guinea pig data. Figure adapted from O’Shea et al., 201913. Please click here to view a larger version of this figure.
Figure 3: Ensemble averaging to resolve APD changes. (A) APD50 map and example single pixel signal from single beat optical action potentials. (B) APD50 map and example single pixel signal from optical action potentials generated by ensemble averaging of 10 successive beats (peak method). (C) SNR of single beat compared to 10 beat averaged signals. (D) APD50 heterogeneity (i) and number of measurement failures (ii) as a function of SNR for single beat and 10 beat averaged APD50 maps. (E) APD50 at 3 and 10 Hz pacing frequency, as measured from single beat and 10 beat maps. (Data shown as mean ± standard error, n = 13 left atria, ****p < 0.001 by student’s paired t-test). Please click here to view a larger version of this figure.
Figure 4: Use of ElectroMap to study pacing frequency responses in cardiac tissue. (A) Example ElectroMap screenshot of pacing frequency recognition and segmentation. (B) Comparison of known and ElectroMap measured pacing cycle lengths. (C) Activation maps at 120 ms and 60 ms pacing cycle lengths. (D-H) Grouped data of conduction velocity (D), APD50 (E), diastolic interval (F), amplitude (G), and time to peak (H) as a function of pacing cycle length decreasing from 120 ms to 60 ms in 10 ms increments. (Data shown as mean ± standard error, n = 5 left atria) Please click here to view a larger version of this figure.
Figure 5: Effect of motion artifacts. (A) APD50 map. (B) Activation map. (C) Example signals from locations marked (crosses) on APD and activation maps. In the area of the tissue marked with the red cross, contraction has not been successfully uncoupled, distorting the measured optical signal. Please click here to view a larger version of this figure.
Here, we present a step-by-step guide for the utilization of open-source software ElectroMap for flexible and multi variable analysis of cardiac optical mapping datasets. For successful use of ElectroMap, imaging data is required to be in .tif or .MAT formats. ElectroMap incorporates several modifiable user settings. As demonstrated in Figure 2A, this is necessary due to the wide heterogeneity that exists between experimental models and imaging hardware. This means however that default settings within the software will not always be optimal, so a critical step in using the software is for the user to tune settings for their particular experimental setup. These include camera settings and timescales, as shown in Figure 2B. Once optimal settings have been found, these can be saved and reloaded at later times by selecting Configuration File.
Incorporation of automated CL measurement and signal segmentation are key advantages of the software. These features allow analysis of acute responses in experimental recordings and widen analysis from focusing on isolated single beats. Once desired segmentation has been achieved, the Single File Analysis module allows automated analysis of each individual segment (including single beats), realizing high-throughput analysis of multiple variables across the recording outputted in a single .csv file. In conjunction, ensemble averaging of grouped peaks is an effective method to improve quality of noisy signals that is automatically performed in ElectroMap. However, ensemble averaging is not ubiquitously beneficial, for example in studies of beat-to-beat variability. Therefore, ElectroMap integrates single beat segmentation to avoid ensemble averaging, alternative processing options to improve SNR (spatial and temporal filtering) and includes the Alternans analysis module to further investigate and map beat-to-beat variability.
Optical Mapping datasets often exhibit artifacts such as baseline drift and motion artifacts. Equally, the signals generated can be low quality due to small pixel sizes, short exposure times and low fractional fluorescent changes2. These factors prevent effective and accurate analysis of the underlying EP behavior. As outlined, ElectroMap has several processing strategies to overcome these issues. However, application of these algorithms to fundamentally poor quality/distorted data will still prevent effective analysis. SNR is therefore one of the parameters that is measured and displayed in ElectroMap. Equally, the user can select and compare the signals from specific regions from the sample using the Pixel Info and Compare modules, allowing identification of phenomena such as motion artifacts shown in Figure 5, and appropriate exclusion of data.
At present, ElectroMap does not support removal of motion artifacts from raw data in the same manner as baseline correction. Therefore, a possible future development of the software is inclusion of motion artefact removal by computational methods as has been reported31,32. Furthermore, ElectroMap is currently limited to study of one optical signal. However, for ratiometric dyes and simultaneous use of voltage and calcium dyes27, concurrent processing of two wavelength channels is required. The integration of dual signal analysis is therefore an important future addition to the software. Extension of analysis options applicable to arrhythmic datasets, such as phase singularity tracking, would equally broaden the scope of the software33,34. Finally, several of the analysis options described can also be useful in analysis of the electrode mapping data. Indeed, ElectroMap has been used to analyze electrode mapping data despite the contrasting electrogram waveform20,35, and further optimization will expand its use for this modality.
The authors have nothing to disclose.
This work was funded by the EPSRC studentship (Sci-Phy-4-Health Centre for Doctoral Training L016346) to D.P., K.R. and L.F., Wellcome Trust Seed Award Grant (109604/Z/15/Z) to D.P., British Heart Foundation Grants (PG/17/55/33087, RG/17/15/33106) to D.P., European Union (grant agreement No 633196 [CATCH ME] to P.K. and L.F.), British Heart Foundation (FS/13/43/30324 to P.K. and L.F.; PG/17/30/32961 to P.K. and A.H.), and Leducq Foundation to P.K.. J.W. is supported by the British Heart Foundation (FS/16/35/31952).
MATLAB and Simulink R2018a | Mathworks, Inc, Natick, MA | MATLAB software |