Introduction

The electrocardiogram (ECG) is a vital tool for routine clinical assessment of cardiac electrical abnormalities. Patient differences in anatomy and electrophysiology both determine the ECG. Computational and experimental studies have demonstrated that torso-ventricular orientation can substantially affect the ECG, potentially confounding disease diagnosis, and anatomy rather than electrophysiology is the strongest contributor to ECG variability in healthy subjects [14]. Sex and body mass index (BMI) are strongly associated with differences in torso and heart anatomy, and thus it is crucial to take them into consideration in ECG interpretation [57].

Ischemic heart disease is the leading single cause of mortality worldwide, killing 0.1% of the global population per year [8]. Therefore, effective patient diagnosis of myocardial infarction (MI) and risk stratification for treatment selection are crucial for survival and quality of life [9]. There is a higher incidence of missed diagnosis of acute MI in women, and hospital care can be less aggressive [1012]. This is a potential contributor to the higher female mortality following MI [13], alongside factors such as differing demographic risk characteristics and comorbidities [14, 15].

Current guidelines using primarily left ventricular ejection fraction (LVEF) fail to identify the majority of sudden cardiac death (SCD) cases, prompting calls for further research [16]. Several ECGbased biomarkers have been proposed based on mechanistic knowledge on the underlying electrophysiological substrate post-MI. QRS duration and its dispersion have been a key component of proposed electrocardiographic risk stratification for SCD following MI. However, findings of its effectiveness are mixed, with some trials suggesting it is a predictor of arrhythmic risk following MI [17, 18], but others finding that it is more likely a predictor of general mortality than arrhythmic inducibility [19, 20].

T wave amplitude and ST segment changes are also important, reflecting repolarisation heterogeneity [21] and ST-elevation MI (STEMI) mandating immediate reperfusion therapy [22]. ECG abnormalities are caused by alterations in the electrophysiological substrate introduced by the infarct, but importantly they are modulated by anatomical factors such as heart size, location and orientation with respect to the ECG leads [2, 3].

Women’s ECGs typically exhibit shorter QRS durations and lower ST junction (STj) and T wave amplitudes, but longer QT intervals, than male [23]. Both electrophysiological and structural factors contribute to these differences. Testosterone increases repolarising potassium currents and decreases L-type calcium currents, both acting to speed up repolarisation [5]. Additionally, left ventricular mass is smaller in women than men [24], explaining in part the shorter QRS duration and lower STj and T wave amplitudes [25, 26]. Smaller torso volume can also lead to larger QRS and T wave amplitudes in women [1, 2] , but the impact on STj amplitude and whether anatomy is the only factor explaining these differences is unknown. In women, electrophysiological remodelling postinfarction may be less substantial than in men, partially from the protective effects of estrogen [27]. Investigations are urgently needed to fill these gaps for improvements in patient diagnosis, risk stratification, and treatment selection.

This study aims to quantify sex-differences in heart-torso anatomy and ECG biomarkers, as well as their relative associations, in healthy and post-MI subjects. To enable a population-wide study of heart-torso anatomy, we first develop and validate an automated image processing pipeline to reconstruct three-dimensional torso anatomical models using clinically standard cardiac magnetic resonance (CMR) images. We hypothesise that sex-differences in ECG biomarkers are only partially explained by smaller female heart and torso anatomies, and that sex-differences in electrophysiology and torso-hear orientation are particularly important, especially post-MI. These insights will lay the groundwork for a process to correct for the impact of torso-ventricular anatomy on the ECG, enabling personalised, automated ECG interpretation.

Methods

Computational pipeline

Figure 1A illustrates the fully automated pipeline used to create personalised torso anatomical reconstructions from clinically standard CMR imaging. This integrates and reformulates state-of-the-art image processing techniques in order to give the first fully automated, and extensively validated, torso-ventricular reconstruction pipeline of its kind.

Structure and validation of novel, automated torso reconstruction pipeline.

A: proposed end-to-end automated 3D torso reconstruction pipeline from 2D standard clinical cardiac magnetic resonance scans. The torso contours are first extracted from the images. A SSM is fitted to the contours, which is then optimally deformed. SSM: statistical shape model, α: spin of the cardiac short axis plane around the torso vertical axis, β: verticality of the cardiac long axis, γ: tilt of the cardiac short axis plane. B: (i) comparison of Dice coefficient between single stage contouring (blue) and 3 stage segmentation, postprocessing and refinement (red). (ii) surface-to-contour distance for an example case between the automatically reconstructed surface and the automatically generated torso contours. (iii) surface-to-surface distance between the torso mesh created using the automated pipeline and the manually annotated contours for the subjects with the smallest (left) and largest (right) electrode error respectively.

In short, the pipeline combines machine learning-based segmentation and contour extraction, statistical shape modelling and automated mesh deformation in the following steps:

Three-stage torso contour extraction from CMR imaging using machine learning to form sparse torso representation

Approximately 60 localiser and scout images per subject were first segmented using a convolutional neural network; then their outline was extracted with automated post-processing, and finally refined using a second network. U-Net [28] was used for both network architectures, as described in Smith et al. [29].

Fitting sparse representation contours to a statistical shape model of the human body to give an initial fitted torso

To generate torso meshes from sparse torso contours, a statistical shape model (SSM) of human body shapes made from a large optical scan dataset was fitted [30, 31]. As described in Supplementary Appendix 1.2.1, the principal components of the SSM were iteratively adjusted, alongside rigid transformations of the SSM in order to minimise distance between the surface and contours.

Automated deformation of the initial torso towards the extracted contours using thin plate splines to give a final dense torso mesh

As the fitted surface is inherently limited by variability in the SSM, a final deformation step was applied in order to better capture inter-subject variation. A thin plate splines method was used to pull the surface towards the contours, whilst retaining smoothness and regularity [32], as described in Supplementary Appendix 1.2.2. Laplacian smoothing, decimation, and affine transformation were applied to ensure the local geometric and topological characteristics of the reconstructed mesh.

Integration with a sparse cardiac mesh and subsequent extraction of torso-ventricular anatomical parameters

Cardiac surfaces were segmented using the method in Banerjee et al. [33] and torso-ventricular anatomical parameters were extracted, as detailed in Supplementary Appendix 1.3. The torso volume and two metrics of cardiac size were estimated. The locations of the ECG electrodes were identified on the mean SSM torso, and their positions were transformed with the mesh such that the resulting torso had electrodes located in equivalent locations. The position of the heart centre relative to the electrodes was estimated in the x (lateral), y (posterior) and z (superior) directions. The orientation of the heart was quantified by the Euler angles of the cardiac axes with respect to the torso axes. This includes the spin of the cardiac short axis plane around the torso vertical axis, the verticality of the cardiac long axis, and the tilt of the cardiac short axis plane.

Validation of the torso reconstruction pipeline

The CMR images of 30 subjects, chosen to be representative of the underlying dataset, were manually annotated to form an independent test set for validation. Final results of the three-stage torso contour extraction process were compared with simply using a single U-Net architecture to process raw images directly to refined contours in order to assess the accuracy of the torso-air boundary placement. Separate reconstructions of the 30 test subjects were made using the fully automated pipeline and using manually annotated contours. For each subject, the surface-to-surface distance between the two reconstructions was calculated to evaluate error propagation from contouring to reconstruction, as detailed in Supplementary Appendix 1.4. The mean surface-to-contour distance was calculated for each test subject to evaluate the quality of the reconstruction.

Dataset

The UK Biobank (UKB) dataset [34] was chosen for its high quality CMR imaging and 12-lead ECGs in a large population. 1646 control subjects were randomly selected from the UKB cohort alongside the 479 subjects with a history of MI, as defined in Supplementary Appendix 1.1. The healthy cohort was made by excluding control subjects with disease diagnoses, and subjects in either population were excluded if their ECG or imaging data was not complete, as described in Supplementary Appendix 1.1. The final population for reconstruction and statistical analysis comprised 1051 healthy and 425 post-MI subjects (total 1476), as shown in Tables 1 and 2. 92.7% of subjects identified as White British. The post-MI population was 6.1±0.4 years older and had 2.4±0.2 kg/m2 higher BMI, with no statistically significant differences in ethnicity. This data was obtained through UK Biobank Resource under Application Number ‘40161’ and the data was processed according to their guidelines. All participants gave written informed consent before enrolment in the UK Biobank cohort.

Demographic characteristics of the 1476 subjects from the UK Biobank cohort.

Disease and treatment characteristics of 425 post-MI subjects from the UK Biobank cohort.

Continuous variables are shown as mean ± standard deviation and categorical variables as number of subjects (percentage in bracket). The p-value refers to the null hypothesis that the mean, or proportion in a category, is equal in the healthy and MI subpopulations. Distributions of continuous variables were tested for normality and equal variance, and the appropriate statistical test was selected, as outlined in the statistical methods Supplementary Appendix 1.5. χ2-tests were performed to assess the proportions of subjects for categorical variables. MI: myocardial infarction, BMI: body mass index.

Categorical variables as number of subjects (percentage in bracket). χ2-tests were performed to assess the proportions of subjects with each disease or treatment. The p-value refers to the null hypothesis that the proportion in a category is equal in the male and female subpopulations. Surgical treatment information is sourced from hospital records, whereas disease information is obtained from multiple sources including hospital records, primary care and self-report.

Statistical analysis

ECG parameters were obtained from the UK Biobank database, which were automatically extracted with the proprietary software Cardiosoft [35]. The distribution of each anatomical and ECG parameter was compared between populations as in Supplementary Appendix 1.5. STj amplitude refers to the amplitude of the ST segment measured at the junction point (the end of the QRS complex). The contribution of each anatomical parameter to the sex difference in ECG biomarkers, and the remaining estimated effect of electrophysiology, were calculated by regression analysis, as detailed in Supplementary Appendix 1.5. Similarly, their contribution to the difference between healthy and post-MI ECG biomarkers was estimated. A linear model was trained to estimate, and therefore correct, the total anatomical contribution to ECG parameters using only demographic features, as described in Supplementary Appendix 1.5.

Results

Reconstructed torso surfaces matched input contours to within 2.19mm

Figure 1B showcases the capability of the computational pipeline to extract torso contours and reconstruct them into 3D meshes. The three-stage segmentation, automated post-processing, and refinement procedure improved the Dice coefficient of torso contour extraction, compared to a single-stage contouring network, across all image views (Figure 1B(i)). The median surface-to-contour distance, showing the quality of the reconstructed torso surface (Figure 1B(ii)), for the test subjects was 2.19mm (inter-quartile range - IQR: 1.98–2.37mm). The median surface-to-surface distance between torso meshes reconstructed using the manually annotated contours and the machine learning pipeline for the 30 test subjects was 0.82mm (IQR: 0.69-1.10mm). Figure 1B(iii) shows the reconstructed surfaces for the test subjects with the smallest and largest median reconstruction errors. Both reconstructed surfaces were smooth and anatomically realistic, and, across most of the torsos, errors are within the millimetre range.

Torso volume was larger in post-MI than in healthy subjects in women and men (by 3.7±0.9 dm3 (10.2±3.3%) and 3.5±0.5 dm3 (8.2±1.9%) respectively (Supplementary Figure 3). Additionally, for women, in post-MI the heart was positioned more posteriorly by 3.1±0.9mm, than in healthy subjects. The heart was also oriented with its long axis more horizontally by 6.0±1.2° and 4.3±0.5° in post-MI versus healthy women and men, respectively. These changes were related to the increased BMI of post-MI subjects (Supplementary Figure 3K). Age was also considered (Supplementary Figure 3J), but its effects were considerably less substantial.

QRS duration was shorter in women than in men, particularly post-MI, due to smaller hearts and reduced impact of electrophysiological abnormalities

For both healthy and post-MI subjects, QRS duration was shorter in women versus men in all leads (Figures 2A and 2B), with contributions from each anatomical factor displaying sex differences (Figures 2C and 2D). Each factor’s contribution is calculated from the product of the regression coefficients and anatomical sex differences (Supplementary Appendix 1.5). Sex differences in cavity volume explained approximately half of the sex difference in QRS duration in both healthy and postMI subjects (a mean value across all leads of 3.4±1.3ms out of the 6.0±1.5ms mean total in healthy, and 4.5±1.4ms of a total sex difference of 8.3±2.5ms in post-MI). In healthy subjects the electrophysiological contribution to QRS sex differences was similar in all precordial leads (1.0±1.0ms to 2.3±1.2ms). In post-MI subjects, it was considerably more variable (0.2±2.8ms in V1 to 6.3±3.0ms in V6), possibly due to the infarct area.

Sex differences in QRS duration in healthy and post-MI subjects.

A, B: mean QRS duration for each ECG lead in healthy and post-MI subjects respectively with women (red circles) and men (cyan triangles). C,D: contribution of anatomical parameters and electrophysiology to sex differences in QRS duration (QRSd) for healthy and post-MI subjects (calculated by multiplying the regression coefficient for each factor by its mean difference between male and female populations). E, F: mean QRS durations for each ECG lead in men and women respectively for healthy (black squares) and post-MI (red diamonds). G,H: contribution of anatomical parameters and electrophysiology to differences in QRS duration (QRSd) between healthy and post-MI subjects for male and female subjects (calculated by multiplying the regression coefficient for each factor by its mean difference between healthy and post-MI populations). Female y-axis limits have been adjusted by the difference in healthy QRS duration between sexes for ease of comparison.

Post-MI women exhibit less QRS prolongation than men (Figures 2E and 2F), with mean percentage increase in QRS duration from healthy to post-MI, across all leads, of 3.4±2.3% and 5.8±1.5% respectively. This is explained by a reduced contribution of electrophysiological abnormalities post-MI in women, as shown in Figures 2G and 2H (smaller grey bars).

For lead V6, 15.9% of healthy subjects had an estimated anatomical QRS difference of over 5ms from a subject with mean anatomical parameters. After correction by a linear model that was trained only on demographic features (sex, height, BMI, and age), this proportion reduced to 5.1%.

STj amplitude is lower in women than men in both healthy and post-MI subjects, explained by smaller hearts in more superior and posterior position

STj amplitude was lower in women versus men, particularly in the septal and anterior leads in healthy and post-MI subjects (Figures 3A and 3B). As for QRS duration, this can be partly explained by women’s smaller LV mass (by 29.3±5.4% and 27.1±5.7% in healthy and post-MI subjects respectively), but also by a more superior position for healthy subjects (by 9.6±0.9mm) and more posterior position for post-MI subjects (by 4.3±1.0mm) (Figures 3C and 3D). Both smaller LV mass and electrophysiology contribute to lower STj amplitude, whereas a smaller torso volume was generally associated with a higher STj amplitude (yellow and grey versus orange bars in Figures 3C and 3D). This pattern was consistent for differing measurement times of the ST level (Supplementary Figure 6). Baseline STj amplitude in lead V4 was 0.028±0.003mV lower in healthy women than healthy men. Healthy women with BMI>25kgm-2 had a STj amplitude 0.047±0.004mV lower than healthy men with BMI<25kgm-2associated with their smaller ventricles, but larger torsos.

Sex differences in ECG amplitudes in healthy and post-MI subjects.

A, B: mean STj amplitude (measured at QRS offset) for each ECG lead in healthy and post-MI subjects respectively with women (red circles) and men (cyan triangles). C, D: contribution of anatomical parameters and electrophysiology to sex differences in STj amplitude for healthy and post-MI subjects (calculated by multiplying the regression coefficient for each factor by its mean difference between male and female populations). E, F: mean T wave amplitude (TWA) for each ECG lead in men and women respectively for healthy (black squares) and post-MI (red diamonds). G, H: contribution of anatomical parameters and electrophysiology to differences in T wave amplitude (TWA) between healthy and post-MI subjects for male and female subjects (calculated by multiplying the regression coefficient for each factor by its mean difference between healthy and post-MI populations). Female y-axis limits have been adjusted by the difference in healthy T wave amplitude between sexes for ease of comparison.

T wave amplitude (TWA) following MI is more strongly associated with a more posterior cardiac position and more horizontal orientation in women than men

Precordial TWA was lower in women than men, by 41.7±20.3% and 31.2±20.0% in healthy and post-MI populations respectively (Supplementary Figure 7). MI resulted in reduced TWA, in all leads in men, whereas only in V4-6 and limb leads in women (Figures 3E and 3F). For men, this was largely associated with electrophysiological factors substantially reducing TWA across leads (Figure 3G). However, for women, the reduced precordial TWA was largely associated with more posterior and horizontal ventricles from their larger BMI (Figure 3H), and electrophysiological factors actually counteracted the TWA post-MI reduction for septal leads (shown as positive contributions).

R axis deviations following MI are associated with more horizontal cardiac orientation in women, but MI-related electrophysiological abnormalities in men

Whereas the previous ECG parameters can be assessed in individual leads, ECG-derived axis angles are a composite metric, positively correlated with amplitudes in leads such as lead aVF, and negatively correlated with lead I [36]. Figure 4A breaks down the anatomical contributions to R and T axis shifts in post-MI compared with healthy subjects. For men, the electrophysiological contribution dominates their 12.0±2.8° left deviated R axis following MI. However, for women their 5.3±4.0° left deviation in the R axis is mainly associated with a more horizontal cardiac long axis, with electrophysiological factors playing very little role (Figure 4B). This is partly explained by female R axes being more sensitive to changes in verticality - the regression coefficient between R axis and verticality is higher for women than men (Figure 4C). The female T axis was more right deviated than male, largely associated with electrophysiology (Figures 4A and 4B), with less contribution from orientation (Figure 4D).

Sex differences in ECG axis angles in healthy and post-MI subjects

A, B: contribution of anatomical parameters and electrophysiology to differences in R and T axis angles between healthy and post-MI subjects for male and female subjects (calculated by multiplying the regression coefficient for each factor by its mean difference between healthy and post-MI populations). C, D: normalised regression coefficients showing the association between the verticality of the cardiac long axis and the R and T axes respectively for the healthy and post-MI populations. Bars shown in red represent regression coefficients significantly different from 0, at a significance level of 0.05. E, F: normalised regression coefficients showing the association between torso volume and the R and T axes respectively for the healthy and post-MI populations.

Torso volume significantly affected R axis for both sexes in healthy, but not post-MI subjects (Figure 4E, regression coefficient of R axis against torso volume). For example, in healthy women, every 10dm3 increase in torso volume was associated with a decrease in R axis of 7.2±3.0°. This was related to increased distance to the LL electrode (inversely related to the R axis) without as substantial an increase in distance to the LA electrode (positively related to the R axis). For healthy women, every 10dm3 increase in torso volume was associated with an increased distance to the heart centre of 19.4±0.7mm and 5.9±0.6mm for the LL and LA electrodes, respectively. However, in post-MI women, the gap between these differences was smaller, with corresponding increased distances of 16.6±1.8mm and 8.3±1.7mm. This association was less strong for the T wave (Figure 4F).

Discussion

This study provides quantification of sex differences in image-based anatomical factors and their implications for ECG biomarkers in healthy and post-MI subjects, enabled by a novel computational clinical image processing pipeline. With this work, we aim to contribute to addressing the higher incidence of missed diagnosis and increased female MI mortality following infarction [12, 13, 37]. Our analysis of a large cohort of healthy and post-MI subjects’ images and ECG data provides quantitative evidence on the importance of considering demographic characteristics and their anatomical differences, particularly sex, for corrections of ECG biomarkers, key to patient risk stratification

An important contribution is the novel computational pipeline for automated 3D torso reconstruction, which enables high-throughput investigations into the effects of anatomical variability on the study of a wide range of cardiac diseases. The adaptation of the pipeline to standard clinical cardiac imaging allows for the exploitation of extensive databases, such as the UK Biobank, and sets the groundwork for clinical tools to personalise ECG interpretation considering patient anatomy.

Our analysis provides the following insights into sex-related anatomical differences on the impact of myocardial infarction on key ECG biomarkers: 1) Half of the shorter QRS durations in women are explained by smaller cavity volumes in both healthy and post-MI subjects. 2) Female STj amplitude is lower than male in all precordial leads for healthy and post-MI subjects, associated with a smaller LV mass and more superior and posterior position. 3) In women, anatomical factors have a stronger effect in TWA changes following MI than in men. 4) R axis is more left deviated in MI than healthy populations; for women this is associated with a more horizontal cardiac long axis, but for men with electrophysiology.

Both clinically and moderately prolonged QRS durations have been associated with increased risk following MI [17, 18]. Importantly, our analysis reports that mean QRS duration would have to increase by 27% more for women than men to exceed 120ms and by 68% more to exceed 100ms, in lead aVL. Sex differences in QRS duration are only partly explained by cardiac size, in line with [1], and with the biophysical understanding that larger distances require longer to traverse [38]. Our findings suggest that corrected QRS duration taking into consideration demographics and their corresponding anatomical differences may improve risk stratification post-MI. QRS prolongation in post-MI subjects has been reported in previous studies, particularly cooccurring with ST changes in leads exploring the affected region [39]. It can be explained by slowed conduction velocity in the affected region, involvement of the conduction system such as the bundle branches and Purkinje, and in the chronic case, with dilation and hypertrophy of non-infarcted myocardium [19, 40, 41].

The finding that STj amplitude was substantially lower in women than men in all septal and anterior leads (V1-V4) is also striking. Based on our findings, the dual effects of cardiac and torso volume need to be considered in the interpretation of ST-elevation through the lens of the anatomical context of the patient. As we considered healthy and post-MI subjects (rather than with acute ischemia), our data reflect the normal baseline of STj amplitude, from which any deviations can be measured. The Fourth Universal Definition of Myocardial Infarction only has sex-specific thresholds in leads V2 and V3 for identifying ST-elevation, a key component in the diagnosis of ST-elevated myocardial infarctions (STEMIs) [42]. For example, in lead V4, the clinical threshold for both female and male ST-elevation is 0.1mV [42]. Based on our findings, due to their lower baseline values, overweight healthy women would need a 63% larger increase in STj amplitude to be classified as ST-elevated than normal weight healthy men. Therefore, this work represents a significant step forward in the characterisation of anatomical influences of its baseline level, from which deviations can then be more accurately identified in the context of anatomical variation. It also highlights the important intersectional effects of demographic characteristics such as sex and BMI, suggesting that both of these factors should be accounted for in assessing ST-elevation to improve accuracy of MI diagnosis and classification.

Alterations to the polarity and amplitude of the T wave are used in diagnosis of acute MI [42] and TWA affects proposed risk stratification tools, particularly markers of repolarisation abnormalities [9, 43]. Our data reveal that, particularly in women, a substantial proportion of TWA reductions are associated with anatomical differences, such as the decreased verticality of the postMI heart. This implies that without anatomical corrections, such as adjusting for BMI, the female TWA may be less representative of its underlying electrophysiology, and therefore less representative of any pathology. This increased effect of anatomical parameters in women is partly due to their larger difference in key anatomical factors such as posterior position and long axis orientation from healthy to post-MI subjects. This reflects their larger increase in BMI, associated with a more horizontal cardiac long axis, as described in previous works, suggesting this was related to an upwards shift in the diaphragm [6, 44]. Furthermore, the female TWA is more sensitive to changes in anatomical parameters. This could be explained by sex differences in the directions of the T wave vectors and nonlinearities in the structure-function relationships. Our finding that TWA is affected by cardiac position and orientation is in line with previous simulation studies [2] albeit in a small number of anatomies (N=5) and without electrophysiological variation.

Our data reveal that the verticality of the cardiac long axis is particularly significant in determining R axis angle, especially for women. This represents a step forward in understanding the complex relationship between electrical and anatomical axes [6, 45, 46]. Moreover, the leftdeviation of the R axis may look similar in both sexes; in men this is representative of an electrophysiological change, presumably alterations to the direction of the QRS vector caused by both hypertrophy and areas of electrical inactivity. However, for women this change is almost entirely associated with anatomical differences. This suggests that it is particularly important to correct R axis angles for anatomical factors in women to avoid misattribution of deviations to electrophysiological pathology. The significant relationship between torso volume and R axis angle for healthy subjects indicates that BMI may be a critical consideration when using ECG based biomarkers that are sensitive to axis angles. The fact that increased torso volume moved the LL electrode further away from the heart centre than the LA electrode suggests that this relationship is caused by a stretching of the anatomical plane in which these angles are viewed. Therefore, this represents another area in which a clinical tool that accounts for anatomical variation in interpreting ECG biomarkers would reduce differential accuracy in risk stratification between demographic groups.

The computational pipeline presented here is available to be applied to further studies. Validation is performed by demonstrating that the extracted contours are near the ground truth torso-air boundary on the clinical imaging, as well as to the final reconstructed surfaces (i.e. high Dice coefficient for contour extraction and low surface-to-contour distances). As detailed in Smith et al. [29], the three-step segmentation, automated post-processing, and refinement process was particularly effective at removing errors inside the torso at locations of sharp gradient between dark and light, for example due to air in the lungs. Whilst reconstructed 3D torso surfaces were largely smooth and realistic, there were small irregularities, generally on the shoulder and waist regions. These were not typically associated with incomplete CMR artifact removal and may instead result from images being taken on different breath-holds or the image sparsity. The low surface-to-surface distance between reconstructions made using the automatically and manually derived contours demonstrates that the small errors in contour extraction did not lead to significant errors in electrode placement on the torso meshes. Surfaces were generally more accurate on the upper left quadrant of the torso, which is where most electrodes are placed. The validity of the torso-ventricular reconstruction pipeline is further supported as known trends in torso and cardiac size, position, and orientation were qualitatively reproduced, and furthermore were quantitively characterised. This includes the more superior female cardiac position [47, 48] and the horizontal shift in the cardiac long axis for subjects with a larger BMI [6, 44]. As this pipeline uses clinically standard CMR imaging, it can be more easily translated to a clinical tool to correct for the effect of anatomical variation on the ECG in a variety of medical contexts.

Due to the demographics of the UK Biobank [34], this study only included subjects aged 4580 years old; however, the incidence of MI is very low in people younger than this range [13]. The ethnic background of the dataset also had limited diversity; however, this is roughly representative of the UK Biobank population and thus the ethnic composition of the UK at the time of recruitment [49]. As databases become more diverse, the mediating effect of ethnic background on the cardiac structure-function relationship should be investigated. Whilst the healthy subjects had a roughly equal sex balance, the post-MI subjects had a male-female ratio of approximately 4:1, in line with sex differences in diagnosed MI events [50]. The statistical shape model used for initial torso reconstruction did not have separate male and female models, which may have led to an underestimation in the sex differences in the torsos of male and female anatomies. However, the deformation step of the reconstruction was designed to address this issue by modelling personalised torso variations. The exact electrode positions of the obtained ECGs were not available in the UK Biobank dataset, so these were estimated by placing the electrodes on standard positions on the personalised torso. However, this estimation process allows for use of many similar clinically standard datasets, avoiding complex acquisition protocols. As the anatomical factors cannot represent a perfectly complete and independent basis set, the electrophysiological contribution can only be estimated. However, as there is more anatomical variation than can be represented using the given factors, such as the smaller scale geometry of the heart, the role of the anatomy versus electrophysiology was likely under-rather than overestimated. Whilst the study benefits from the electrophysiological and anatomical variation that using clinical data facilitates, it is impossible to fully separate the effects of these factors on ECG biomarkers, as characteristics such as sex affect both categories, making them interdependent. This means that this work complements computational studies, which have less interpersonal variability, but isolate the effect of positional and rotational changes. Scar characteristics were not available in the UK Biobank, but the effect of scar geometry variation could be considered in future studies with the development of scar delineation tools. Future work should focus on the characterisation of ECG biomarkers in myocardial infarction and other disease conditions. The automated torso reconstruction pipeline this work proposes enables the expansion of the number of anatomies such future computational studies would investigate.

Conclusion

To conclude, this work presents a novel automated pipeline for personalised torso reconstruction and demonstrates its power in exploiting large clinical databases by relating torso-ventricular anatomy and ECG biomarkers for 1051 healthy and 425 post-MI subjects. Results show the considerable influence of anatomical factors in demographic differences of ECG biomarkers. Women and individuals with higher BMI may be disproportionately affected. This underlines the importance of, and lays the foundations for, personalised ECG interpretation that considers a subject’s individual torso-ventricular anatomy, facilitating improvement in diagnosis and risk stratification tools.

Supplemental Materials

Supplementary Appendix 1: Methods

1.1 Dataset

Myocardial infarction (MI) was defined as any history of MI including ST- and non-ST-elevation MI, as obtained from patients’ self-report in the baseline questionnaire and nurse-led interview, and linked hospital admission data [51]. The exclusion criteria for the subjects used in the larger statistical analysis are shown in Supplemental Figure 1. From the 1646 controls, 3 cases were excluded for incomplete image sets, and 592 were excluded for having at least one of 82 disease diagnoses in their UKB records, including circulatory system, renal, genitourinary, and endocrine disorders. The final set included 1051 ‘healthy’ controls (581 female and 470 male), as shown in the left panel of S1. From the 479 post-MI subjects, 6 were excluded for incomplete image sets, 13 for missing ECG data, and 35 were excluded due to their imaging occurring before the MI event, thus retaining 425 post-MI subjects (84 female and 341 male), as shown in the right panel of S1. To select the test set used to evaluate the automated pipeline, both male and female subjects in the control population were split into deciles by their BMI. Then each decile was evenly sampled to create a test set that spanned the range of BMI for both sexes. The range of ages of the test subjects was then calculated to ensure that they represented the underlying population.

Exclusion pipeline for reconstruction dataset.

Both healthy and postmyocardial infarction (MI) subjects were required to have sufficient images across the view subtypes to reconstruct the torso and cardiac geometries. Subjects also were excluded if the ECG was missing or invalid (all healthy subjects had completed ECG). In the healthy dataset, subjects with at least 1 of 82 disease diagnoses were omitted, including circulatory system disorders, renal disease, genitourinary disorders, and endocrine disorders. The most common reason for exclusion was primary hypertension. Post-MI subjects were excluded if the recorded date of the MI event was after that of the imaging visit where the CMR images and ECG were taken.

Note that the UKB protocol for imaging and ECG involved both being performed in a supine position.

1.2 Reconstruction

To generate the initial 3D torso mesh, a statistical shape model (SSM) was applied over the automatically extracted sparse torso contours in 3D space, which was then optimally deformed by minimising the distance to the extracted contours to produce the final 3D torso mesh.

1.2.1 Fitting the SSM

In order to generate the torso meshes from the sparse torso contours, a highresolution statistical shape model (SSM) of human body shapes, was employed for the initial 3D torso reconstruction. The SSM was generated from the 3D optical body surface scanning of 4308 subjects in the CAESAR study, the largest commercially available scan database to date [30]. Detailed information on the SSM generation is provided in [31]. As the initial condition, the mean SSM was translated into the subject’s coordinate system by positioning the centre of heart from the mean SSM onto the centre of the subject’s heart. The latter centre was approximated by the closest point to the intersection lines between the cine short axis (SAX) and long axis (LAX) slices. Over the automatically extracted sparse torso contours in 3D space, the SSM was fitted by the optimal estimation of principal components, followed by rigid transformation, such that:

where Ci is the ith point on sparse torso representation, the mean shape model, Φ = (ϕ1, ϕ2, ...) the SSM modes of variations, q the estimated set of parameters along the principal modes, and R the rigid transformation. The fitting of the reconstructions was restricted to the first 40 principal components of the SSM.

1.2.2 Deforming for patient-specific torso reconstruction

The initial generated torso mesh is inherently limited by the variability in the SSM. Hence, in order to accurately capture subject-specific variations, a final deformation step was performed via approximate thin plate splines (TPS) [32] to produce the final 3D torso mesh, minimising the distance to the extracted contours. In case the automated torso contour extraction generated sparse outlier points, any torso points over the 95th percentile were removed.

The initial deformation field was computed by considering the closest point on the SSM-generated mesh from the points on the sparse representation. A series of small, smooth deformations using approximate TPS was then applied to push the 3D mesh closer to the torso points, while preserving the smoothness and local topological properties [52]. Let F be the deformation field such that:

where {Pi} is the set of closest points on the surface Mt to the torso points {Qi} on the sparse model, and is the TPS functional using derivatives of order 2 and image dimensions 3. The deformation Mt+1 = F(Mt) was iteratively applied in a diffeomorphic manner, resulting in a composition of several smooth approximations approaching initial mesh M towards the sparse representation. Laplacian smoothing, decimation, and affine transformation were applied in the end to ensure the local geometric and topological characteristics of the reconstructed mesh. Finally, the torso surface was remeshed with a restricted Frontal-Delaunay algorithm using the mesh generator JIGSAW [53] with a specified element size of 1cm.

1.3 Definition of anatomical parameters

The torso volume was calculated using PyVista [54], as the volume enclosed by the reconstructed torso surface. The cardiac volume was estimated from the extracted cardiac contours [55]. Volume of the cavity was obtained using Simpson’s rule over the segmented endocardial surfaces - as described in Beetz et al. [56] this provides good estimates of cardiac volumes. Left ventricular (LV) mass was measured from the volume difference between LV epicardial and endocardial surfaces multiplied by 1.05 [57].

The x position (lateral) of the heart relative to the ECG electrodes was determined by setting the location of the most rightward electrode on the body as x = 0 and the most leftward as x = 1 and noting the position of the centre of the heart along this scale. y (posterior) and z (superior) positions were found similarly by setting the most frontward electrode as y = 0, backward as y = 1, downward as z = 0, and upward as z = 1.

For estimating the heart position, the intersection point of the LAX four-chamber plane, LAX two-chamber plane, and the middle slice of the SAX stack was identified. For estimating the heart orientation, the X-axis was first measured in the cardiac system as the intersecting line between the LAX four-chamber plane and the mid SAX slice, while the Z-axis was identified as the perpendicular line to the X-axis that passed through the LAX four-chamber plane. The Y-axis was estimated as normal to the XZ-plane. For calculating the Euler angles (α, β, γ), as shown in Figure 1A, the intersecting line, denoted as x’, between the XY-plane in the cardiac system and the xy-plane in the real (torso) coordinate system was first identified. α was measured as the angle between the x-axis in the real system and the intersecting line x’, essentially presenting the spin of the XY-plane around the z-axis. The γ angle was calculated as the angle between the X-axis in the cardiac system and the intersecting line, i.e., the tilt of the X-axis with respect to the xy-plane. β was measured as the angle between the Z-axis in the cardiac system and the z-axis in the real (torso) system, i.e., the verticality of the cardiac long axis. The calculations of the coordinate systems and angles are presented in the lower-left corner of Figure 1A.

1.4 Reconstruction validation

In order to evaluate the performance of the contour extraction procedure, reconstructions of 30 subjects made using the fully automated pipeline were compared with those made using manually annotated contours. A ray tracing method [58] was applied to obtain the distance between 3D torso surfaces. For each point on one surface, the normal to the surface was found, and the nearest intersection between that line and the second surface (in either direction) was obtained. Since the normal is not guaranteed to intersect the surface or may intersect at a point on the opposing side of the torso, the nearest neighboring point on the second surface was also found for each point. The minimum between these two distances was taken for each point as the surface-to-surface distance. The distance between each electrode location on the different torsos was also taken as a measure of similarity for the reconstructions. The mean surface-to-contour distance was calculated for each test subject to evaluate the quality of the reconstruction.

1.5 Statistical methods

Choice of ECG parameters. ECG parameters were chosen due to their availability in the UKB dataset (particularly their availability in all leads, which excludes parameters such as QT interval) and their relevance to diagnosis and risk stratification of myocardial infarction. A range of durations, amplitudes and axis angles were chosen in order to investigate the differing effect of anatomical parameters on each category.

Distribution of anatomical and ECG parameters for all subpopulations

Split violin plots were created to show the distribution of each anatomical and electrophysiological parameter separately for healthy males, healthy females, post-MI males and post-MI females. Outliers were removed, as defined by values that were more than three times the inter quartile range above the third quartile or similarly below the first quartile. Mean values of all biomarkers were compared between healthy and post-MI subjects of either sex, and male and female subjects of either MI status. The Shapiro-Wilk test was used to ascertain whether both subpopulations had a normal distribution. If there was significant evidence of non-normality, the Wilcoxon test was used. The Levene test was used to determine whether the subpopulations had an equal variance. If there was sufficient evidence of nonequal variance, the Welch’s t-test was used, otherwise, the standard t-test was used. For populations with statistically significant differences between them, arrows were drawn from the lower mean population to the higher mean population with stars denoting the statistical significance of the relationship. * denotes relationships with p-values between 0.05 and 0.01, ** between 0.01 and 0.001, *** between 0.001 and 0.0001 and **** less than 0.0001. The mean and standard deviation of each anatomical and ECG biomarker was recorded, alongside the p-values for differences between subpopulations.

Age and body mass index (BMI) association

Each anatomical parameter was separately regressed against age for the healthy male, healthy female, post-MI male and post-MI female populations. This was repeated against BMI. This was recorded in a heat map and associated table, with the confidence intervals and two-sided p-values for the regression coefficient to be non-zero.

Normalised correlation coefficients

As the two measures of cardiac size (total cavity volume and left ventricular mass) were highly colinear, one was selected for each ECG biomarker depending on the minimisation of mean Akaike information criterion (AIC) across the 12 leads. For each lead, the ECG parameter was regressed against the chosen cardiac size parameter, torso volume, the relative heart centre positions in the x, y and z directions and the three cardiac orientation parameters (spin, verticality and tilt). In order to compare the regression coefficients for anatomical and ECG parameters on different scales, the regression coefficients were normalised by multiplying by the standard deviation of the anatomical parameter and then dividing by the standard deviation of the ECG biomarker, before being plotted. This was done separately for the healthy male, healthy female, post-MI male and post-MI female populations.

Sex differences

The contribution of each anatomical and electrophysiological parameter to the sex difference in an ECG parameter was estimated using linear regression as follows:

  1. Separate the population into post-MI and healthy populations and do the following procedure on each.

  2. Regress the ECG parameter against the anatomical parameters (cavity volume/LV mass, torso volume, relative heart centre positions in the x, y and z directions and the three cardiac orientation parameters), and also the sex categorical parameter.

  3. Calculate the difference in anatomical parameters between the male and female subpopulations.

  4. Multiply the anatomical sex difference in the parameter by its regression coefficient to give its estimated contribution to the sex difference in the ECG parameter.

  5. The regression coefficient for sex is the remaining sex difference when all of the chosen anatomical parameters were controlled for, so is taken as an estimate for the electrophysiological contribution to the ECG sex difference.

MI status differences

Similarly, the contribution of each anatomical and electrophysiological parameter to the difference between the post-MI and healthy populations was estimated using linear regression as follows:

  1. Separate the population into male and female populations and do the following procedure on each.

  2. Regress the ECG parameter against the anatomical parameters (cavity volume/LV mass, torso volume, relative heart centre positions in the x, y and z directions and the three cardiac orientation parameters), and also the healthy/post-MI categorical parameter.

  3. Calculate the difference in anatomical parameters between the healthy and post-MI subpopulations.

  4. Multiply the anatomical MI status difference in the parameter by its regression coefficient to give its estimated contribution to the MI status difference in the ECG parameter.

  5. The regression coefficient for MI is the remaining MI status difference when all of the chosen anatomical parameters were controlled for, so is taken as an estimate for the electrophysiological contribution to the ECG MI status difference.

Correction for anatomical contributions from demographic parameters in the healthy population

For each subject, the difference between the population mean anatomical parameter and the subject parameter was multiplied by the regression coefficient between the ECG biomarker and that anatomical parameter. These contributions were summed to give the overall contribution of anatomy to the difference between the ECG parameter of the hypothetical ‘mean subject’ and that subject. Then, a linear model was made estimating this anatomical contribution from the subject’s sex, height, BMI and age. This correction was subtracted from the anatomical contribution to give a corrected anatomical contribution for each subject.

Supplementary Appendix 2: Results

2.1 Anatomy-QRS duration relationship

Mean AIC across leads, a measure of prediction error, was lower with cavity volume than LV mass (12311 and 12316 respectively). Therefore, cavity volume was chosen as the representative of cardiac size for QRS duration.

2.2 Anatomy-STj amplitude relationship

Mean AIC across leads was lower with LV mass than cavity volume ([−4841 and −4834 respectively). Therefore, LV mass was chosen as the representative of cardiac size for STj amplitude.

The analysis for sex differences in the ST amplitudes was repeated with differing measurement times to examine the sensitivity of the ECG-anatomy relationship to the method of calculating ST amplitude. STX amplitude was defined as the amplitude at time QRS offset (J point) + RR interval/16. STE amplitude was similarly the amplitude at time QRS offset + RR interval/8. Whilst the overall scale of the amplitude was higher for STX than STj, and higher still for STE, the obtained pattern of anatomical contributions to the sex difference in amplitude was conversed. As for STj, the smaller female ventricles decreased anteroseptal ST amplitude, and smaller female torso increased anteroseptal ST amplitude, for each ST calculation point.

The analysis for STj amplitude was included in the main manuscript, as this is the point at which ST-deviation should be measured in acute myocardial infarction diagnosis, according to the Fourth Universal definition of myocardial infarction [42].

2.3 Anatomy-TWA amplitude relationship

Mean AIC across leads was lower with cavity volume than LV mass (−965 and −963 respectively). Therefore, cavity volume was chosen as the representative of cardiac size for TWA.

2.4 Anatomy-axis angles relationship

Mean AIC across R and T axes was lower with cavity volume than LV mass (1459 and 14660 respectively). Therefore, cavity volume was chosen as the representative of cardiac size for both axis angles.

Depiction of the relative coordinate system in which the heart position was measured.

A heart centre equidistant in the z direction to the highest (most superior) and lowest (most inferior) electrodes would have a relative z coordinate of 0.5.

Anatomical biomarkers and their relationship with age and BMI.

A-I Distributions of anatomical biomarkers. Horizontal lines show statistically significant differences between subpopulation means with arrows pointing to the larger mean. Heat map of correlation coefficients for each geometrical parameter with age (J) and BMI (K). Correlations with p>0.05 are shaded grey. CVol: total cavity volume, LVm: left ventricular mass, TVol: torso volume, x: lateral heart centre position, y: posterior position, z: superior position, Vert: verticality of the cardiac long axis. HM: healthy male, HF: healthy female, PM: post-MI male, and PF: post-MI female.

Distributions of ECG biomarkers.

Distributions of ECG biomarkers for healthy and post-MI populations and proportions of subjects with AV block and pathological Q waves. ST amplitude was measured at the J point (QRS offset), X point (QRS offset + RR interval/16) and E point (QRS offset + RR interval/8). Horizontal lines show statistically significant differences between subpopulation means with arrows pointing to the larger mean. Many distributions show features of non-normality, such as skew, heavy tails or bimodality. Post-MI subjects have longer PQ and QT intervals and P wave duration, and a lower T amplitude for both sexes. Post-MI males also have a slower heart rate, lower P amplitude, longer QRS duration, left-deviated R axis, and longer QTc. PostMI subjects are substantially more likely to have AV block and pathological Q waves. The T axis shows a higher variability in post-MI individuals for both sexes. AV: atrioventricular, QTc: corrected QT interval.

QRS duration-anatomy relationship.

Normalised regression coefficients with 95% confidence intervals for QRS duration in all ECG leads for healthy and post-MI subjects. CVol: total cavity volume, TVol: torso volume, x, y, z: x (medial), y (posterior), z (superior) coordinate of the heart centre relative to the electrodes, Vert: verticality of the cardiac long axis. Bars shown in red represent regression coefficients that are significantly different from 0, at a significance level of 0.05. QRS duration is shortened by a more vertical cardiac orientation (less negative β) for at least one sex in a majority of leads. Increasing cavity volume prolongs the QRS duration. QRS duration is largely unaffected by adjustments in the cardiac location. Unlike healthy subjects, for post-MI individuals QRS duration is largely unaffected by cardiac orientation. QRS duration again usually does not significantly vary with cardiac location. In most leads increasing the cavity volume prolongs the QRS duration.

Sex differences in ST amplitudes for differing measurement points in healthy and post-MI subjects.

A, B: mean STX amplitude (measured at QRS offset + RR interval/16) for each ECG lead in healthy and post-MI subjects respectively with women (red circles) and men (cyan triangles). C, D: contribution of anatomical parameters and electrophysiology to sex differences in STX amplitude for healthy and post-MI subjects (calculated by multiplying the regression coefficient for each factor by its mean difference between male and female populations). E, F: mean STE amplitude (measured at QRS offset + RR interval/8) for each ECG lead in healthy and post-MI subjects respectively with women (red circles) and men (cyan triangles). G, H: contribution of anatomical parameters and electrophysiology to sex differences in STE amplitude for healthy and post-MI subjects (calculated by multiplying the regression coefficient for each factor by its mean difference between male and female populations).

Sex differences in T wave amplitude in healthy and post-MI subjects.

A, B: mean T wave amplitude for each ECG lead in healthy and post-MI subjects respectively with women (red circles) and men (cyan triangles). C,D: contribution of anatomical parameters and electrophysiology to sex differences in T wave amplitude for healthy and post-MI subjects (calculated by multiplying the regression coefficient for each factor by its mean difference between male and female populations).

STj amplitude-anatomy relationship.

Normalised regression coefficients with 95% confidence intervals for STj amplitude in all ECG leads for healthy subjects. LVm: left ventricular mass, TVol: torso volume, x, y, z: x (medial), y (posterior), z (superior) coordinate of the heart centre relative to the electrodes, Vert: verticality of the cardiac long axis. Bars shown in red represent regression coefficients that are significantly different from 0, at a significance level of 0.05. Significant positional correlations generally follow the pattern that the closer the heart centre was to the position of the exploring electrode, the higher the STj amplitude. Increases in left ventricular mass are associated with increased STj amplitude in some of the precordial leads.

T wave amplitude-anatomy relationship.

Normalised regression coefficients with 95% confidence intervals for T wave amplitude in all ECG leads for healthy subjects. CVol: total cavity volume, TVol: torso volume, x, y, z: x (medial), y (posterior), z (superior) coordinate of the heart centre relative to the electrodes, Vert: verticality of the cardiac long axis. Bars shown in red represent regression coefficients that are significantly different from 0, at a significance level of 0.05. T wave amplitude in many leads increases as the heart is oriented more vertically (less negative β). Significant positional correlations generally follow the pattern that the closer the heart centre was to the position of the exploring electrode, the higher the T wave amplitude.

Axis angles-anatomy relationship.

Normalised regression coefficients with 95% confidence intervals for R axis (top) and T axis (bottom), in healthy (left) and post-MI (right) subjects. For healthy but not post-MI subjects, R axis is negatively associated with torso volume. R axis is significantly affected by cardiac orientation, but not T axis. CVol: total cavity volume, TVol: torso volume, x, y, z: x (medial), y (posterior), z (superior) coordinate of the heart centre relative to the electrodes, Vert: verticality of the cardiac long axis. Bars shown in red represent regression coefficients significantly different from 0, at a significance level of 0.05.

Mean and standard deviation values of anatomical and ECG biomarkers in each subpopulation.

Associations between age and BMI and anatomical biomarkers.

Data availability

The UK Biobank data is publicly available and can be accessed by application upon approval here: https://www.ukbiobank.ac.uk/enable-your-research/register. The reconstruction pipeline code is publicly available here: https://github.com/MultiMeDIA-Oxford/TORSO-MPP.

Acknowledgements

This research has been conducted using the UK Biobank Resource under Application Number ‘40161’. The authors would like to thank Dr Ernesto Zacur for providing valuable suggestions on the 3D anatomical mesh reconstruction.

Additional information

Funding

HJS is supported by a Wellcome Trust Studentship under Grant No. 102161/Z/13/Z. AB is supported by the Royal Society University Research Fellowship (Grant No. URF\R1\221314). The works of AB, RPC, and VG are supported by the British Heart Foundation (BHF) Project under Grant PG/20/21/35082. This work was funded by a Wellcome Trust Fellowship in Basic Biomedical Sciences to BR (214290/Z/18/Z) and the CompBioMed 2 Centre of Excellence in Computational Biomedicine (European Commission Horizon 2020 research and innovation programme, grant agreements No. 823712) to BR and VG.

Author contributions statement

HJS, BR, VG, and AB conceptualised the study and designed the research. BR, VG, RPC, and AB supervised the research. HJS and AB acquired and curated the dataset. AB and HJS developed the reconstruction pipeline. HJS, AB, YS, and MB pre-processed and cleaned the data. HJS and AB conducted the study and analysed the data and the results. HJS, AB, BR, and VG prepared the original draft and reviewed and edited the manuscript. All authors discussed the results, provided comments regarding the manuscript, and agreed on the final draft.