DOI: 10.5281/zenodo.10724337
title: The Right Atrium Affects In Silico Arrhythmia Vulnerability in Both Atria

description: The Right Atrium Affects In Silico Arrhythmia Vulnerability in Both Atria

 

Authors: Patricia Martínez Díaz, Jorge Sánchez, Nikola Fitzen, Ursula Ravens, Olaf Dössel, Axel Loewe

patricia.martinez@kit.edu / publications@ibt.kit.edu

doi:10.1016/j.hrthm.2024.01.047

 

This dataset contains 8 biatrial meshes and 8 monoatrial (left-only) meshes, derived from MRI and CT segmentations with annotations and fibers, ready for simulations in the cardiac electrophysiology simulator openCARP. We also provide the code to reproduce a total of 576 reentries by reading the selected parameters.par and state.roe files. The meshes were generated using AugmentA code and the simulated reentries were induced following the PEERP protocol by Azzolin et al. A carputils bundle containing the openCARP experiment, along with all associated parameters, is publicly available. The original cardiac segmentations are part of Krueger M. et al. Personalization of atrial anatomy and electrophysiology as a basis for clinical modeling of radio-frequency ablation of atrial fibrillation doi:10.1109/TMI.2012.2201948

 

Folder structure

The code is located in the `src` folder, the meshes in the `data` folder and the reentries in the `results` folder.  

```

KIT_2/

|-- src/

   |-- run.py

   |-- induceReentry.py

   |-- getStimPoints.py

   |-- element_tag.csv

   |-- al_mk_H.par

   |-- requirements.txt

   |-- reproduceReentry.py

|-- data/

   |-- meshes/

       |-- P1/  

            |-- monoatrial/ 

       |-- biatrial/

.

.

.

       |-- P8   

            |-- monoatrial/ 

       |-- biatrial/

|-- results/

|-- MESH_SCENARIO_STATE_CHAMBER/ (e.g P1_bi_M_LA) 

|-- point_X_beat_Y

|                                                

|-- README.md

```

 

`src`: contains the source files needed to run PEERP protocol 





`run.py` This is the main function to run the pacing protocol (not needed to run if reentries are only reproduced, check reproduceReentry.py)

`induceReentry.py` Contains a list of pacing protocols. The PEERP protocol is included here

`getStimPoints.py` Extract the stimulation points

`element_tag.csv` Region tag numbering

`al_mk_H.par` Par file with ionic scaling factors for three states; H:Healthy, M:Mild, S:Severe

`requirements.txt` Packages to create the virtual enviroment. (This was my output of ```pip3 list> requirements.txt```)

`reproduceReentry.py` Reentries can be reproduced given a selected folder where the .par and .roe files are stored.



 

`data`: contains the `meshes` folder with the bilayer meshes in openCARP (.elem, .lon and .pts) and .vtk format. Synthetic fibrotic distributions are included in the the .regele files.





`meshes/P1/monoatrial/LA_stim_points.txt` stimulation points for the PEERP protocol

`meshes/P1/monoatrial/LA_bilayer_with_fiber_elems_not_conductive_M.regele` Element ids corresponding to synthetic fibrotic distribution with respect to remodeling states M and S. H state was modelled without fibrosis



 

Reproduce the reentries 

You can generate the .igb file of a specific reentry by selecting the corresponding folder in the results directory. An example is given to reproduce the reentry in P1_bi_M_LA/point_0_beat_2/reproduce_reentry.igb. Select the folder `--par_file_directory`and set `--tend` to define the duration of the simulation in miliseconds.

_HINT: We recommend keeping the folder structure so that the other parameters, such as: mesh, scenario, state and chamber, can be read from the --par_file_directory. Otherwise, the meshes and results directories need to be modified._

```

cd src/

reproduceReentry.py  --par_file_directory ../results/P1_bi_M_LA/point_0_beat_2 --tend 1500

 

```

![Transmembrane Voltage](./results/P1_bi_M_LA/reentry_with_colorbar.png)

 

 

Preparation before running the PEERP pacing protocol

 

Follow the next steps if you want to run the PEERP pacing protocol, either for the provided meshes or for your own meshes. To run the PEERP protocol in a controlled environment, it is recommended, before running the run.py, to create a virtual environment. Go to your terminal and type: 

```

cd src/

python3 -m venv ./myEnv

source ./myEnv/bin/activate

pip3 install -r requirements.txt

```

 

You need to add carputils to your `PATH`. You can run the code in the terminal or use and IDE to debug the code. 

Note: I am using PyCharm 2020.3. and in Settings --> Python interpreter --> show all and then in the (+) symbol, add the path to carputils there:

 

Otherwise you can add this extra lines at the beginning of `run.py``:

```

# Replace '/path/to/carputils' with the actual path to your carputils package

carputils_path = '/path/to/carputils'

# Add the carputils path to sys.path

sys.path.append(carputils_path)

```

Run the PEERP protocol

 

The following example runs the PEERP from a single stimulation point. If you want to run PEERP over all the points, simply add the flag --run_all_points 1 

```

cd src/

python3 run.py --giL 0.4166 --geL 1.458 --cv 0.8 --mesh monoatrial --protocol PEERP --pacing 122718 --stim_file LA_stim_points.txt --geometry LA_bilayer_with_fiber_um --cell_bcl 500 --model Courtemanche --ionic_prop_file al_mk_S.par --max_n_beats_PEERP 1 --overwrite-behaviour overwrite

```

 

Running your own experiment and making your own changes

Extract the stimulation points on your mesh, where the PEERP protocol will be run: 

```

python3 getStimPoints.py   --mesh monoatrial --tolerance 20000 --stim_file LA_stim_points.txt --chamber LA

```

 

Tune conduction velocity (CV) and conductivites. The code expects the intracellular end extracellular longitudinal conductivity values as an input. We used `tuneCV` to fit CV=0.7m/s with dx=0.4mm and dt=20us

If you want to adjust the values, run in the terminal:

```

tuneCV --resolution 400 --model Courtemanche --velocity 0.7 --converge True --sourceModel monodomain --surf True --dt 20

```

You can provide the location of the start of the activation by selecting the desired point ID:





Load the mesh in Paraview (or Meshalyzer)

click on the ? symbol

save the ID and change the `--pacing` argument 



 

Call `run.py` with a new mesh. The protocol starts by prepacing the mesh and then using the last beat as initial condition tu run the PEERP.

Be aware that for a monoatrial mesh you might need to give the new id for the location of the earliest activation. Change `12345` to your desired point ID.

```

python3 run.py --mesh newMesh --pacing 12345 --protocol prepace --stim_file LA_stim_points.txt

```

 

Run the protocol with different electrical remodelling stage. You can change the .par file or select one file from the three provided: 

```

python3 run.py --mesh newMesh --pacing 12345 --protocol PEERP --stim_file LA_stim_points.txt --args.ionic_prop 'l_mk_M.par'

```

 

You can also try to run a biatrial example. The biatrial mesh is also provided. You need to extract the points on the RA surface using `getStimPoints.py`, to run the RA experiment: 

```

cd src

python3 getStimPoints.py   --mesh biatrial --tolerance 20000 --stim_file RA_stim_points.txt --chamber RA

```

Then run PEERP twice, one per each chamber:

 

```

python3 run.py --mesh biatrial --geometry LA_RA_bilayer_with_fiber --pacing 12345 --stim_file LA_endo_2cm.txt --args.ionic_prop 'l_mk_M.par'

python3 run.py --mesh biatrial --geometry LA_RA_bilayer_with_fiber --stim_file LA_stim_points.txt --args.ionic_prop 'l_mk_M.par'