Skip to main navigation Skip to search Skip to main content

PyMeshTool - A framework for building efficient automated image-based cardiac anatomical twinning workflows in Python

Research output: Contribution to journalResearch article

Abstract

BACKGROUND AND OBJECTIVE: Digital twin models representing human cardiac electrophysiology have evolved from being primarily research-oriented tools to becoming integral components in clinical decision-making and patient-specific simulations. The development of such models fundamentally begins with the construction of an accurate anatomical twin, which is typically derived from high-resolution clinical imaging data. This anatomical modeling phase, while essential, is often computationally intensive and time-consuming, necessitating efficient tools to streamline the workflow. To address this need, PyMeshTool, a Python interface for MeshTool, was developed with the primary objective of simplifying and accelerating the anatomical twinning process.

METHODS: The C/C++ codebase of MeshTool was restructured to avoid unnecessary source code duplication and to ease the development of the Python interface PyMeshTool. Particular emphasis was placed on the design of PyMeshTool as a streamlined interface that exposes core functionalities of MeshTool in a consistent and user-friendly manner. To evaluate the effectiveness of this design, two Python scripts were implemented running the same anatomical twinning pipeline, one utilizing PyMeshTool and the other calling MeshTool as an external tool. For this purpose, a basic bi-ventricular model generation pipeline was implemented that comprises the generation of simplified universal ventricular coordinates and the assignment of rule-based fibers & sheets. Runtimes and data output of the two workflows were compared for a series of numbers of parallel OpenMP threads.

RESULTS: In addition to the primary advantage of PyMeshTool- easy interaction with other Python modules via the Python interface and the compatibility with NumPy- the computational benefits of PyMeshTool have been demonstrated in several comparisons: (i) the PyMeshTool workflow produced less output, 4 files with 89.5MB instead of 418 files with 774.9MB (∼88% less storage usage), (ii) the Python source code was ∼63% shorter in terms of code lines, and (iii) an up to four times faster runtime.

CONCLUSION: With the release of the freely available PyMeshTool module, our work aims to streamline image and mesh processing in Python to ease the development of complex pipelines.

Original languageEnglish
Article number109476
Pages (from-to)109476
Number of pages11
JournalComputer Methods and Programs in Biomedicine
Volume285
Early online date2 Jun 2026
DOIs
Publication statusE-pub ahead of print - 2 Jun 2026

Branches of science

  • 101 Mathematics
  • 302 Clinical Medicine
  • 301 Medical-Theoretical Sciences, Pharmacy
  • 103 Physics, Astronomy
  • 305 Other Human Medicine, Health Sciences
  • 102 Computer Sciences
  • 206 Medical Engineering

Fingerprint

Dive into the research topics of 'PyMeshTool - A framework for building efficient automated image-based cardiac anatomical twinning workflows in Python'. Together they form a unique fingerprint.

Cite this