Automatic identification of a stable QRST complex for non-invasive evaluation of human cardiac electrophysiology

Background A vectorcardiography approach to electrocardiology contributes to the non-invasive assessment of electrical heterogeneity in the ventricles of the heart and to risk stratification for cardiac events including sudden cardiac death. The aim of this study was to develop an automatic method that identifies a representative QRST complex (QRSonset to Tend) from a Frank vectorcardiogram (VCG). This method should provide reliable measurements of morphological VCG parameters and signal when such measurements required manual scrutiny. Methods Frank VCG was recorded in a population-based sample of 1094 participants (550 women) 50–65 years old as part of the Swedish CArdioPulmonary bioImage Study (SCAPIS) pilot. Standardized supine rest allowing heart rate stabilization and adaptation of ventricular repolarization preceded a recording period lasting ≥5 minutes. In the Frank VCG a recording segment during steady-state conditions and with good signal quality was selected based on QRST variability. In this segment a representative signal-averaged QRST complex from cardiac cycles during 10s was selected. Twenty-eight morphological parameters were calculated including both conventional conduction intervals and VCG-derived parameters. The reliability and reproducibility of these parameters were evaluated when using completely automatic and automatic but manually edited annotation points. Results In 1080 participants (98.7%) our automatic method reliably selected a representative QRST complex where its instability measure effectively identified signal variability due to both external disturbances (”noise”) and physiologic and pathophysiologic variability, such as e.g. sinus arrhythmia and atrial fibrillation. There were significant sex-related differences in 24 of 28 VCG parameters. Some VCG parameters were insensitive to the instability value, while others were moderately sensitive. Conclusion We developed an automatic process for identification of a signal-averaged QRST complex suitable for morphologic measurements which worked reliably in 99% of participants. This process is applicable for all non-invasive analyses of cardiac electrophysiology including risk stratification for cardiac death based on such measurements.


Results
In 1080 participants (98.7%) our automatic method reliably selected a representative QRST complex where its instability measure effectively identified signal variability due to both external disturbances ("noise") and physiologic and pathophysiologic variability, such as e.g. sinus arrhythmia and atrial fibrillation. There were significant sex-related differences in 24 of 28 VCG parameters. Some VCG parameters were insensitive to the instability value, while others were moderately sensitive.
The recording of the VCG differs mainly from standard electrocardiography (ECG) by placing one electrode on the back and one on the neck [11]. The VCG related information is based on three orthogonal leads (X, Y and Z) from which the P, QRS and T vector loops can be defined as well as one global QRST complex from QRST x , QRST y and QRST z ; S1 Fig. Unique for VCG are: 1) measures of amplitudes and directions of the QRS complex and T wave, 2) measures of global heterogeneities (from here dispersion) and separately for depolarization (QRS) and repolarization (T), 3) the ST vector magnitude reflecting ischemia, 4) measures of QRS-and T-loop complexity, and 5) the most accurate definition of the spatial QRS-T angles [13]. Despite strong scientific evidence of its prognostic value, as reviewed in [5][6][7], assessment of the QRS-T angles and other VCG-based measures has not yet become clinically established. There are multi-factorial reasons which include lack of standardization of recording and analysis methodology, lack of easily accessible interpretations of data and user friendly presentation of their implications. In this study we focused on obtaining accurate VCG-based parameters and not on the diagnostic performance or specific clinical applications of VCG which have been dealt with before [5][6][7]13]. An automatic and reliable procedure for obtaining VCG derived parameters is one requirement towards clinical application of VCG and was the rationale behind this study.
In preparation for a Swedish population based study on cardiovascular and pulmonary risk factors, the Swedish CArdio-Pulmonary bioImage Study (SCAPIS, a pilot SCAPIS study with 1111 participants was initiated where Frank VCG was part of the day-2 protocol (n = 1095) [14]. These recordings provided a suitable data base for developing an automatic method. The aim of the study was therefore to develop a robust operator independent method applicable and appropriate for use in the upcoming main SCAPIS as well as in other studies and eventually for easy application in a clinical setting. This aim was achieved by a process which is applicable for all non-invasive analyses of cardiac electrophysiology whether based on Frank VCG or not. A step towards clinical implementation of VCG derived parameters for prognostic and other purposes was taken.

Study participants
The participants were enrolled on a population basis among people 50-64 years living in the city of Gothenburg 2012 aiming at similar proportions of women and men as described in detail elsewhere [14,15]. The total target population consisted of 24,502 individuals. An invitation letter to participate in SCAPIS was sent to 2243 randomly selected individuals from 6 residential areas, which were selected to represent opposite extremes of socioeconomic status. The overall participation rate was 50% (1111 of 2243) but varied between the areas [15]. VCG recording was performed in all 1095 day-2 SCAPIS pilot participants by study personnel (staff nurses). One recording failed due to unobserved electrode dislodgement. The remaining 1094 constitute the study group.
Fifty participants (27 women) volunteered a second recording which allowed reproducibility assessment in this subgroup. The second recording was performed at a time-point of the participants' own choice because of the very tight 2-day schedule they already had agreed to undergo. Their mean age (SD) was 57 (4) years. In 22 of them, recordings were performed with �1month's interval while in 28 the second recording was performed the same day as the first but after removal of the electrode patches and with another operator performing the procedure after a time interval.
The research project was approved by the Regional Ethics Committee in Gothenburg, Sweden, on December 8, 2016, #1009-16. All participants provided written consent to all data collection.

VCG recordings and on-line analysis
The methodology followed the basic principles applied in our previous studies [16][17][18]. The protocol stipulated 5 minutes of supine rest with closed eyes and no conversation to allow heart rate stabilization and heart rate adaptation of ventricular repolarization before the VCG recording period of �5 min (preferably 8-10 min). The CoroNet II system (Ortivus AB, Danderyd, Sweden) was used. Five electrodes were positioned around the chest (one in the back) aiming at the level of the 5th rib's insertion on the sternum, one in the neck, and one each on the left and right hip [11]. The electrodes on the back and neck (for Z-and Y-leads) were placed beside the spinous processes to optimize comfort. Signals were sampled at 500Hz with an amplifier bandwidth of 0.03 to 170Hz and the orthogonal X-, Y-and Z-leads were calculated according to Frank [12]. From consecutive 10s-periods of cardiac cycles with dominant QRST-morphology and good signal quality, signal-averaged QRST complexes (saQRST) from all cardiac cycles fulfilling these criteria were calculated during the automatic on-line analysis of the recording to improve the signal-to-noise ratio.

Automatic VCG post-analysis
The analysis software was developed from the CoroNet platform (Ortivus AB, Danderyd, Sweden) but using the tangent method for defining the end of the T wave which we have applied in beat-to-beat analyses of ventricular repolarization dynamics [16][17][18].
For manual correction of annotation points (calipers), a graphical interface was used showing the automatic annotation points marked in a presentation where the X-, Y-and Z-leads and the magnitude of the QRST complex are superimposed; S1 Fig. See also Glossary and definitions in the S1 Appendix.
In brief, the aim of the post-analysis procedure was to identify the most representative 10s-saQRST complex among those created during the on-line VCG recording. The key property of this complex would be its similarity to the surrounding complexes indicating stable conditions. The first step was therefore to identify stable parts of the recording defined as the presence of 7 consecutive 10s-saQRST complexes (70s of the recording). In the next step, qualified segments were selected when the middle 5 consecutive saQRST complexes out of the 7 each contained �3 cardiac cycles with dominant QRST morphology, representing 50s of the recording. An instability value was calculated for each qualified segment based on the variability between its 5 10s-saQRST complexes. Finally, a representative 10s-saQRST complex was searched for among the 5 in the qualified segment with the lowest instability value. Representative in this context means the 10s-saQRST complex out of the 5 possible which was most similar to the average of the 5 complexes. The representative 10s-saQRST complex selected by this procedure was used for the calculation of all morphologic parameters. The process ending in the selection of a representative 10s-saQRST complex comprised 3 main steps utilizing 2 basic procedures. These procedures illustrated in Fig 1 were: 1) Alignment In order to compare QRST complexes or to create a saQRST complex, they were aligned by sliding and superimposing them in the time dimension, searching for the minimum difference in the interval between the QRS onset The upper panel shows the sliding and superimposition of the red QRST complex that was to be compared with the fixed blue QRST complex. The middle panel shows the alignment of the 2 QRST complexes and their difference in one lead in a short segment of the QT interval. The lower panel shows the calculation of the signal difference in the specific segment displayed in the middle panel. This procedure was used for 1) characterizing the stability of each 50s-segment of the recording (consisting of 5 consecutive 10s-signal-averaged complexes; saQRST complexes); 2) selecting the segment with least variability; 3) from the selected segment choose the 10s-saQRST complex which was most similar to the average complex of the selected 50s-segment. Comparisons were made at each 2ms-step (time resolution at sampling rate 500Hz) and the absolute amplitude difference over the QT interval was defined (entire QRST complex). The amplitude resolution was 2.5 μV and for each comparison all differences �5μV were used to calculate an instability value (no unit because small differences are not included).
https://doi.org/10.1371/journal.pone.0239074.g001 and the QRS peak. By using the method of difference calculation contributions over the entire QT interval were given equal importance regardless of at what signal level they occurred, i.e. a difference of 10μV close to onset and a difference of 10μV close to the peak will have the same impact. 2) Difference calculation The difference between 2 complexes was defined as the mean difference of the sample values (one per 2ms) of the entire QT interval (QRSonset to Tend) after alignment as in 1). We focused on major deviations; any difference in an X-, Y-or Z-lead equal to just one shift in digitalization (2.5μV amplitude resolution) potentially only related to very little noise was therefore suppressed. Thus, all difference values less than 5μV in a lead were set to 0. This suppression was done before calculation of the sample difference value as [dx 2 +dy 2 +dz 2 ] ½ where dx, dy and dz are the differences in the X-, Y-and Z-leads. The difference calculation resulted in an instability value. The details of the 3-step process are described in the next paragraphs.
1. Identifying qualified segments of the VCG recording. The first step was to identify stable parts of the recording defined as the presence of 7 consecutive 10s-saQRST complexes (70s of the recording) with the dominant morphology and of good quality. The middle 5 of the 10s-saQRST complexes constitute a so called qualified segment. Although, the protocol stipulated 5 minutes of supine rest followed by �5 min of VCG recording, the first 2 minutes of the recording were avoided to ascertain optimal recording conditions. In addition, the final minute was excluded because it might contain disturbances if the participant became aware of the approaching end of the recording. When the recording period was <6 minutes, the discarded interval was gradually decreased to exclude half the recording period, 2/6 in the beginning and 1/6 of the recording at the end. When the available recording was <3 minutes or if no qualified segment was found in the selected part of the recording, any part of the recording including 5 consecutive 10s-saQRST complexes was accepted for further assessment.
2. Selection of the qualified segment where complexes were most similar; variability calculation. The variability of the signal was defined as the difference between the 5 consecutive 10s-saQRST complexes in a qualified segment of the recording. This difference was assessed by keeping one of the complexes fixed and the other 4 individually aligned. The difference between the fixed and aligned complexes was calculated and averaged as described in Fig 1. The procedure was repeated with each of the 5 saQRST complexes kept fixed and the lowest total difference of the 5 became the instability value assigned to the qualified segment. Every qualified segment was evaluated according to this procedure as illustrated by the flowchart in Fig 2. The qualified segment with the lowest instability value was selected as input for the final step and referred to as the selected segment.
3. Selecting the representative 10s-saQRST complex for the entire recording. The selected segment saQRST complex was calculated as the average of the 5 10s-saQRST complexes with the same one kept fixed (and the other 4 aligned) as gave the lowest instability value in step 2. All 5 10s-saQRST complexes in this segment were then aligned to the segment saQRST complex (i.e. to their average). The individual 10s-saQRST complex that had the smallest difference-was most similar-to the segment saQRST complex was selected as the representative 10s-saQRST complex for the entire recording and then used for the fully automatic measurement of 28 VCG derived parameters.

Comparison of the representative algorithm selected vs. an arbitrary saQRST complex
The rationale behind this comparison was to test if a 5min pre-recording period of supine rest in itself resulted in subsequent recording segments of comparable stability as those identified through a rather extensive algorithm described in the previous sections. The 4 th 10s-saQRST complex from the beginning of each recording was arbitrarily chosen as comparator; i.e. representing an early part of the recording. This 10s-saQRST complex was analyzed in the same fully automatic way as the representative 10s-saQRST complex. We compared the actual parameter values as well as their reproducibility calculated as the coefficients of variation. Altogether 100 recordings (paired observations from the 50 participants studied twice) were eligible, but both recordings from one participant were excluded due to data not fulfilling the requisites of the automatic analysis.

Assessment of fully automatic vs. manually edited automatic annotation points
In the same algorithm selected representative 10s-saQRST complex, we compared VCG parameters from automatically set annotation points vs. manually edited annotation points. In The flow-chart describes the process for arriving at an instability value for a 50s qualified segment consisting of 5 consecutive 10s-signal-averaged-complexes (saQRST complexes) of the recording applying the methods described in Fig 1. This process was repeated for all qualified 50s segments of an individual recording and the segment with least variability was referred to as the selected segment from which the most representative 10s-saQRST complex was chosen for the calculation of 28 vectorcardiographic parameters.
https://doi.org/10.1371/journal.pone.0239074.g002 order to avoid inter-observer variability one of the authors (L.B.) did the manual editing as described in the legend to S1 Fig. The same procedure as in the preceding paragraph was used with comparison of parameter values and the coefficients of variation.

Quality validation, reasons for high instability values, and effect on VCG parameters
The instability value was both a tool in the selection process of the representative 10s-saQRST complex and a measure of its reliability or quality. The function for such a quality assessment was primarily to detect and signal technically unsatisfactory recordings that warranted manual editing by the investigator. We tested that this goal was achieved by 3 procedures. Two were manual and performed by one of the authors (G.L.) and the third was automatic. A) When there was a high instability value, the cause was categorized as due to: 1) external disturbances coming from technical problems or body movements, and 2) internal variations coming from breathing or variation in RR-intervals. Starting with the recordings with the highest instability values, a batch of 20-25 recordings were scrutinized. In a stepwise fashion another batch of recordings with successively lower instability values were scrutinized until a level was reached where the instability value had a low likelihood of being caused by external disturbances. B) The recording segment with the representative 10s-saQRST complex was compared with the rest of the recording to verify if it was from the most stable part in terms of disturbances, heart rate, and morphological parameters, and as a consequence suitable for morphologic analysis. C) Using the 5 10s-saQRST complexes in the selected segment, the relation between their instability value and their range (maximum-minimum) in the VCG parameter values (e.g. the QT interval) within this segment was tested by regression analysis.

Statistical methods
Median and quartiles (Q1 and Q3) were used for descriptive purposes because most clinical variables and VCG parameters had non-Gaussian distributions according to the Shapiro-Wilk test with p-values <0.05. Between-group comparisons were performed with the Mann-Whitney and the chi-square tests. Reproducibility was assessed by the coefficient of variation (%), which was computed as the intra-individual standard deviation (s) divided by the mean of all values for each parameter (here 98 values) multiplied by 100 for percent. The intra-individual standard deviation was calculated as [(S d 1 2 /2+. . .+d n 2 /2)/n] ½ where d is the difference between the 2 paired observations in each of the 49 participants studied twice [19]. The Wilcoxon matched pairs test was used to analyze the comparisons of coefficients of variation. The Spearman rank order correlation coefficient (r s ) was calculated in the correlation analyses. A p-value < 0.05 was considered significant. Table 1 presents demographic and clinical characteristics. There were 550 women and 544 men and their median age (Q1-Q3) was 57.6 (54.8-61.7) years without sex difference. The most common disorder among the participants was hypertension present in 364 of whom 53 also had diabetes while 33 had diabetes alone. Various other cardiovascular risk factors were also common. Men were not only taller and heavier but also had higher BMI and blood pressure and more often atrial fibrillation and diabetes (and hence higher blood glucose). Men also had higher triglycerides, Apo B/Apo A1, hemoglobin, ALT and creatinine. In contrast, women Characteristics of the population sample with available recordings and comparisons between women and men (Mann-Whitney test and Χ 2 with Yates correction). Median (Q1-Q3). (<1% data missing for each item). † systolic blood pressure �140 and/or diastolic blood pressure �90 mmHg more often had cancer and rheumatic disease and had higher total cholesterol due to higher HDL (the beneficial lipoprotein). The 12-lead ECG estimated from the Frank VCG was normal in 62% of the participants according to the evaluation performed by one of the authors (L.B.). Unspecific ST-T changes were the most common deviations from normality (9.9%), followed by premature ventricular extra-beats, fascicular blocks, and early repolarization which each of them was observed in 5-6% of participants. Sinus bradycardia, premature atrial extra-beats, first degree atrioventricular block, bundle branch block, and T-wave inversions was each of them observed in 1-4%, while pathological Q-waves, atrial tachycardia or atrial fibrillation and prolonged intraventricular conduction (QRS�120ms) without typical bundle branch block pattern each was observed in <1%.

Data acquisition and selection of representative 10s-saQRST complex
The protocol stipulated �5 minutes of recording time which was achieved in all but 10 participants (1084, 99.1%). Three recordings did not provide enough data for the automatic postanalysis and were therefore excluded. The median (Q1-Q3) duration of the remaining 1091 recordings was 9.2 (8.2-9.7) min with distribution according to S2 Fig. In 1059 recordings (97.1%) the first 2 and the last minute of the recording were excluded as planned, while in 32 recordings parts of these periods were included in the search for stable segments. In 3 cases, the entire recording was searched for 5 consecutive 10s-saQRST complexes.
In 11 recordings atrial activity was superimposed on the QRST interval, 9 due to atrial fibrillation and 2 due to competing sinus and junctional rhythms. In 5 out of 9 recordings with atrial fibrillation the instability value was >12 (cut-off limit chosen for reasons discussed below), and we decided to exclude all recordings with this arrhythmia as well as both recordings with competing sinus and junctional rhythms which both had instability values >12.
The automatic post-analysis included the remaining 1080 subjects with sinus rhythm (98.7%; 547 women, 533 men). VCG parameters from these 1080 participants were calculated from automatic annotation points on the representative 10s-saQRST complex ( Table 2). Sex-related differences were the rule and observed for 24 (86%) out of 28 VCG parameters. Only QRSamplitude, QRSarea, QRSazimuth and QRSarea azimuth did not differ significantly between women and men. Most differences were, however, <5%, including longer QT and QTc duration in women as expected. The QRS duration was 7% larger in men. The direction of the QRS-and QRSarea-vector and T-and Tarea-vector was more cranial and the T-vector also directed more forward in the transversal plane in men than in women [measured as elevation from down-ward and up and as azimuth in the transversal plane from left towards right in a frontal (0 to 180˚) or dorsal (0 to -180˚) direction]. The dispersion parameters Tamplitude, Tarea and Ventricular gradient were larger (27, 36 and 14%) and the Peak and Mean QRS-T angles were wider in men (48 and 30%) (S1 Dataset). These VCG parameters thus pointed towards higher risk for cardiac events in men. The same pattern was observed when comparisons were made among 319 apparently healthy participants (151 women) without any acute or chronic disease, chronic medication, or pathologic blood tests; S1 Table.

Comparison of representative algorithm selected vs. an arbitrary saQRST complex
The data from this comparison are shown in Table 3. Although these saQRST complexes were from different parts of the recording, the heart rate and the number of beats show that in general all cardiac cycles were of dominant morphology with good signal quality during the 10s-sampling periods. The coefficients of variation for the arbitrarily chosen 4 th "early" 10s-saQRST complex were larger for 13 out of 18 parameters. The largest improvements with the algorithm were observed for the conventional conduction intervals where the difference in CV was up to 50%. Overall, there was, however, no statistically significant difference when applying the Wilcoxon test for matched pairs (p = 0.14).

Assessment of fully automatic vs. manually edited automatic annotation points
The data from this comparison performed on the representative 10s-saQRST complex are shown in Table 4. The unedited automatic annotations of the 10s-saQRST complexes gave similar results as manual editing of the annotations (Wilcoxon test for matched pairs, p = 1.0).

Quality validation, reasons for high instability values, and effect on VCG parameters
This part of the study was performed on the 1080 recordings qualifying for VCG measurements. The median (Q1-Q3) instability value, based on the 5 consecutive 10s-saQRST complexes in the selected qualified segment, was 4.2 (3.2-5.6) and their distribution is shown in S3 Fig. Table 5 shows A) the reasons for high instability values, B) if the selected 50s-qualified segment was from the most stable part of the entire recording, and C) if the 10s-saQRST complex that had been selected was representative and of good quality. According to manual scrutiny of 70 recordings with the highest instability values, the higher the instability value, the more likely the reason was external disturbances. Furthermore, in 29 of the 33 recordings where the main reason for a high instability value was external disturbances, these were mainly caused by problems from the neck electrode (affecting the Y-lead in the orthogonal system); S4 Fig panel  a. A high instability value, however, also reflected internal sources of variability due e.g. to breathing or RR variability; S4 Fig panel b. Manual scrutiny also confirmed that the automatic process had identified the 50s-recording segment from the most stable part of the recording. Finally, the selected 10s-saQRST complex was representative and of good quality for calculating the VCG parameters when the instability value was �12. Five recordings with instability values exceeding 12 were less satisfactory.
The relation between the instability value and the range (maximum-minimum) of VCG parameter values among the 5 10s-saQRST complexes within the selected 50s-segment are exemplified in Fig 3 ( The sample mean (x), intra-individual standard deviation (s) and coefficients of variation (CV in %) for selected VCG parameters based on repeated recordings from 49 participants studied on 2 occasions for the algorithm selected representative saQRST complex and a randomly selected early (4 th ) saQRST complex. The sample mean is based on 98 observations to represent the denominator in the CV calculations. CV difference (in %) between CV(4 th ) and CV(algorithm).

Discussion
This study presents a method for automatic identification of a representative 10s-signal-averaged QRST complex from continuous Frank VCG recordings for the non-invasive evaluation of cardiac electrophysiology in humans. This method is, however, applicable for all non-invasive electrophysiological analyses whether based on Frank VCG or not. A quality measure (instability value) was implemented which identified the presence of external disturbances as well as physiological or pathophysiological variability, both potentially affecting VCG parameters and warranting manual scrutiny. The procedure proved feasible in 1080 (98.7%) of 1094 available recordings from a randomized population sample with equal proportions of women and men. The values of most VCG parameters differed significantly between women and men with the largest differences observed for the Peak and Mean QRS-T angles (48 and 30% larger in men), which are scientifically well-established risk-markers for cardiac death including SCD [2][3][4][5][6][7][8][9][10][11]. Men also had significantly larger heterogeneity (dispersion) of ventricular repolarization measured as Tamplitude, Tarea and the Ventricular gradient, which might reflect their higher propensity for ventricular arrhythmias and sudden cardiac death. Computerized electrocardiographic analysis is nothing new. An initiative for cooperation and standardization was published >30 years ago [the Common Standards for Quantitative Electrocardiography (CSE) project] [20]. Modern ECG equipment offer computerized calculations of PR, QRS and QT/QTc intervals as well as diagnostic interpretations. There is, however, an increasing interest in vectorcardiography-based analyses of electrocardiographic recordings for reasons summarized in the Introduction [13]. The literature on this topic describes results obtained with various customized computerized methods for VCG analyses mostly based on estimates from standard 12-lead ECG [5][6][7]. Focusing on the QRS-T angle, Schreurs et al. in 2010 reported the first validation of such estimates from standard 12-lead ECG when comparing 3 methods with Frank VCG as "gold standard" [4]. Even with the best method on the group level (referred to as the Kors matrix), there were in many cases considerable differences according to their Bland-Altman analysis [4; Fig 2]. Furthermore, and already within the CSE project, 19 computerized programs were compared, 10 based on 12-lead ECG and 9 on Frank VCG (XYZ); Willems and co-authors stated: "In general the measurement performance of XYZ programs was better than that of 12-lead programs." [20; p. 532]. The same authors commented on the importance of sufficient sampling size (recording duration) and on a high signal sampling rate using 500Hz in the CSE library as the standard. The present study was based on the Frank XYZ system, standardized supine rest during 5 minutes before the recording for �5min and using a sampling rate of 500Hz. We focused on obtaining highquality data in both a technical and physiological sense but neither on the diagnostic performance in relation to specific diseases nor on comparisons between different vectorcardiography approaches or between VCG and 12-lead ECG; those issues are outside the scope of this study.

Methodological aspects, limitations, and implications
The time-limiting step of the recording phase was defined by the hysteresis of the ventricular repolarization adaptation to a change in heart rate which is minimum 3 min [18,21]. A 5 min resting period with closed eyes during silence therefore preceded a recording period �5min. This is different from the routines for recording clinical 12-lead ECGs, where the recording starts as soon as the electrodes have been attached and patient-related data has been entered into the recording system. In thorough QT testing for evaluation of the arrhythmogenic potential of pharmaceutical substances, however, a pre-recording period of 10 min is common (personal communication, Börje Darpö, MD PhD, Chief Scientific Officer, ERT 1 ).
The goal of our procedure was an entirely unbiased process to identify stable 50s-periods of the entire recording for selecting at least one "qualified segment" free of noise and baseline drift. And within "the best" qualified segment (lowest instability value) select a representative 10s-saQRST complex for subsequent operator-independent calculation of VCG parameters. A fully automatic system also needs a built-in warning signal advising the user of the possibility of disturbances potentially affecting the precision/reliability of VCG parameters. Our quality measure-the instability value-serves this function by evaluating the variability between consecutive saQRST complexes. Such instability may, however, be due both to external sources (noise) and to physiological or abnormal pathophysiological variability. Increased heart rate (or RR) variability might be due to physiological sinus arrhythmia or to sinus node dysfunction [22]. Atrial fibrillation is another reason for increased and completely random RR variability. Atrial fibrillation may also affect the precision of the VCG parameters by the continuous atrial activity superimposed on the QRST complex and not cancelled out by signal-averaging in the QRST complexes. Furthermore, increased ventricular repolarization variability is a salient feature of the long QT syndrome and other arrhythmia prone conditions [23][24][25]. Guided by the instability value, 70 recordings with the highest values were picked for manual scrutiny. The higher value, the more likely was external disturbances the source. Among the 48 recordings with values between 8.8 and 12, no selected 10s-saQRST complex had disturbances due to external sources. We therefore suggest that recordings with an instability value >12 should be manually inspected for signal quality and source of variability. Atrial fibrillation (9 recordings) and atrial flutter (although not observed in this study) as well as competing sinus and junctional rhythms (as in 2 participants in this study) are sources of signal instability. A high instability value might therefore signal the presence of such arrhythmias, which a closer inspection of the recording will confirm.
Assuming that not all VCG parameters would be equally sensitive to signal instability, we also performed an analysis regarding the relation between the instability value and the ranges of some VCG parameters reflecting ventricular repolarization duration and dispersion and the QRST-angles, as illustrated by Fig 3 and S5 Fig. The dispersion parameters were more sensitive to signal variability than the QT and QTpeak intervals as well as the QRS-T angles. This could be expected in view of the chosen procedure for calculating the instability value which was based on differences in sample values (Fig 1). Furthermore, the annotation point for the end of the T-wave, and consequently the value of the QT interval, was sensitive to the amplitude of the T-wave. This result corroborates previous observations by e.g. Vink et al. that a low and flat T-wave affects the measuring precision of the QT interval [26]. A low Tamplitude may therefore serve as another warning signal warranting manual scrutiny of the recording. When the Tamplitude exceeded 200μV there was rarely a problem in this study.
Our ultimate goal for the development of a computerized/automatic VCG analysis is to provide its user with reliable VCG parameters for clinical purposes such as risk prediction regarding cardiac death including sudden cardiac death [2][3][4][5][6][7][8][9][10][11]. A suitable risk marker should have as good reproducibility as possible, including all technical aspects and the individual timedependent variability. Calculating the coefficient of variation is one alternative for such assessment and independent of units, which we have used in the electrophysiological context before [19]. A coefficient of variation <10% is usually considered very good or excellent. The presented method gave lower coefficients of variation compared to selecting an early part of the recording. Furthermore, the spatial Peak and Mean QRS-T angles are scientifically but not clinically established risk factors for cardiac death and sometimes grouped together [2][3][4][5][6][7][8][9][10][11]. In this study, the Mean QRS-T angle had much better reproducibility than the Peak QRS-T angle (coefficient of variation 14 vs. 45%), which favors the former for risk assessment. A recent study from our group, however, suggests that both angles together rather than one of them alone should be used for risk evaluation, which is one clinical context in which VCG can contribute valuable and accurate information [11,13]. Another potential application would be in the prediction of the response to cardiac resynchronization therapy for heart failure and the timing of stimulation intervals [27,28].
The QT interval has a scientifically and clinically established position as risk marker, especially in patients with the long QT syndrome [26]. The VCG based QRST complex allows the measurement of the QT interval unaffected by the T loop axis, which varies individually with regard to any lead on the ECG. It thus meets the requirement for the global QT interval which some scientist advocate and try to obtain by measuring the interval between the first QRS onset and the last Tend in any of the 12 leads of the standard ECG [29]. It has also been shown that the global QT interval calculated from Frank VCG differentiates between LQTS mutation carriers and age-and sex-matched controls better than QT intervals from either automatically or manually assessed standard 12-lead ECG [30]. We showed that the global QT and QTc intervals had an excellent reproducibility at the 3%-level. The tangent method for defining the end of the T-wave, initially introduced as an alternative in special cases [31] gives a slightly shorter QT interval (10-15ms) than using the so called "threshold method" [26]. While some experts recommend both methods e.g. facilitated by a web-based QT calculator [26,31], the tangent method has been favored by others [32]. The tangent method is more suitable than the threshold method for studying ventricular repolarization changes on a beat-to-beat level during rapid heart rate increase according to our own experience [16][17][18]. We therefore decided on the tangent method for the entirely automatic VCG analysis of saQRST complexes so that the same automatic method could be used for analyses of beat-to-beat and steady-state signalaveraged cardiac cycles.
The participants in this study represent a population based sample 50 to 64 years old at enrolment and up to 65 years at completion of the protocol. The general idea of the SCAPIS study is to obtain various risk markers for cardiovascular and pulmonary disease at an age where interventions supposedly are able to change the outcome in a favorable direction [14]. If new risk markers provide additional prognostic value on top of the already established and can be amended is an ongoing part of SCAPIS but outside the scope of this study. We cannot rule out that our method when applied to a sicker cohort would need manual scrutiny in more recordings than in the present. In 38% of these recordings there were, however, some abnormalities, and when using an instability value >12 and a low Tamplitude (< 200μV) as signals of possible imprecision of the VCG parameters, we anticipate this method to work in any clinical cohort.
For a century it has been known, and part of clinical practice, to take into account the sex related difference in the QT interval [33]. This study illustrates that most VCG-based parameters of cardiac electrophysiology show sex-related differences on the group level which should be taken into account in clinical studies. The Peak QRS-T angle was 48% and the Mean QRS-T angle 30% wider in men than in women and an age-and sex-related difference in these and other VCG parameters has been reported before [6,8,34]. Our entire study cohort includes participants with various cardiovascular and other diseases as well as chronic medication with various substances in almost half of them, which potentially might affect the VCG parameters, e.g. diabetes and hypertension [11]. The sex-related differences remained, however, when comparing data from the 151 women and 168 men without any known diseases or chronic medication in our cohort. In a previous Frank VCG based study on LQTS patients and ageand sex-matched controls, which were on average between 30 and 40 years of age, similar sexrelated differences were observed [34].
Data from the present and the previous study may serve as a reference for apparently healthy men and women. Compared to a study from 1964, our data in healthy men were similar with regard to the comparable parameters QRSarea, Tarea and Ventricular gradient but the QRS-T angle was narrower in our men [35].
We have developed a method for recording and reliable analysis of Frank VCG which is ready for application in epidemiological studies such as the SCAPIS main study. Further development is, however, needed to achieve computerized on-line analysis with presentation of data and interpretation of their potential clinical implications before bedside use can be realized.

Conclusion
A reliable automatic method to acquire Frank VCG parameters reflecting cardiac electrophysiology for risk stratification and other purposes was developed. The method includes a quality measure which informs the user of signal variability that warrants manual scrutiny. The procedure proved feasible in 98.7% of 1094 participants in a population based cohort. Most VCG parameter values differed significantly between women and men and this difference should be taken into account in future studies. Recordings with high instability values (>8.8) were scrutinized to find its cause and to categorize it as either external to the study subject (noise) or internal and of physiological or pathophysiological origin. Panel a: ECG from a section within the selected segment with disturbances on the Y-lead (originating from the neck electrode); this cause is defined as "external". Panel b: ECG from a section within the selected segment with varying RR-intervals due to physiological sinus arrhythmia in a study subject with relatively low heart rate; this cause is defined as "internal". . These graphs show that in some individuals there were considerable variations in specified parameters despite low instability suggesting absence of external disturbances ("noise"). r s is the Spearman rank order correlation coefficient. (DOCX) S1 Table. Vectorcardiographic parameters in apparently healthy women and men. Vectorcardiographic parameters in the sub-group of 319 apparently healthy participants among the population sample of 1080 with comparisons between women and men (Mann-Whitney test).