A python API and graphical plugin for the penRed Monte Carlo code: Enhancing usability and workflow integration
收藏Mendeley Data2026-04-18 收录
下载链接:
https://data.mendeley.com/datasets/4c4zvgm2r6
下载链接
链接失效反馈官方服务:
资源简介:
Monte Carlo (MC) simulations are a cornerstone of scientific computing in fields like medical physics, but their complexity often poses significant usability challenges. Setting up simulations requires intricate configuration and 3D geometry definition, which are error-prone and time-consuming tasks. Furthermore, the integration of MC tools into modern, Python-centric scientific workflows for analysis and AI can be difficult. This work addresses these challenges for the penRed MC code by introducing a comprehensive framework designed to enhance its accessibility, usability, and integration. We present pyPenred, a high-performance Python module that exposes the complete capabilities of penRed within the Python ecosystem. Built with pybind11, it allows computationally intensive particle transport to be handled by optimized C++ binaries while enabling seamless control and analysis in Python. Performance benchmarks show a minimal overhead of only 1–2% for locally compiled versions compared to native C++ execution. To simplify geometry creation and simulation setup, we developed a dedicated Blender plug-in. This integrated graphical environment supports constructing models with both quadric surfaces and triangular meshes, and provides an intuitive interface for defining materials, sources, and tallies. Finally, we have established robust cross-platform compatibility through continuous integration, automatically distributing pre-compiled binaries and pip-installable Python wheels for Linux, Windows, and macOS. Collectively, these contributions transform penRed from a specialized code-centric tool into an integrated and user-friendly simulation platform, lowering the barrier to advanced MC simulations and fostering tighter integration with contemporary data science workflows.
蒙特卡洛(Monte Carlo,MC)模拟是医学物理等领域科学计算的基石,但其复杂性往往带来显著的易用性挑战。搭建模拟流程需要复杂的配置与三维几何定义,此类工作不仅极易出错,且耗时耗力。此外,将MC工具集成到以Python为核心的现代科学分析与人工智能工作流中,往往颇具难度。本研究针对penRed MC代码的上述挑战,提出了一套旨在提升其可访问性、易用性与集成性的综合性框架。我们推出pyPenred:一款高性能Python模块,可在Python生态系统中完整暴露penRed的全部功能。该模块基于pybind11开发,可将计算密集型的粒子输运任务交由优化后的C++二进制程序处理,同时支持在Python中实现无缝的流程控制与数据分析。性能基准测试表明,本地编译版本相较于原生C++执行仅产生1%至2%的微乎其微的性能开销。为简化几何建模与模拟配置流程,我们开发了一款专属的Blender插件。该集成化图形环境支持通过二次曲面与三角网格两种形式构建仿真模型,并提供直观界面以定义材料、粒子源与计数(tally)。最后,我们通过持续集成实现了可靠的跨平台兼容性,可针对Linux、Windows及macOS系统自动分发预编译二进制程序与可通过pip安装的Python wheel包。综上,这些工作将penRed从一款专用的以代码为核心的工具,转型为集成化且易用的仿真平台,降低了高级MC模拟的应用门槛,并推动其与现代数据科学工作流实现更深度的集成。
创建时间:
2026-03-20



