Related Experiment Video
Updated: Jun 6, 2026

Serial Two-Photon Tomography of the Whole Marmoset Brain for Neuroanatomical Analyses
Published on: January 17, 2025
PyMeshTool - A framework for building efficient automated image-based cardiac anatomical twinning workflows in Python
Matthias A F Gsell1, Benedikt A Klöckl1, Aurel Neic2
1Gottfried Schatz Research Center, Division of Medical Physics and Biophysics, Medical University of Graz, Graz, 8010, Austria.
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.
