Development of a Three-Dimensional Computational Pipeline in Python for Personalized Heart Modeling

Filipe De Lima Namorato1, Daniel moreira Leme1, Thaís de Jesus Soares1, Rafael Sachetto Oliveira2, THAIZ RUBERTI SCHMAL3, Rodrigo Weber dos Santos1, Joventino de Oliveira Campos1
1Federal University of Juiz de Fora, 2Univerisidade Federal de S�o Jo�o del-Rei, 3EBSERH University Hospital Juiz de Fora


Abstract

Cardiac diseases remain a major health concern, often involving electrical and structural alterations. With increased availability of cardiac MRI and modeling tools, it is now possible to build personalized heart models reflecting patient-specific anatomy and fibrotic remodeling. These models support arrhythmia simulation and therapy planning, enabling more precise and individualized care.

This work presents a three-dimensional Python-based pipeline to generate personalized cardiac models from segmented MRI data. It integrates anatomical alignment, reconstruction of cardiac and fibrotic surfaces, volumetric mesh generation, and fiber orientation assignment. The pipeline outputs biventricular meshes suitable for electrophysiological simulations using finite-element or finite-volume solvers. Leveraging open-source libraries such as VTK and GMSH, it ensures reproducibility and adapts to diverse modeling needs.

A key feature is the integration of fibrotic regions via clustering, preserving anatomical detail relevant for arrhythmia modeling. After converting the final mesh to .alg, the outputs can be used in MonoAlg3D to simulate ventricular activity and assess therapies. Comparisons with a MATLAB-based tool confirm improved fibrotic detail and no licensing limitations.

This open-source solution supports advanced cardiac modeling in research settings, offering a reproducible and accessible toolchain for personalized simulations.