You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: utilities/fiber_generation/DOCUMENTATION.md
+82-40Lines changed: 82 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -250,8 +250,8 @@ The Bayer method requires four input angle parameters (typically specified in de
250
250
251
251
-**$\alpha_{\text{endo}}$**: Endocardial helix angle, typically $60°$
252
252
-**$\alpha_{\text{epi}}$**: Epicardial helix angle, typically $-60°$
253
-
-**$\beta_{\text{endo}}$**: Endocardial transverse angle, typically $20°$
254
-
-**$\beta_{\text{epi}}$**: Epicardial transverse angle, typically $-20°$
253
+
-**$\beta_{\text{endo}}$**: Endocardial transverse angle, typically $-20°$
254
+
-**$\beta_{\text{epi}}$**: Epicardial transverse angle, typically $20°$
255
255
256
256
These angles define the fiber architecture that varies smoothly from endocardium to epicardium across both ventricles.
257
257
@@ -314,14 +314,14 @@ When running the original implementation, we observed the resulting fibers showe
314
314
Note that $\mathbf{Q}_{\mathrm{LV}}^{0}$ and $\mathbf{Q}_{\mathrm{RV}}^{0}$ share equivalent circumferential, longitudinal, and transmural directions \textbf{within the septum}. By definition, $\beta_s > 0$ on the LV side (assuming $\beta_{\mathrm{endo}} > 0$), causing the fiber vector to rotate outward from the septum. On the RV side, $\beta_s < 0$ which also causes the fiber vector to rotate away from the septum. However, this is a negative angle at the RV endocardium, which is not what we want. Taking the absolute value $|\beta_s|$ yields the correct fiber angles while preserving the transmural variation of $\beta_{\mathrm{endo}}$ (positive at both side of the septum and 0 at the center of the septum).
315
315
316
316
317
-

317
+

318
318
319
319
- After step 3, for elements where $d > 0.5$, flip the first and third basis vectors (fiber and sheet) of $\mathbf{Q}_{\text{endo}}$.
320
320
321
321
Note that $\mathbf{Q}_{\text{LV}}^{0}$ and $\mathbf{Q}_{\text{RV}}^{0}$ are constructed with opposite signs for the transmural direction. As a result, the LV basis rotates counterclockwise, whereas the RV basis rotates clockwise. At the septum, the circumferential vectors of both bases point in the same direction, which allows for a straightforward SLERP interpolation along the shortest path to obtain $\mathbf{Q}_{\text{endo}}$. However, on the RV side this construction causes the $\mathbf{Q}_{\text{endo}}$ basis to point exactly opposite to $\mathbf{Q}_{\text{epi}}$, leading to issues with the SLERP interpolation. Flipping the vectors on the RV side resolves this problem and ensures that the second interpolation remains smooth.
322
322
323
323
324
-

324
+

325
325
326
326
327
327
# Doste Method
@@ -352,38 +352,41 @@ where $S_{\text{epi}}$ is the epicardial surface, $S_{\text{top}}$ is the top su
1. $\phi_{\text{epi,trans}}$: LV and RV endocardium → epicardium (global transmural)
373
+
**Global Transmural**:
374
+
1. $\phi_{\text{epi,trans}}$: LV and RV endocardium → epicardium (global transmural for angle interpolation)
375
+
376
+
**Note**: All Laplace fields are automatically normalized to the $[0, 1]$ range **except** for $\phi_{\text{BiV}}$ and $\phi_{\text{Trans}}$, which are kept in their original range for proper septal field calculation and basis construction. The $\phi_{\text{BiV}}$ field typically has negative values on the RV side and positive values on the LV side.
374
377
375
378
## Input Angles
376
379
377
380
The Doste method requires twelve input angle parameters (typically specified in degrees) to handle both ventricles and outflow tracts:
378
381
379
382
-**$\alpha_{\text{endo,LV}}$**: LV endocardial helix angle, typically $60°$
380
383
-**$\alpha_{\text{epi,LV}}$**: LV epicardial helix angle, typically $-60°$
381
-
-**$\beta_{\text{endo,LV}}$**: LV endocardial transverse angle, typically $20°$
382
-
-**$\beta_{\text{epi,LV}}$**: LV epicardial transverse angle, typically $-20°$
384
+
-**$\beta_{\text{endo,LV}}$**: LV endocardial transverse angle, typically $-20°$
385
+
-**$\beta_{\text{epi,LV}}$**: LV epicardial transverse angle, typically $20°$
383
386
-**$\alpha_{\text{endo,RV}}$**: RV endocardial helix angle, typically $90°$
384
387
-**$\alpha_{\text{epi,RV}}$**: RV epicardial helix angle, typically $-25°$
385
-
-**$\beta_{\text{endo,RV}}$**: RV endocardial transverse angle, typically $20°$
386
-
-**$\beta_{\text{epi,RV}}$**: RV epicardial transverse angle, typically $-20°$
388
+
-**$\beta_{\text{endo,RV}}$**: RV endocardial transverse angle, typically $-20°$
389
+
-**$\beta_{\text{epi,RV}}$**: RV epicardial transverse angle, typically $20°$
387
390
-**$\alpha_{\text{OT,endo,LV}}$**: LV outflow tract endocardial helix angle, typically $90°$
388
391
-**$\alpha_{\text{OT,epi,LV}}$**: LV outflow tract epicardial helix angle, typically $0°$
389
392
-**$\alpha_{\text{OT,endo,RV}}$**: RV outflow tract endocardial helix angle, typically $90°$
## On the convention of the orthogonal basis and angles
516
+
517
+
518
+
### Modified algorithm steps
519
+
In the original Doste paper, only one transmural field is mentioned ($\phi_{\text{Trans}}$) which is used to define the transmural gradient $\mathbf g_t$. Piersanti et al (2021) adds a second transmural field (see Fig. 4) ($\phi_{\text{BiV}}$) to differentiate between LV and RV. We use these two plus the individual transmural fields ($\phi_{\text{LV,trans}}$) and ($\phi_{\text{RV,trans}}$) which provides a smoother transition between LV and RV.
520
+
521
+
522
+
# On the convention of the orthogonal basis and angles
487
523
488
524
Different papers use different conventions to define the orthogonal circumferential, longitudinal, and transmural basis (see Table below).
489
525
@@ -497,4 +533,10 @@ For coherency, for all methods and for all chambers, we consider the transmural
1. Bayer, J. D., Blake, R. C., Plank, G., & Trayanova, N. A. (2012). A Novel Rule-Based Algorithm for Assigning Myocardial Fiber Orientation to Computational Heart Models. Annals of Biomedical Engineering, 40(10), 2243–2254. https://doi.org/10.1007/s10439-012-0593-5
541
+
2. Doste, R., Soto‐Iglesias, D., Bernardino, G., Alcaine, A., Sebastian, R., Giffard‐Roisin, S., Sermesant, M., Berruezo, A., Sanchez‐Quintana, D., & Camara, O. (2019). A rule‐based method to model myocardial fiber orientation in cardiac biventricular geometries with outflow tracts. International Journal for Numerical Methods in Biomedical Engineering, 35(4). https://doi.org/10.1002/cnm.3185
542
+
3. Piersanti, R., Africa, P. C., Fedele, M., Vergara, C., Dedè, L., Corno, A. F., & Quarteroni, A. (2021). Modeling cardiac muscle fibers in ventricular and atrial electrophysiology simulations. Computer Methods in Applied Mechanics and Engineering, 373, 113468. https://doi.org/10.1016/j.cma.2020.113468
Copy file name to clipboardExpand all lines: utilities/fiber_generation/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,10 @@ pip install -e .
14
14
This will install all the required packages and will allow you to call the functions in these packages from any directory.
15
15
16
16
## Examples
17
-
The `main_bayer.py` and `main_doste.py` are scripts to run both methods in the geometry described in the `example/truncated` and `example/ot` folders respectively.
17
+
The `main_bayer.py` and `main_doste.py` are scripts to run both methods in the geometry described in the `example/biv_truncated` and `example/biv_with_outflow_tracts` folders respectively.
18
18
19
-
<imgsrc="example/truncated/bayer_fiber.png"alt="Results for truncated BiV (Bayer)"width="640" />
20
-
<imgsrc="example/ot/doste_fiber.png"alt="Results for BiV w/ outflow tracts (Doste)"width="640" />
19
+
<imgsrc="example/biv_truncated/bayer_fiber.png"alt="Results for truncated BiV (Bayer)"width="640" />
20
+
<imgsrc="example/biv_with_outflow_tracts/doste_fiber.png"alt="Results for BiV w/ outflow tracts (Doste)"width="640" />
21
21
22
22
Note that the Doste methods needs a geometry with outflow tracts to be run (each valve needs to be defined as a separated surface). Bayer can be run in any biventricular geometry.
*Figure 6: Sheet-normal orientation field generated using the Bayer method - slice view*
63
63
64
64
### Angle Correlations
65
65
66
66
To check the code, we first calculate the $\alpha$ and $\beta$ angles using scalar interpolations. Then, we calculate the $\alpha$ and $\beta$ angles using the fiber direction $\mathbf f$ and the orthogonal basis $\mathbf e_c$, $\mathbf e_\ell$, $\mathbf e_t$.
*Figure 7: Correlation plots comparing scalar interpolation angles with fiber derived angles for the Bayer method. Blue and red dots show the $\alpha$ and $\beta$ angles. For reference, the original Bayer method with no modifications is shown.*
71
71
@@ -77,37 +77,37 @@ The Doste method results are demonstrated on a complete biventricular geometry w
77
77
78
78
### Fiber Orientation
79
79
80
-

80
+

81
81
82
82
*Figure 8: Fiber orientation field generated using the Doste method - full view*
*Figure 14: Correlation plots comparing scalar interpolation angles with fiber derived angles for the Doste method. Blue and red dots show the $\alpha$ and $\beta$ angles**
0 commit comments