Skip to main content

lifex-fiber: an open tool for myofibers generation in cardiac computational models

Abstract

Background

Modeling the whole cardiac function involves the solution of several complex multi-physics and multi-scale models that are highly computationally demanding, which call for simpler yet accurate, high-performance computational tools. Despite the efforts made by several research groups, no software for whole-heart fully-coupled cardiac simulations in the scientific community has reached full maturity yet.

Results

In this work we present \(\texttt {life}^{\texttt {x}}\)-fiber, an innovative tool for the generation of myocardial fibers based on Laplace-Dirichlet Rule-Based Methods, which are the essential building blocks for modeling the electrophysiological, mechanical and electromechanical cardiac function, from single-chamber to whole-heart simulations. \(\texttt {life}^{\texttt {x}}\)-fiber is the first publicly released module for cardiac simulations based on \(\texttt {life}^{\texttt {x}}\), an open-source, high-performance Finite Element solver for multi-physics, multi-scale and multi-domain problems developed in the framework of the iHEART project, which aims at making in silico experiments easily reproducible and accessible to a wide community of users, including those with a background in medicine or bio-engineering.

Conclusions

The tool presented in this document is intended to provide the scientific community with a computational tool that incorporates general state of the art models and solvers for simulating the cardiac function within a high-performance framework that exposes a user- and developer-friendly interface. This report comes with an extensive technical and mathematical documentation to welcome new users to the core structure of \(\texttt {life}^{\texttt {x}}\)-fiber and to provide them with a possible approach to include the generated cardiac fibers into more sophisticated computational pipelines. In the near future, more modules will be successively published either as pre-compiled binaries for x86-64 Linux systems or as open source software.

Background

The human heart function is a complex system involving interacting processes at the molecular, cellular, tissue, and organ levels with widely varying time scales. For this reason, it is still among the most arduous modeling and computational challenges in a field where in silico models and experiments are essential to reproduce both physiological and pathological behaviors [1].

A satisfactorily accurate model for the whole cardiac function must be able to describe a wide range of different processes, such as: the propagation of the trans-membrane potential and the flow of ionic species in the myocardium, the deformation caused by the muscle contraction, the dynamics of the blood flow through the heart chambers and cardiac valves [2]. In particular, the dynamics of ionic species needs for accurate models specifically designed to reproduce physiological [3] and pathological scenarios [4, 5] (such as the ten Tusscher–Panfilov [6] and the Courtemanche-Ramirez-Nattel [7] ionic models for ventricular/atrial cells, respectively).

These demanding aspects make whole-heart fully-coupled simulations computationally intensive and call for simpler yet accurate, high-performance computational tools.

In this work we introduce \(\texttt {life}^{\texttt {x}}\)-fiber, an innovative tool for the generation of myocardial fibers based on \(\texttt {life}^{\texttt {x}}\) [8], an open-source, high-performance Finite Element (FE) numerical solver for multi-physics, multi-scale and multi-domain differential problems. It is written in C++ using the most modern programming techniques available in the C++17 standard and is built upon the deal.IIFootnote 1 [9] FE core. The code is natively parallel and designed to run on diverse architectures, ranging from laptop computers to High Performance Computing (HPC) facilities and cloud platforms. We tested our software on a cluster node endowed with 192 cores based on Intel Xeon Gold 6238R, 2.20 GHz, available at MOX, Dipartimento di Matematica, Politecnico di Milano, and on the GALILEO100 supercomputer available at CINECA (Intel CascadeLake 8260, 2.40GHz, see https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.3%3A+GALILEO100+UserGuide for more technical specifications).

Despite being conceived as an academic research library in the framework of the iHEART project (see Section “Funding”), \(\texttt {life}^{\texttt {x}}\) is intended to provide the scientific community with a Finite Element solver for real world applications that boosts the user and developer experience without sacrificing its computational efficiency and generality.

Fig. 1
figure 1

\(\texttt {life}^{\texttt {x}}\) modules: the library provides core functionalities and a framework for the numerical solution of the Finite Element problems described in Section “Laplace-Dirichlet rule-based methods”. \(\texttt {life}^{\texttt {x}}\)-fiber is the first publicly released heart module based on \(\texttt {life}^{\texttt {x}}\)

Since its initial development, \(\texttt {life}^{\texttt {x}}\) has served as the core block to build several modules for the simulation of the cardiac function, such as electrophysiology, mechanics, electromechanics, blood fluid dynamics, and myocardial perfusion [8], as displayed in Fig. 1. Such models have been recently exploited for a variety of standalone or coupled simulations both under physiological and pathological conditions (see, e.g., [4, 5, 10,11,12,13,14,15,16,17]).

As the present release focuses on modeling the cardiac fibers, in the next two paragraphs we will briefly review the physiology of myofibers and the most used mathematical methods to model them, describing in detail their implementation which is included within \(\texttt {life}^{\texttt {x}}\)-fiber.

Cardiac fibers: physiology and modeling

The heart is a four chambers muscular organ whose function is to pump the blood throughout the whole circulatory system. The upper chambers, the right and left atria, receive incoming blood. The lower chambers, the right and left ventricles, pump blood out of the heart and are more muscular than atria. The left heart (i.e. left atrium and left ventricle) pumps the oxygenated blood through the systemic circulation, meanwhile the right heart (i.e. right atrium and right ventricle) recycles the deoxygenated blood through the pulmonary circulation [1, 2]. The atria and the ventricles are separated by the atrioventricular valves (mitral and tricuspid valves) that regulate the blood transfer from the upper to lower cavities. The four chambers are connected to the circulatory system: the ventricles with the aorta through the aortic valve and pulmonary artery via the pulmonary valve; the left atrium with the left and right pulmonary veins, whereas the right atrium with superior and inferior caval veins [1, 2].

The heart wall is made up of three layers: the internal thin endocardium, the external thin epicardium and the thick muscular cardiac tissue, the myocardium. Most of the myocardium is occupied by cardiomyocytes, striated excitable muscle cells that are joined together in linear arrays. The result of cluster cardiomyocytes, locally organized as composite laminar sheets, defines the orientation of muscular fibers (also called myofibers). Aggregations of myofibers give rise to the fiber-reinforced heart structure defining the cardiac muscular architecture [18, 19].

Fig. 2
figure 2

a Representation of the multiscale cardiac muscle. b Anatomical dissection of myocardial fibers in ventricles (top) and atria (bottom). Images taken and readapted from [54,55,56,57]. Images were available either freely under a Creative Commons Attribution license or have been granted reuse permission by the copyright holder

A schematic representation of the multiscale myocardial fiber-structure is shown in Fig. 2. Ventricular muscular fibers are well-organized as two intertwined spirals wrapping the heart around, defining the characteristic myocardial helical structure [20, 21]. Local orientation of myofibers is identified by their angle on the tangent plane and on the normal plane of the heart, called the helical and the sheet angles, respectively [18, 22]. The transition inside the myocardial wall is characterized by a continuous, almost linear change in helical angle from about \(60^\circ\) at the epicardium to nearly \(-60^\circ\) at the endocardium [18, 21].

Atrial fibers architecture is very different from that of the ventricles, where myofibers are aligned in a regular pattern [18]. Indeed, myofibers in the atria are arranged in individual bundles running along different directions throughout the wall chambers [23, 24]. Preferred orientation of myofibers in the human atria is characterized by multiple overlapping structures, which promote the formation of separate attached bundles [25], as shown in Fig. 2.

The cardiac muscular fiber architecture is the backbone of a proper pumping function and has a strong influence on the electric signal propagation throughout the myocardium and also on the mechanical contraction of the muscle [26,27,28,29]. This motivates the need to accurately include fibers orientation in cardiac computational models in order to obtain physically sound results [3, 17, 30].

Due to the difficulty of reconstructing cardiac fibers from medical imaging, different methodologies have been proposed to provide a realistic surrogate of myofibers orientation [21, 31,32,33,34,35,36,37,38,39]. Among these, atlas-based methods map and project a detailed fiber field, previously reconstructed on an atlas, on the geometry of interest, exploiting imaging or histological data [21, 34, 39]. However, these methods require complex registration algorithms and their results depend on the original atlas data upon which they have been built.

Alternative strategies for generating myofiber orientations are the Rule-Based Methods (RBMs) [3, 32, 35,36,37, 40,41,42]. RBMs describe fiber orientations with mathematically sound rules based on histological and imaging observations and only require information about the myocardial geometry [18]. These methods parametrize the transmural and apico-basal directions in the entire myocardium in order to assign orthotropic (longitudinal, transversal and normal) myofibers [3].

A particular class of RBMs, which relies on the solution of Laplace boundary-value problems, is known as Laplace-Dirichlet Rule-Based Methods (LDRBMs), addressed in [31,32,33] and recently analyzed under a unified mathematical formulation [3]. LDRBMs define the transmural and apico-basal directions by taking the gradient of harmonic functions (the potentials) corresponding to suitable Dirichlet boundary conditions. These directions are then properly rotated to match histological observations [18, 20, 21, 23].

This initial release includes a generator for myocardial fibers based on LDRBMs [3], with application to a number of different prototypical and realistic geometries (slab models, left ventricles and left atria).

Laplace-Dirichlet rule-based methods

In this section, we briefly recall the LDRBMs that stand behind the myocardial fiber generation. In Section “Results and discussion” we will present several examples where we elaborate on how to reproduce and run the algorithms presented hereafter.

This getting started guide presents LDRBMs for (ventricular and spherical) slabs, (based and complete) left ventricular and left atrial geometries. For further details about the LDRBMs presented here see also [3].

The following common steps are the building blocks of all LDRBMs.

1. Labeled mesh::

A labeled volumetric mesh of the domain \(\Omega\) must be provided to define specific partition of the boundary \(\partial \Omega\) as

$$\begin{aligned} \partial \Omega = \Gamma _\text{epi} \cup \Gamma _\text{endo} \cup \Gamma _\text{base} \cup \Gamma _\text{apex}, \end{aligned}$$

where \(\Gamma _\text{endo}\) is the endocardium, \(\Gamma _\text{epi}\) is the epicardium, \(\Gamma _\text{base}\) is the basal plane and \(\Gamma _\text{apex}\) is the apex, which are demarcated through proper surface labels included in the input mesh. \(\texttt {life}^{\texttt {x}}\) is designed to support both hexahedral and tetrahedral labeled meshes in the widely used *.msh format [8], see Fig. 3. This type of mesh can be generated by a variety of mesh generation software (e.g. gmsh,Footnote 2netgen,Footnote 3vmtkFootnote 4 and meshtoolsFootnote 5). Otherwise, other mesh-format types can be converted in *.msh using for example the open-source library meshio.Footnote 6

Fig. 3
figure 3

a Hexahedral mesh of a ventricular slab. b Tetrahedral mesh of a realistic left atrium [38]

Fig. 4
figure 4

Labeled meshes. a Ventricular slab. b Spherical slab. c Idealized left atrium. d Idealized based left ventricle. e Realistic complete left ventricle. f Realistic left atrium. \(\Gamma _\text{base}\) denotes the basal plane, \(\Gamma _\text{apex}\) the apex, \(\Gamma _\text{endo}\) the endocardium, \(\Gamma _\text{epi}\) the epicardium, \(\Gamma _\text{lpv}\), \(\Gamma _\text{rpv}\) the left (right) pulmonary veins, respectively

Epicardium and endocardium::

for the ventricular slab geometry \(\Gamma _\text{endo}\) and \(\Gamma _\text{epi}\) are the lateral walls of the slab, see Fig. 4a; for the spherical slab, the ventricular and atrial geometries \(\Gamma _\text{endo}\) and \(\Gamma _\text{epi}\) are the internal and external surfaces, see Fig. 4b–f.

Basal plane and apex::

for the ventricular slab geometry \(\Gamma _\text{base}\) and \(\Gamma _\text{apex}\) are the top and bottom surfaces, respectively (see Fig. 4a); for the spherical slab, \(\Gamma _\text{base}\) and \(\Gamma _\text{apex}\) are selected as the north and south pole points of the epicardial sphere (see Fig. 4b); for the based ventricular geometry \(\Gamma _\text{base}\) is an artificial basal plane located well below the cardiac valves (see Fig. 4d), whereas for the complete ventricular geometry \(\Gamma _\text{base}\) is split into \(\Gamma _\text{mv}\) and \(\Gamma _\text{av}\), representing the mitral and aortic valve rings, respectively (see Fig. 4e); for the ventricular geometries \(\Gamma _\text{apex}\) is selected as the epicardial point furthest from the ventricular base (see Fig. 4d, e); for the atrial geometry \(\Gamma _\text{base}\) is the mitral valve ring and \(\Gamma _\text{apex}\) represents the apex of the left atrial appendage (see Fig. 4c–f);

Atrial pulmonary rings::

the atrial geometry type also requires the definition of the boundary labels for the left \(\Gamma _\text{lpv}\) and right \(\Gamma _\text{rpv}\) pulmonary vein rings, see Fig. 4c–f.

2. Transmural direction::

A transmural distance \(\phi\) is defined to compute the distance of the epicardium from the endocardium, by means of the following Laplace-Dirichlet (LD) problem:

$$\begin{aligned} \left\{ \begin{aligned} -\Delta \phi&=0,&\qquad&{\text {in }}\Omega , \\ \phi&= 1,&\qquad&{\text {on }}\Gamma _\text{epi}, \\ \phi&= 0,&\qquad&{\text {on }}\Gamma _\text{endo}, \\ \nabla \phi \cdot \textbf{n}&=0,&\qquad&{\text {on }}\partial \Omega \setminus (\Gamma _\text{endo} \cup \Gamma _\text{epi}). \end{aligned} \right. \end{aligned}$$
(1)

Then, the transmural distance gradient \(\nabla \phi\) is used to build the unit transmural direction:

$$\begin{aligned} \widehat{\varvec{e}}_t=\frac{\nabla \phi }{\Vert \nabla \phi \Vert }. \end{aligned}$$
3. Normal direction::

A normal (or apico-basal) direction \(\varvec{k}\) (which is directed from the apex towards the base) is introduced and used to build the unit normal direction \(\widehat{\varvec{e}}_n\):

$$\begin{aligned} \widehat{\varvec{e}}_n = \frac{\varvec{k} - (\varvec{k} \cdot \widehat{\varvec{e}}_t )\widehat{\varvec{e}}_t}{\Vert \varvec{k} - (\varvec{k} \cdot \widehat{\varvec{e}}_t )\widehat{\varvec{e}}_t \Vert }. \end{aligned}$$

The normal direction \(\varvec{k}\) can be computed following one of these approaches (see also Fig. 5):

  • Rossi-Lassila (RL) et al. approach [31]: \(\varvec{k}\) is defined as the vector \(\textbf{n}_\text{base}\), i.e. the outward normal to the basal plane, that is \(\varvec{k}=\textbf{n}_\text{base}\).

  • Bayer-Trayanova (BT) et al. approach [32]: \(\varvec{k}\) is the gradient of the solution \(\psi\) (\(\varvec{k}=\nabla \psi\)), which can be obtained by solving the following LD problem:

    $$\begin{aligned} \left\{ \begin{aligned} -\Delta \psi&=0,&\qquad&{\text {in }}\Omega , \\ \psi&= 1,&\qquad&{\text {on }}\Gamma _\text{base}, \\ \psi&= 0,&\qquad&{\text {on }}\Gamma _\text{apex}, \\ \nabla \psi \cdot \textbf{n}&=0,&\qquad&{\text {on }}\partial \Omega \setminus (\Gamma _\text{base} \cup \Gamma _\text{apex}). \end{aligned} \right. \end{aligned}$$
    (2)
  • Doste et al. approach [33]: \(\varvec{k}\) is a weighted sum of the apico-basal (\(\nabla \psi _\text{ab}\)) and apico-outflow-tract (\(\nabla \psi _\text{ot}\)) directions, obtained using an interpolation function w:

    $$\begin{aligned} \varvec{k} = w\nabla \psi _\text{ab} + (1-w)\nabla \psi _\text{ot}, \end{aligned}$$

    where \(\psi _\text{ab}\) and \(\psi _\text{ot}\) are obtained by solving LD problems in the form of (2) where \(\Gamma _\text{base}=\Gamma _\text{mv}\) (for \(\psi _\text{ab}\)) and \(\Gamma _\text{base}=\Gamma _\text{av}\) (for \(\psi _\text{ot}\)), respectively. Moreover, the interpolation function w is obtained by solving:

    $$\begin{aligned} \left\{ \begin{aligned} -\Delta w&=0,&\qquad&{\text {in }}\Omega ,\\ w&= 1,&\qquad&{\text {on }}\Gamma _\text{mv} \cup \Gamma _\text{apex}, \\ w&= 0,&\qquad&{\text {on }}\Gamma _\text{av}, \\ \nabla w \cdot \textbf{n}&=0,&\qquad&{\text {on }}\partial \Omega \setminus (\Gamma _\text{av} \cup \Gamma _\text{mv} \cup \Gamma _\text{apex}). \end{aligned} \right. \end{aligned}$$
  • Piersanti et al. approach [3]: for each point in \(\Omega\), a unique normal direction \(\varvec{k}\) is selected among the gradient of several normal directions \(\varvec{k}=\nabla \psi _\text{i}\) (\(\mathrm {i=ab,v,r}\)), where \(\psi _\text{i}\) are obtained by solving the following LD problem

    $$\begin{aligned} \left\{ \begin{aligned} -\Delta \psi _\text{i}&=0,&\qquad&{\text {in }}\Omega , \\ \psi _\text{i}&= \chi _\text{a},&\qquad&{\text {on }}\Gamma _\text{a}, \\ \psi _\text{i}&= \chi _\text{b},&\qquad&{\text {on }}\Gamma _\text{b}, \\ \nabla \psi _{i} \cdot \textbf{n}&=0,&\qquad&{\text {on }}\partial \Omega \setminus (\Gamma _\text{a} \cup \Gamma _\text{b}). \end{aligned} \right. \end{aligned}$$
    (3)

    Please refer to [3] for further details about the selection procedure for \(\varvec{k}\) and the specific choices of \(\chi _\text{a}\), \(\chi _\text{b}\), \(\Gamma _\text{a}\) and \(\Gamma _\text{b}\) in problem (2) made for \(\psi _\text{i}\) (\(i=\text{ab},\text{v},\text{r}\)).

Fig. 5
figure 5

Different types of normal distances: a Bayer-Trayanova et al. approach [32]. b Doste et al. approach [33]. (c) Piersanti et al. approach [3]

The BT approach is used in the ventricular and spherical slab geometry types, see also Fig. 5a. The BT and RL approaches can be adopted in the based ventricular geometry (by setting either Algorithm type equal to BT or RL in the parameter file, respectively), whereas the Doste approach is used in the complete ventricular geometry, see also Fig. 5b. Finally, the Piersanti approach is employed for the atrial geometry, see also Fig. 5c.

Fig. 6
figure 6

Representation of the local coordinate system employed by a LDRBM for an idealized ventricular domain. Only directions on the endocardium \(\Gamma _\text{endo}\) are represented. In blue: unit transmural direction, \(\widehat{\varvec{e}}_t\). In green: unit normal direction, \(\widehat{\varvec{e}}_n\). In red: unit longitudinal direction, \(\widehat{\varvec{e}}_l\). Right: zoom on a slab of the left ventricular myocardium showing the three final myofibers orientations \({\varvec{f}}\), \({\varvec{s}}\) and \({\varvec{n}}\)

4. Local coordinate system::

For each point of the domain an orthonormal local coordinate axial system is defined by \(\widehat{\varvec{e}}_t\), \(\widehat{\varvec{e}}_n\) and the unit longitudinal direction \(\widehat{\varvec{e}}_l\) (orthogonal to the previous ones), as shown in Fig. 6:

$$\begin{aligned} Q=\left[ \widehat{\varvec{e}}_l, \widehat{\varvec{e}}_n, \widehat{\varvec{e}}_t\right] = \left\{ \begin{aligned} \widehat{\varvec{e}}_t&= \frac{\nabla \phi }{\Vert \nabla \phi \Vert }, \\ \widehat{\varvec{e}}_n&= \frac{\varvec{k} - (\varvec{k} \cdot \widehat{\varvec{e}}_t )\widehat{\varvec{e}}_t}{\Vert \varvec{k} - (\varvec{k} \cdot \widehat{\varvec{e}}_t )\widehat{\varvec{e}}_t \Vert }, \\ \widehat{\varvec{e}}_l&= \widehat{\varvec{e}}_n \times \widehat{\varvec{e}}_t. \end{aligned} \right. \end{aligned}$$
(4)
5. Axis rotation::

The reference frame is rotated with the purpose of defining the myofibers orientation: \({\varvec{f}}\) the fiber direction, \({\varvec{n}}\) the sheet-normal direction and \({\varvec{s}}\) the sheet direction. Specifically, \(\widehat{\varvec{e}}_l\) rotates counter-clockwise around \(\widehat{\varvec{e}}_t\) by the helical angle \(\alpha\), whereas the transmural direction \(\widehat{\varvec{e}}_t\) is rotated counter-clockwise around \(\widehat{\varvec{e}}_l\) by the sheetlet angle \(\beta\), see Fig. 6:

$$\begin{aligned} \left[ \widehat{\varvec{e}}_l, \widehat{\varvec{e}}_n, \widehat{\varvec{e}}_t\right] \longrightarrow \left[ {\varvec{f}}, {\varvec{n}}, {\varvec{s}}\right] , \end{aligned}$$

The rotation angles follow the linear relationships:

$$\begin{aligned} \alpha (\phi ) = \alpha _\text{endo}(1-\phi )+\alpha _\text{epi}\phi , \qquad \beta (\phi ) = \beta _\text{endo}(1-\phi )+\beta _\text{epi}\phi , \end{aligned}$$

where \(\alpha _\text{endo}\), \(\alpha _\text{epi}\), \(\beta _\text{endo}\), \(\beta _\text{epi}\) are suitable helical and sheetlet rotation angles on the epicardium and endocardium (specifying in the parameter file alpha epi, alpha endo, beta epi, beta endo). Moreover, for the complete ventricular geometry it is possible to set specific fiber and sheet angle rotations in the outflow tract (OT) region (i.e. around the aortic valve ring) by specifying alpha epi OT, alpha endo OT, beta epi OT, beta endo OT). Finally, for the atrial geometry type, no transmural variation in the myofibers direction is prescribed and the three unit directions correspond to the final myofibers directions \([\widehat{\varvec{e}}_l, \widehat{\varvec{e}}_n, \widehat{\varvec{e}}_t] =[{\varvec{f}}, {\varvec{n}}, {\varvec{s}}]\).

In order to represent the fiber architecture, LDRBMs use the gradient of specific intra-chamber distances, by means of harmonic problems, combined with a precise definition of boundary sections where boundary conditions are prescribed. This strategy makes the fibers less open to subjective variability. On the other hand, the myofiber orientations could be adapted to a patient-specific setting by simply changing the parameters involved in LDRBMs (e.g. the helical and sheetlet angles \(\alpha\) and \(\beta\)). Therefore, unlike other RBMs requiring manual or semi-automatic interventions, LDRBMs can be easily applied to any arbitrary patient-specific geometry [3].

Comparison to existing software

Several packages have been developed and are available in the framework of cardiac fibers generation.

MeshtoolsFootnote 7 [43] is a comand-line tool designed to automate image-based mesh generation and manipulate tasks in cardiac modeling workflows, such as operations on label fields and/or geometric features; it integrates seamlessly with the openCARPFootnote 8 ecosystem [44]; the algorithms supported are only for left ventricular geometries and of BT type. KIT-IBT-LDRB_FibersFootnote 9 is a MATLAB tool for generating left and bi-ventricular fibers; the original BT algorithm was adapted to eliminate a discontinuity in the fiber field in correspondence of the free walls and to yield a fiber rotation that is directly proportional to the transmural Laplace solution (approximately linear across the wall) [45]. CARDIO SUITE for GIMIASFootnote 10 includes tools for patient-specific modelling that allow to generate the FE meshes required for the simulations and to build additional structures such as fiber orientation [46]; at the time of writing and to the best of our knowledge, the latest version was released in 2016. SimCardioFootnote 11 is advertised as the only fully open-source software package providing a complete pipeline from medical image data segmentation to patient specific blood flow simulation and analysis; its module svFSI supports specifying distributed fiber and sheet direction generated by BT-like rule-based algorithms.

Poisson interpolation algorithms [35] have inspired the implementation of fiber generation packages, despite being generally more computationaly demanding than, e.g., RL or BT algorithms [31]. This class of methods has been implemented in Cardiac Chaste,Footnote 12 which supports automatic generation of mathematical model for fiber orientation associated with both idealized and anatomically-based geometry meshes [47], and in BeatIt,Footnote 13 which is to our knowledge the only publicly available software which natively supports the generation of fiber architectures also for atrial geometries [48].

Compared to the software described above, the strengths of \(\texttt {life}^{\texttt {x}}\)-fiber reside in its user-friendly interface and in its generality, by supporting either idealized and realistic, (left) ventricular and atrial geometries and for each of them the user can selected one of the different state-of-the-art algorithms described in Section “Laplace-Dirichlet rule-based methods”. Finally, \(\texttt {life}^{\texttt {x}}\)-fiber offers a seamless integration with many other cardiac core models based on \(\texttt {life}^{\texttt {x}}\) (such as electrophysiology, mechanics, electromechanics, and blood fluid dynamics) for modeling the cardiac function from single-chamber to whole-heart simulations which will be targeted by future releases.

Implementation

In this section we introduce the technical specifications of \(\texttt {life}^{\texttt {x}}\)-fiber as well as a thorough documentation of the user interface exposed. The users will be guided from downloading it to running a full simulation of the algorithms presented in Section “Laplace-Dirichlet rule-based methods”

Technical specifications

Here we specify the package content, copyright and licensing information and software and hardware specifications required by \(\texttt {life}^{\texttt {x}}\)-fiber.

Package content

\(\texttt {life}^{\texttt {x}}\)-fiber is shipped in binary form as an AppImageFootnote 14 executable.

This provides a universal package for x86-64 Linux operating systems, without the need to deliver different distribution-specific versions. From the user’s perspective, this implies an effortless download-then-run process, without having to manually take care of installing the proper system dependencies required.

Once the source code will be made publicly accessible, a standard build-from-source procedure with automatic installers will be available to make the dependencies setup tailored to the specific hardware of HPC facilities or cloud platforms.

License and third-party software

This work is copyrighted by the \(\texttt {life}^{\texttt {x}}\)-fiber authors and licensed under the Creative Commons Attribution Non-Commercial No-Derivatives 4.0 International License.Footnote 15

\(\texttt {life}^{\texttt {x}}\)-fiber makes use of third-party libraries. Please note that such libraries are copyrighted by their respective authors (independent of \(\texttt {life}^{\texttt {x}}\) and \(\texttt {life}^{\texttt {x}}\)-fiber authors) and are covered by various permissive licenses.

The third-party software bundled with (in binary form), required by, copied, modified or explicitly used in \(\texttt {life}^{\texttt {x}}\)-fiber include the following packages [8]:

  • \(\texttt {life}^{\texttt {x}}\)Footnote 16: the open-source, high-performance framework providing the core functionalities for the numerical solution of the Finite Element problems described in Section “Laplace-Dirichlet rule-based methods”;

  • BoostFootnote 17: its modules Filesystem and Math are used for manipulating files/directories and for advanced mathematical functions and interpolators, respectively;

  • deal.IIFootnote 18: it provides support to mesh handling, assembling and solving Finite Element problems (with a main support to third-party libraries as PETScFootnote 19 and TrilinosFootnote 20 for linear algebra data structures and solvers) and to input/output functionalities;

  • VTKFootnote 21: it is used for importing external surface or volume input data and coefficients appearing in the mathematical formulation.

Some of the packages listed above, as stated by their respective authors, rely on additional third-party dependencies that may also be bundled (in binary form) with \(\texttt {life}^{\texttt {x}}\)-fiber, although not used directly. These dependencies include: ADOL-C,Footnote 22ARPACK-NG,Footnote 23BLACS,Footnote 24Eigen,Footnote 25FFTW,Footnote 26GLPK,Footnote 27HDF5,Footnote 28HYPRE,Footnote 29METIS,Footnote 30MUMPS,Footnote 31NetCDF,Footnote 32OpenBLAS,Footnote 33ParMETIS,Footnote 34ScaLAPACK,Footnote 35Scotch,Footnote 36SuiteSparse,Footnote 37SuperLU,Footnote 38oneTBB,Footnote 39p4est.Footnote 40

The libraries listed above are all free software and, as such, they place few restrictions on their use. However, different terms may hold. Please refer to the content of the folder doc/licenses/ for more information on license and copyright statements for these packages.

Finally, an MPI installation (such as OpenMPIFootnote 41 or MPICHFootnote 42) may also be required to successfully run \(\texttt {life}^{\texttt {x}}\) executables in parallel.

Software and hardware requirements

As an AppImage, \(\texttt {life}^{\texttt {x}}\)-fiber has been built on Debian Buster (the current oldstable version)Footnote 43 following the “Build on old systems, run on newer systems” paradigm.Footnote 44

Therefore, it is expected to run on (virtually) any recent enough x86-64 Linux distribution, assuming that glibcFootnote 45 version 2.28 or higher is installed.

Quick start guide: running the \(\texttt {life}^{\texttt {x}}\)-fiber executable

The following steps are required in order to run the \(\texttt {life}^{\texttt {x}}\)-fiber executable.

Download and installation

The \(\texttt {life}^{\texttt {x}}\)-fiber release archive can be downloaded from https://doi.org/10.5281/zenodo.5810268. After extracting the archive, the AppImage file should be made executable by typing the following command in a terminal:

figure a

Finally, lifex_fiber_generation-1.4.0-x86_64.AppImage can be executed with:

figure b

Root permissions are not required. Please note that, in order for the above procedure to succeed, AppImage relies upon the userspace filesystem framework FUSEFootnote 46 which is assumed to be installed on your system. In case of errors, the following commands might be decisive:

figure c

We also refer the reader to the AppImage troubleshooting guide.Footnote 47

Step 0: parameter file configuration

Each \(\texttt {life}^{\texttt {x}}\) application or example, including the \(\texttt {life}^{\texttt {x}}\)-fiber executable described in Section “Download and installation”, defines a set of parameters that are required in order to be run [8]. They involve problem-specific parameters (such as constitutive relations, geometry, time interval, boundary conditions) as well as numerical parameters (types of linear/non-linear solvers, tolerances, maximum number of iterations) or output-related options.

In case an application has sub-dependencies (such as a linear solver), also the related parameters are included (typically in a proper subsection).

Every application comes with a set of command line options, which can be printed using the -h (or –help) flag:

figure d

The first step before running an executable is to generate the parameter file(s) containing all the default parameter values. This is done via the -g (or –generate-params) flag:

figure e

that by default generates a parameter file named after the executable, in .prm format.

By default, only parameters considered standard are printed. The parameter file verbosity can be decreased or increased by passing an optional flag minimal or full to the -g flag, respectively:

figure f

The parameter basename to generate can be customized with the -f (or –params-filename) option:

figure g

Absolute or relative paths can be specified.

At user’s option, in order to guarantee a flexible interface to external file processing tools, the parameter file extension ext can be chosen among three different interchangeable file formats prm, json or xml, from the most human-readable to the most machine-readable.

As an example, the three parameter files displayed in Listings 1, 2 and 3 are semantically equivalent.

We highlight that, following with the design of the ParameterHandler class of deal.II,Footnote 48 each parameter is provided with:

  • a given pattern, specifying the parameter type (e.g. boolean, integer, floating-point number, string, list, ...) and, whenever relevant, a range of admissible values (pattern description);

  • a default value, printed in the parameter file upon generation and implicitly assumed if the user omits a custom value;

  • the actual value, possibly overriding the default one;

  • a documentation string;

  • a global index.

All of these features, combined to a runtime check for the correctness of each parameter, make the code syntactically and semantically robust with respect to possible errors or typos introduced unintentionally.

figure h
figure i
figure j

Once generated, the user can modify, copy, move or rename the parameter file depending on their needs.

Step 1: run

The executable can be run by simply omitting the -g, whereas the -f option is used to specify the parameter file to be read (as opposed to written, in generation mode), e.g.:

figure k

If no -f flag is provided, a file named executable_name.prm is assumed to be available in the directory where the executable is run from.

The path to the directory where all the app output files will be saved to can be selected via the -o (or –output-directory) flag:

figure l

If the specified directory does not already exist, it will be created. By default, the current working directory is used.

Absolute or relative paths can be specified for both the input parameter file and the output directory.

Parallel run In order to run an app in parallel, the mpirun or mpiexec wrapper commands (which may vary depending on the MPI implementation available on your machine) should be prepended, e.g.:

figure m

where <N_PROCS> is the desired number of parallel processes to run on.

As a rule of thumb, 10,000 to 100,000 degrees of freedom per process should lead to the best performance.

Dry run and parameter file conversion Upon running, a parameter log file is automatically generated in the output directory, that can be used later to retrieve which parameters had been used for a specific run.

By default, log_params.ext will be used as its filename. This can be changed via the -l (or –log-file) flag, e.g.:

figure n

The file extension is not mandatory: if unspecified, the same extension as the input parameter file will be used.

If the dry run option is enabled via the -d (or –dry-run) flag, the execution terminates right after the parameter log file generation. This has a two-fold purpose:

  1. 1

    checking the correctness of the parameters being declared and parsed before running the actual simulation (if any of the parameters does not match the specified pattern or has a wrong name or has not been declared in a given subsection then a runtime exception is thrown);

  2. 2

    converting a parameter file between two different formats/extensions. For example, the following command converts input.xml to

    output.json:

figure o

Results and discussion

The LDRBMs described in Section “Laplace-Dirichlet rule-based methods” have been applied to a set of idealized or realistic test cases, namely ventricular and spherical slabs, based and complete left ventricular and left atrial geometries.

This section presents the results obtained, as well as a possible pipeline for reproducing such test cases, consisting of the following steps:

  1. 1

    setting up input data (e.g. generating or importing computational meshes);

  2. 2

    setting up the parameter files associated with a given simulation scenario and running the corresponding simulation;

  3. 3

    post-processing the solution and visualizing the output.

A mesh sensitivity analysis has been performed and reported in Section “Mesh sensitivity and validation”.

Input data

Additional input data (scripts, meshes and parameter files) associated with the guided examples described below can be downloaded from the release archive https://doi.org/10.5281/zenodo.5810268.

In this getting started guide, we provide different ready-to-use meshes, namely

  • a set of four idealized geometries consisting of a ventricular slab, a spherical slab, an idealized based left ventricle and an idealized left atrium, see Fig. 4a–d;

  • two realistic geometries composed by a left ventricle and a left atrium, see Fig. 4e, f.

The idealized meshes have been generated using the built-in CAD engine of gmsh, an open-source 3D FE mesh generator, starting from the corresponding gmsh geometrical models (represented by *.geo files, also provided) defined using their boundary representation, where a volume is bounded by a set of surfaces. For details about the geometrical definition of a model geometry we refer to the online documentation of gmsh.Footnote 49

In order to perform the mesh generation, starting from the geometrical files provided in this tutorial, the following command can be run in a terminal:

figure p

where geometry.geo is the geometrical file model, mesh.msh is the output mesh file, which will be provided as an input to the \(\texttt {life}^{\texttt {x}}\)-fiber app, and s \(\in (0,1]\) is the mesh element size factor. To produce a coarser (finer) mesh the clscale factor can be reduced (increased).

The realistic left ventricle and left atrium have been produced starting from the open-source meshes adopted in [38] (for the left atriumFootnote 50) and in [49] (for the left ventricleFootnote 51) and using the Vascular Modelling Toolkit (vmtk) software [50] along with the semi-automatic meshing toolsFootnote 52 recently proposed in [51].

All the characteristic informations of the ready-to-use meshes, above described, are reported in Table 1.

Table 1 Mesh information regarding the ready-to-use meshes presented in this work. In particular the mesh quality is computed selecting the edge ratio option in the ParaView mesh quality filter

Generating fibers

Parameter files for fiber generation are characterized by a common section named Mesh and space discretization. Select Element type = Tet for tetrahedral meshes or Element type = Hex for hexahedral meshes. Finally, specify in FE space degree the degree of the (piecewise continuous) polynomial FE space used to solve the LD problems described above. Finally, we remark that \(\texttt {life}^{\texttt {x}}\)-fiber internally treats all physical quantities as if they are provided in International System of Units (SI): therefore, a Scaling factor can be set in order to convert the input mesh from a given unit of measurement (e.g. if the mesh coordinates are provided in millimeters then Scaling factor must be set equal to 1e-3).

The Geometry type parameters enables to specify the kind of geometry provided in input, in order to apply the proper LDRBM algorithm among the ones described above. Once specified, parameters related to the specific algorithm and geometry will be parsed from a subsection named after the value of Geometry type.

All parameters missing from the parameter file will take their default value, which is hard-coded.

figure q

Slab fibers

The parameter Geometry type = Slab must be set to prescribe fibers in slab geometries and the path of the input mesh file in Filename.

Ventricular slab For a ventricular slab geometry the user should set Sphere slab = false. Labels for the top (Tags base up) and bottom (Tags base down) surfaces of the slab, as well as for the epicardium (Tags epi) and endocardium (Tags endo) must be prescribed. Finally, the helical and sheetlet rotation angles at the epicardium and endocardium must be provided in the corresponding alpha epi, alpha endo, beta epi, beta endo parameters.

figure r

Spherical slab For a spherical slab geometry the user should set Sphere slab = true. The epicardial coordinates (xyz) of the north (North pole) and south (South pole) poles of the sphere of the slab, and the labels of the endocardium (Tags endo) and epicardium (Tags epi) must be prescribed. Finally, the helical and sheetlet rotation angles at the epicardium and endocardium must be provided in the alpha epi, alpha endo, beta epi, beta endo parameters. A fiber architecture for the sphere slab with radial fiber \(\varvec{f}\) can be prescribed by setting in the parameter file Sphere with radial fibers = true. This consists of exchanging the sheet direction \(\varvec{s}\) with the fiber direction \(\varvec{f}\). Instead, a tangential (to the epicardial and endocardial surfaces) fiber field \(\varvec{f}\) is assigned when Sphere with radial fibers = false.

figure s

Left ventricular fibers

The parameter Geometry type = Left ventricle (Left ventricle complete) prescribes fibers in a based (complete) left ventricular geometry. Other mesh-related parameters have the same meaning as described above.

figure t

Based left ventricle The parameters needed are the labels for the basal plane (Tags base), the epicardium (Tags epi) and endocardium (Tags endo) of the ventricle. The RL or BT approach can be toggled via Algorithm type. The helical and sheetlet rotation angles at the epicardium and endocardium must be prescribed in alpha epi, alpha endo, beta epi, beta endo. Finally, for the RL approach the outward normal vector to the basal plane must be specified in Normal to base, whereas for the BT approach the apex epicardial coordinates (xyz) (Apex) of the ventricle is needed.

figure u

Selecting the RL approach as Algorithm type, this setup can be also exploited in bi-ventricular geometries (not included in the example meshes). In this case, the mesh must have two additional surface labels in the right ventricular endocardium: one delimiting the part facing to the septum (e.g. 15) and the other for the remaining part (e.g. 25). In this way, it is sufficient to set Tags endo as the two endocardial labels (excluding the right septum) and Tags epi as the epicardial label and the right endocardial septum label. Further detail on this approach can be found in [3].

figure v

Complete left ventricle The labels for the mitral (Tags MV) and aortic (Tags AV) valve rings, the epicardium (Tags epi) and endocardium (Tags endo) of the ventricle are required. The apex epicardial coordinates (xyz) must be set in Apex. Finally, the helical and sheetlet rotation angles at the epicardium and endocardium must be prescribed in alpha epi, alpha endo, beta epi, beta endo. A specific helical and sheetlet rotation angles around the outflow tract of the left ventricle (i.e. the mitral valve ring) can be specified by setting alpha epi OT, alpha endo OT, beta epi OT, beta endo OT.

figure w

Left atrial fibers

Fibers in a left atrial geometry can be generated by setting Geometry type = Left atrium. Other mesh-related parameters have the same meaning as described above.

figure x

Idealized left atrium The parameter Appendage = false prescribes fibers in the hollow sphere geometry. The labels for the mitral valve ring (Tags MV), the right (Tags RPV) and left (Tags LPV) pulmonary veins rings, the epicardium (Tags epi) and endocardium (Tags endo) of the idealized atrium must be provided. Finally, the dimension of each atrial bundle is needed: Tau bundle MV for the mitral valve bundle; Tau bundle LPV and Tau bundle RPV for the left and right pulmonary valves ring bundles.

figure y

Realistic left atrium The parameter Appendage = true prescribes fibers in a realistic left atrial geometry. The user should provide labels for the mitral valve ring (Tags MV), the right (Tags RPV) and left (Tags LPV) pulmonary veins rings, the epicardium (Tags epi) and endocardium (Tags endo) of the idealized atrium. The epicardial coordinates (xyz) for the apex of the atrial appendage must be provided in Apex. Finally, the dimension of each atrial bundle is needed: for the mitral valve bundle Tau bundle MV; for the left and right pulmonary valves rings bundle Tau bundle LPV and Tau bundle RPV, respectively.

figure z

Output and visualization

To enable the output the user should set Enable output = true and specify the corresponding output filename in Filename. This will produce a XDMF schema file named output_filename.xdmf (wrapped around a same-named HDF5 output file output_filename.h5) that can be visualized in ParaView,Footnote 53 an open-source multi-platform data analysis and visualization application. Specifically, the streamtracer and the tube filters of ParaView can be applied in sequence to visualize the fiber fields, such as the one shown in Fig. 7.

Fig. 7
figure 7

Fiber field \(\varvec{f}\) visualized as streamlines. a Ventricular slab. b Spherical slab with circumferential fibers. c Idealized left atrium. d Idealized based left ventricle. e Realistic complete left ventricle. f Realistic left atrium

figure aa

Moreover, the HDF5 file format guarantees that the output can easily be further post-processed, not only for visualization purposes but rather to be fed as an input to more sophisticated computational pipelines.

Mesh sensitivity and validation

The robustness of the algorithms presented above is confirmed by performing a mesh sensitivity analysis. Specifically, we consider the ventricular slab geometry shown in Fig. 4a and two related sets of discretization with hexahedral and with tetrahedral elements, respectively. For each of the two element types, we run the fiber generation algorithm (see Section “Ventricular slab”) for four decreasing mesh sizes \(h_1> h_2> h_3 > h_4\).

As the fibers field is orthonormalized, the difference between two numerical solutions is only due to the orientation angle. This allows us to define an error estimate as:

$$\begin{aligned} \Delta _\theta ^{i} = \left| \arccos \left( \textbf{f}_0^i \cdot \textbf{f}_0^4\right) \right| ,\ i=1,2,3, \end{aligned}$$

where \(\textbf{f}_0^i\) is the fiber field computed on the mesh with size \(h_i\) and the results on the finest mesh with size \(h_4\) are considered as a reference solution.

Table 2 Mesh sensitivity analysis for hexahedral elements
Table 3 Mesh sensitivity analysis for tetrahedral elements
Fig. 8
figure 8

Mesh sensitivity analysis performed on the ventricular slab geometry and three different mesh sizes \(h_1,h_2,h_3\). a Hexahedral meshes. b Tetrahedral meshes

We show the error distribution in the whole domain in Fig. 8, whereas Tables 2 and 3 report the average and maximum errors for the hexahedral and the tetrahedral meshes, respectively. We determine both an average and a maximum error smaller than 8\({}^\circ\) even for the coarsest mesh. These values are very small and, in particular, much smaller than the physiological fibers dispersion angle [52].

The interest of accurately reconstructing a fiber orientation field consists of providing it as an input to more sophisticated computational models, such as for cardiac electrophysiology and electromechanics. As the dynamics of such physical models demands for a high resolution in both time and space [3, 17, 53], the LDRBM algorithms are typically run on fine meshes. Therefore, the impact of possible numerical errors due to the mesh size is to be considered negligible, as confirmed by the small errors presented above.

The proposed LDRBMs have been validated in [3], where the fiber orientation field computed numerically provided a satisfactory match to histological data.

Furthermore, the anisotropic nature of the fiber orientation strongly influences the electrophysiological, mechanical, and electromechanical cardiac function. Therefore, an indirect way to validate the fiber field provided by LDRBMs is to compute quantitative indices or biomarkers in such kind of simulations.

Matching quantitative indices in a physiological range is only possible when the fiber reconstruction algorithm is accurate enough: this is shown in [3] for the whole-heart electrophysiology, in [17] for the ventricular electromechanics, and in [53] for the whole-heart electromechanics.

Future developments

As anticipated in Section ”Background”, \(\texttt {life}^{\texttt {x}}\) has served as the core framework for the development of several heart modules for the simulation of cardiac electrophysiology, mechanics, electromechanics, and blood fluid dynamics models.

In the near future, the deployment of \(\texttt {life}^{\texttt {x}}\) modules will follow two lines:

  • more modules will be successively published in binary form, starting from an advanced solver for cardiac electrophysiology, blood fluid dynamics and other solvers for the cardiac function;

  • in the meantime, the source code associated with previous binary releases will be gradually made publicly available under an open-source license.

In the long run, also modules unrelated to the cardiac function are expected to be included within \(\texttt {life}^{\texttt {x}}\).

Conclusions

\(\texttt {life}^{\texttt {x}}\) is intended to provide the scientific community with an integrated FE framework for exploring many physiological and pathological scenarios using in silico experiments for the whole-heart cardiac function, boosting both the user and developer experience without sacrificing its computational efficiency and universality.

We believe that the release of \(\texttt {life}^{\texttt {x}}\)-fiber provides the scientific community with an invaluable tool for in silico scenario analyses of myofibers orientation; such a tool supports either idealized and realistic, (left) ventricular and atrial geometries. It also offers a seamless integration of LDRBMs into more sophisticated computational pipelines involving other core models – such as electrophysiology, mechanics and electromechanics – for the cardiac function, in a wide range of settings covering from single-chamber to whole-heart simulations.

The content of this initial release is published on the official website https://lifex.gitlab.io/heart.html: we encourage users to interact with the \(\texttt {life}^{\texttt {x}}\) development community via the issue trackerFootnote 54 of our public website repository. Any curiosity, question, bug report or suggestion is welcome.

News and announcements about \(\texttt {life}^{\texttt {x}}\) will be posted to the official website https://lifex.gitlab.io/.

Availability and requirements

  • Project name: \(\texttt {life}^{\texttt {x}}\)-fiber

  • Project home page: https://lifex.gitlab.io/heart.html

  • Operating system(s): Linux (x86-64)

  • Programming language: C++

  • Other requirements: glibc version 2.28 or higher

  • License: CC BY-NC-ND 4.0

  • Any restrictions to use by non-academics: no additional restriction.

Availability of data and materials

All input data, meshes and the binary executable of \(\texttt {life}^{\texttt {x}}\) can be found at https://doi.org/10.5281/zenodo.5810268.

Notes

  1. https://www.dealii.org/.

  2. http://gmsh.info.

  3. https://ngsolve.org/.

  4. http://www.vmtk.org.

  5. https://bitbucket.org/aneic/meshtool/src/master/.

  6. https://pypi.org/project/meshio/.

  7. https://bitbucket.org/aneic/meshtool/src/master.

  8. https://opencarp.org/.

  9. https://github.com/KIT-IBT/LDRB_Fibers.

  10. http://www.gimias.org/index.php/clinical-prototypes/cardiosuite.

  11. http://simvascular.github.io/index.html.

  12. https://www.cs.ox.ac.uk/chaste/cardiac_index.html.

  13. https://github.com/rossisimone/beatit.

  14. https://appimage.org/.

  15. http://creativecommons.org/licenses/by-nc-nd/4.0/.

  16. https://lifex.gitlab.io/.

  17. https://www.boost.org/.

  18. https://www.dealii.org/.

  19. https://www.mcs.anl.gov/petsc/.

  20. https://trilinos.github.io/.

  21. https://vtk.org/.

  22. https://github.com/coin-or/ADOL-C.

  23. https://github.com/opencollab/arpack-ng.

  24. https://www.netlib.org/blacs/.

  25. https://eigen.tuxfamily.org/.

  26. https://www.fftw.org/.

  27. https://www.gnu.org/software/glpk/.

  28. https://www.hdfgroup.org/solutions/hdf5/.

  29. https://www.llnl.gov/casc/hypre/.

  30. http://glaros.dtc.umn.edu/gkhome/metis/metis/overview.

  31. http://mumps.enseeiht.fr/index.php?page=home.

  32. https://www.unidata.ucar.edu/software/netcdf/.

  33. https://www.openblas.net/.

  34. http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview.

  35. https://www.netlib.org/scalapack/.

  36. https://gitlab.inria.fr/scotch/scotch.

  37. https://people.engr.tamu.edu/davis/suitesparse.html.

  38. https://portal.nersc.gov/project/sparse/superlu/.

  39. https://oneapi-src.github.io/oneTBB/.

  40. https://www.p4est.org/.

  41. https://www.open-mpi.org/.

  42. https://www.mpich.org/.

  43. https://www.debian.org/releases/.

  44. https://docs.appimage.org/introduction/concepts.html.

  45. https://www.gnu.org/software/libc/.

  46. https://www.kernel.org/doc/html/latest/filesystems/fuse.html.

  47. https://docs.appimage.org/user-guide/troubleshooting/fuse.html.

  48. https://www.dealii.org/current/doxygen/deal.II/classParameterHandler.html.

  49. https://gmsh.info/doc/texinfo/gmsh.html.

  50. https://doi.org/10.18742/RDM01-289.

  51. https://doi.org/10.5281/zenodo.3890034.

  52. https://github.com/marco-fedele/vmtk.

  53. https://www.paraview.org.

  54. https://gitlab.com/lifex/lifex.gitlab.io/-/issues.

Abbreviations

FE:

Finite element

BT:

Bayer-Trayanova

RL:

Rossi-Lassila

HPC:

High performance computing

LD:

Laplace-Dirichlet

RBM:

Rule-based method

LDRBM:

Laplace-Dirichlet rule-based method

SI:

International system of units

References

  1. Quarteroni A, Dede’ L, Manzoni A, Vergara C. Mathematical modelling of the human cardiovascular system: data, numerical approximation, clinical applications. Cambridge Monographs on Applied and Computational Mathematics, 2019; https://doi.org/10.1017/9781108616096

  2. Quarteroni A, Lassila T, Rossi S, Ruiz-Baier R. Integrated heart–coupling multiscale and multiphysics models for the simulation of the cardiac function. Comput Methods Appl Mech Eng 2017;314:345–407. https://doi.org/10.1016/j.cma.2016.05.031. Special Issue on Biological Systems Dedicated to William S. Klug

  3. Piersanti R, Africa PC, Fedele M, Vergara C, Dede’ L, Corno AF, Quarteroni A. Modeling cardiac muscle fibers in ventricular and atrial electrophysiology simulations. Comput Methods Appl Mech Eng. 2021;373:113468.

    Article  Google Scholar 

  4. Salvador M, Fedele M, Africa PC, Sung E, Dede’ L, Prakosa A, Chrispin J, Trayanova N, Quarteroni A. Electromechanical modeling of human ventricles with ischemic cardiomyopathy: numerical simulations in sinus rhythm and under arrhythmia. Comput Biol Med. 2021;136:104674. https://doi.org/10.1016/j.compbiomed.2021.104674.

    Article  PubMed  Google Scholar 

  5. Salvador M, Regazzoni F, Pagani S, Dede’ L, Trayanova N, Quarteroni A. The role of mechano-electric feedbacks and hemodynamic coupling in scar-related ventricular tachycardia. Comput Biol Med, 2022;105203.

  6. ten Tusscher KHWJ, Panfilov AV. Alternans and spiral breakup in a human ventricular tissue model. Am J Physiol Heart Circul Physiol. 2006;291(3):1088–100. https://doi.org/10.1152/ajpheart.00109.2006. (PMID: 16565318).

    Article  CAS  Google Scholar 

  7. Courtemanche M, Ramirez RJ, Nattel S. Ionic mechanisms underlying human atrial action potential properties: insights from a mathematical model. Am J Physiol Heart Circul Physiol. 1998;275(1):301–21. https://doi.org/10.1152/ajpheart.1998.275.1.H301. (PMID: 9688927).

    Article  Google Scholar 

  8. Africa PC. life\(^{\texttt{x}}\): A flexible, high performance library for the numerical solution of complex finite element problems. SoftwareX 2022;20:101252. https://doi.org/10.1016/j.softx.2022.101252

  9. Arndt D, Bangerth W, Blais B, Fehling M, Gassmöller R, Heister T, Heltai L, Köcher U, Kronbichler M, Maier M, Munch P, Pelteret JP, Proell S, Konrad S, Turcksin B, Wells D, Zhang J. The deal.II library, version 9.3. J Numer Math. 2021;29(3):171–86. https://doi.org/10.1515/jnma-2021-0081.

    Article  Google Scholar 

  10. Regazzoni F, Salvador M, Africa PC, Fedele M, Dede’ L, Quarteroni A. A cardiac electromechanical model coupled with a lumped-parameter model for closed-loop blood circulation. J Comput Phys, 2022;111083.

  11. Regazzoni F, Quarteroni A. Accelerating the convergence to a limit cycle in 3d cardiac electromechanical simulations through a data-driven 0d emulator. Comput Biol Med. 2021;135: 104641. https://doi.org/10.1016/j.compbiomed.2021.104641.

    Article  CAS  PubMed  Google Scholar 

  12. Zingaro A, Fumagalli I, Fedele M, Africa PC, Dede’ L, Quarteroni A, Corno AF. A geometric multiscale model for the numerical simulation of blood flow in the human left heart. Discrete Continuous Dyn Syst S. 2022;15(8):2391–427. https://doi.org/10.3934/dcdss.2022052.

    Article  Google Scholar 

  13. Bucelli M, Dede’ L, Quarteroni A, Vergara C. Partitioned and monolithic algorithms for the numerical solution of cardiac fluid-structure interaction. Commun Comput Phys. 2023;32(5):1217–56. https://doi.org/10.4208/cicp.OA-2021-0243.

    Article  Google Scholar 

  14. Fumagalli I, Vitullo P, Scrofani R, Vergara C. Image-based computational hemodynamics analysis of systolic obstruction in hypertrophic cardiomyopathy. medRxiv 2021. https://doi.org/10.1101/2021.06.02.21258207

  15. Stella S, Vergara C, Maines M, Catanzariti D, Africa PC, Demattè C, Centonze M, Nobile F, Del Greco M, Quarteroni A. Integration of activation maps of epicardial veins in computational cardiac electrophysiology. Comput Biol Med. 2020;127:104047. https://doi.org/10.1016/j.compbiomed.2020.104047.

    Article  PubMed  Google Scholar 

  16. Dede’ L, Regazzoni F, Vergara C, Zunino P, Guglielmo M, Scrofani R, Fusini L, Cogliati C, Pontone G, Quarteroni A. Modeling the cardiac response to hemodynamic changes associated with covid-19: a computational study. Math Biosci Eng. 2021;18(4):3364–83.

    Article  PubMed  Google Scholar 

  17. Piersanti R, Regazzoni F, Salvador M, Corno AF, Dede’ L, Vergara C, Quarteroni A. 3d–0d closed-loop model for the simulation of cardiac biventricular electromechanics. Comput Methods Appl Mech Eng. 2022;391: 114607. https://doi.org/10.1016/j.cma.2022.114607.

    Article  Google Scholar 

  18. Streeter DD Jr, Spotnitz HM, Patel DP, Ross J Jr, Sonnenblick EH. Fiber orientation in the canine left ventricle during diastole and systole. Circ Res. 1969;24(3):339–47.

    Article  PubMed  Google Scholar 

  19. LeGrice IJ, Smaill BH, Chai LZ, Edgar SG, Gavin JB, Hunter PJ. Laminar structure of the heart: ventricular myocyte arrangement and connective tissue architecture in the dog. Am J Physiol Heart Circul Physiol. 1995;269(2):571–82.

    Article  Google Scholar 

  20. Greenbaum RA, Ho SY, Gibson DG, Becker AE, Anderson RH. Left ventricular fibre architecture in man. Heart. 1981;45(3):248–63.

    Article  CAS  Google Scholar 

  21. Lombaert H, Peyrat J, Croisille P, Rapacchi S, Fanton L, Cheriet F, Clarysse P, Magnin I, Delingette H, Ayache N. Human atlas of the cardiac fiber architecture: study on a healthy population. IEEE Trans Med Imaging. 2012;31(7):1436–47.

    Article  PubMed  Google Scholar 

  22. Toussaint N, Stoeck CT, Schaeffter T, Kozerke S, Sermesant M, Batchelor PG. In vivo human cardiac fibre architecture estimation using shape-based diffusion tensor processing. Med Image Anal. 2013;17(8):1243–55.

    Article  PubMed  Google Scholar 

  23. Ho SY, Anderson RH, Sánchez-Quintana D. Atrial structure and fibres: morphologic bases of atrial conduction. Cardiovasc Res. 2002;54:325–36.

    Article  CAS  PubMed  Google Scholar 

  24. Ho SY, Sánchez-Quintana D. The importance of atrial structure and fibers. Clin Anatomy Off J Am Assoc Clin Anatom Br Assoc Clin Anatom. 2009;22:52–63.

    CAS  Google Scholar 

  25. Sánchez-Quintana D, Pizarro G, López-Mínguez JR, Ho SY, Cabrera JA. Standardized review of atrial anatomy for cardiac electrophysiologists. J Cardiovasc Transl Res. 2013;6:124–44.

    Article  PubMed  Google Scholar 

  26. Roberts DE, Hersh LT, Scher AM. Influence of cardiac fiber orientation on wavefront voltage, conduction velocity, and tissue resistivity in the dog. Circ Res. 1979;44(5):701–12.

    Article  CAS  PubMed  Google Scholar 

  27. Punske BB, Taccardi B, Steadman B, Ershler PR, England A, Valencik ML, McDonald JA, Litwin SE. Effect of fiber orientation on propagation: electrical mapping of genetically altered mouse hearts. J Electrocardiol. 2005;38(4):40–4.

    Article  PubMed  Google Scholar 

  28. Eriksson TSE, Prassl AJ, Plank G, Holzapfel GA. Influence of myocardial fiber/sheet orientations on left ventricular mechanical contraction. Math Mech Solids. 2013;18(6):592–606.

    Article  Google Scholar 

  29. Palit A, Bhudia SK, Arvanitis TN, Turley GA, Williams MA. Computational modelling of left-ventricular diastolic mechanics: Effect of fibre orientation and right-ventricle topology. J Biomech. 2015;48(4):604–12.

    Article  PubMed  Google Scholar 

  30. Guan D, Yao J, Luo X, Gao H. Effect of myofibre architecture on ventricular pump function by using a neonatal porcine heart model: from DT-MRI to rule-based methods. R Soc Open Sci. 2020;7(4): 191655.

    Article  PubMed  PubMed Central  Google Scholar 

  31. Rossi S, Lassila T, Ruiz-Baier R, Sequeira A, Quarteroni A. Thermodynamically consistent orthotropic activation model capturing ventricular systolic wall thickening in cardiac electromechanics. Eur J Mech A Solids. 2014;48:129–42.

    Article  Google Scholar 

  32. Bayer JD, Blake RC, Plank G, Trayanova N. A novel rule-based algorithm for assigning myocardial fiber orientation to computational heart models. Ann Biomed Eng. 2012;40(10):2243–54.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  33. Doste R, Soto-Iglesias D, Bernardino G, Alcaine A, Sebastian R, Giffard-Roisin S, Sermesant M, Berruezo A, Sanchez-Quintana D, Camara O. A rule-based method to model myocardial fiber orientation in cardiac biventricular geometries with outflow tracts. Int J Numer Methods Biomed Eng. 2019;35(4):3185.

    Article  Google Scholar 

  34. Hoermann JM, Pfaller MR, Avena L, Bertoglio C, Wall WA. Automatic mapping of atrial fiber orientations for patient-specific modeling of cardiac electromechanics using image registration. Int J Numer Methods Biomed Eng. 2019;35(6):3190.

    Article  Google Scholar 

  35. Wong J, Kuhl E. Generating fibre orientation maps in human heart models using poisson interpolation. Comput Methods Biomech Biomed Eng. 2014;17(11):1217–26.

    Article  Google Scholar 

  36. Krueger MW, Schmidt V, Tobón C, Weber FM, Lorenz C, Keller DUJ, Barschdorf H, Burdumy M, Neher P, Plank G et al. Modeling atrial fiber orientation in patient-specific geometries: a semi-automatic rule-based approach. In: International conference on functional imaging and modeling of the heart, 2011;223–232.

  37. Ferrer A, Sebastián R, Sánchez-Quintana D, Rodríguez JF, Godoy EJ, Martínez L, Saiz J. Detailed anatomical and electrophysiological models of human atria and torso for the simulation of atrial activation. PLoS ONE. 2015;10(11):0141573.

    Article  Google Scholar 

  38. Fastl TE, Tobon-Gomez C, Crozier A, Whitaker J, Rajani R, McCarthy KP, Sanchez-Quintana D, Ho SY, O’Neill MD, Plank G et al. Personalized computational modeling of left atrial geometry and transmural myofiber architecture. Med Image Anal 2018.

  39. Roney CH, Bendikas R, Pashakhanloo F, Corrado C, Vigmond EJ, McVeigh ER, Trayanova NA, Niederer SA. Constructing a human atrial fibre atlas. Ann Biomed Eng 2020.

  40. Beyar R, Sideman S. A computer study of the left ventricular performance based on fiber structure, sarcomere dynamics, and transmural electrical propagation velocity. Circ Res. 1984;55(3):358–75.

    Article  CAS  PubMed  Google Scholar 

  41. Potse M, Dubé B, Richer J, Vinet A, Gulrajani RM. A comparison of monodomain and bidomain reaction-diffusion models for action potential propagation in the human heart. IEEE Trans Biomed Eng. 2006;53(12):2425–35.

    Article  PubMed  Google Scholar 

  42. Nielsen P, Le Grice IJ, Smaill BH, Hunter PJ. Mathematical model of geometry and fibrous structure of the heart. Am J Physiol Heart Circul Physiol. 1991;260(4):1365–78.

    Article  Google Scholar 

  43. Neic A, Gsell MAF, Karabelas E, Prassl AJ, Plank G. Automating image-based mesh generation and manipulation tasks in cardiac modeling workflows using meshtool. SoftwareX. 2020;11: 100454. https://doi.org/10.1016/j.softx.2020.100454.

    Article  PubMed  PubMed Central  Google Scholar 

  44. Plank G, Loewe A, Neic A, Augustin C, Huang Y-L, Gsell MAF, Elias Karabelas JS, Nothstein M, Prassl AJ, Seemann G, Vigmond EJ. The openCARP simulation environment for cardiac electrophysiology. Comput Methods Programs Biomed. 2021;208:106223. https://doi.org/10.1016/j.cmpb.2021.106223.

    Article  PubMed  Google Scholar 

  45. Kovacheva E, Gerach T, Schuler S, Ochs M, Dössel O, Loewe A. Causes of altered ventricular mechanics in hypertrophic cardiomyopathy: an in-silico study. Biomed Eng Online. 2021;20(1):1–28.

    Article  Google Scholar 

  46. Larrabide I, Omedas P, Martelli Y, Planes X, Nieber M, Moya JA, Butakoff C, Sebastián R, Camara O, Craene MD et al. Gimias: an open source framework for efficient development of research tools and clinical prototypes. In: International conference on functional imaging and modeling of the heart, 2009;417–426. Springer

  47. Cooper FR, Baker RE, Bernabeu MO, Bordas R, Bowler L, Bueno-Orovio A, Byrne HM, Carapella V, Cardone-Noott L, Cooper J et al. Chaste: cancer, heart and soft tissue environment. J Open Source Softw 2020.

  48. Rossi S, Gaeta S, Griffith BE, Henriquez CS. Muscle thickness and curvature influence atrial conduction velocities. Front Physiol, 1344, 2018.

  49. Strocchi M, Augustin CM, Gsell MAF, Karabelas E, Neic A, Gillette K, Razeghi O, Prassl AJ, Vigmond EJ, Behar JM, Gould J, Sidhu B, Rinaldi CA, Bishop MJ, Plank G, Niederer SA. A publicly available virtual cohort of four-chamber heart meshes for cardiac electro-mechanics simulations. PLoS ONE. 2020;15:1–26. https://doi.org/10.1371/journal.pone.0235145.

    Article  CAS  Google Scholar 

  50. Antiga L, Steinman DA. The vascular modeling toolkit 2008.

  51. Fedele M, Quarteroni A. Polygonal surface processing and mesh generation tools for the numerical simulation of the cardiac function. Int J Numer Methods Biomed Eng. 2021;37(4):3435.

    Article  Google Scholar 

  52. Guan D, Zhuan X, Holmes W, Luo X, Gao H. Modelling of fibre dispersion and its effects on cardiac mechanics from diastole to systole. J Eng Math. 2021;128(1):1–24.

    Article  Google Scholar 

  53. Fedele M, Piersanti R, Regazzoni F, Salvador M, Africa PC, Bucelli M, Zingaro A, Dede’ L, Quarteroni A. A comprehensive and biophysically detailed computational model of the whole human heart electromechanics. arXiv 2022. https://doi.org/10.48550/ARXIV.2207.12460

  54. Chabiniok R, Wang VY, Hadjicharalambous M, Asner L, Lee J, Sermesant M, Kuhl E, Young AA, Moireau P, Nash MP, et al. Multiphysics and multiscale modelling, data-model fusion and integration of organ physiology in the clinic: ventricular cardiac mechanics. Interface Focus. 2016;6(2):20150083.

    Article  PubMed  PubMed Central  Google Scholar 

  55. Anderson RH, Niederer PF, Sanchez-Quintana D, Stephenson RS, Agger P. How are the cardiomyocytes aggregated together within the walls of the left ventricular cone? J Anat. 2019;235(4):697–705.

    Article  PubMed  PubMed Central  Google Scholar 

  56. Sánchez-Quintana D, López-Mínguez JR, Macías Y, Cabrera JA, Saremi F. Left atrial anatomy relevant to catheter ablation. Cardiol Res Practice 2014;2014.

  57. Blausen.com staff: Medical gallery of Blausen Medical 2014. WikiJournal of Medicine (2014). https://en.wikiversity.org/wiki/WikiJournal_of_Medicine/Medical_gallery_of_Blausen_Medical_2014

Download references

Acknowledgements

Not applicable.

Funding

This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program (grant agreement No 740132, iHEART - An Integrated Heart Model for the simulation of the cardiac function, P.I. Prof. A. Quarteroni).

Author information

Authors and Affiliations

Authors

Contributions

The initial design of \(\texttt {life}^{\texttt {x}}\) was conceived by PCA with precious hints and contributions by MF. The mathematical models and the Laplace-Dirichlet Rule-Based Methods were developed by RP. The software development and testing were carried out by PCA, MF and RP. PCA and RP wrote the paper. LD and AQ supervised the model development and the interpretation of results. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Pasquale Claudio Africa.

Ethics declarations

Ethics approval and consent to participate

Not applicable.

Consent for publication

Not applicable.

Competing interest

The authors declare that they have no competing interests.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/. The Creative Commons Public Domain Dedication waiver (http://creativecommons.org/publicdomain/zero/1.0/) applies to the data made available in this article, unless otherwise stated in a credit line to the data.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Africa, P.C., Piersanti, R., Fedele, M. et al. lifex-fiber: an open tool for myofibers generation in cardiac computational models. BMC Bioinformatics 24, 143 (2023). https://doi.org/10.1186/s12859-023-05260-w

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s12859-023-05260-w

Keywords

Mathematical Subject Classification