Skip to the content.

Build Latest release GitHub code size in bytes GitHub issues Maintenance GitHub last commit GitHub top language GitHub

MC/DC logo

User Friendly, Fast and Robust Monte Carlo Diffusion and Collision Simulator
Explore MC/DC docs and examples »

Report bug · Request feature

[!IMPORTANT] This is MC/DC v2.3.2 — the current stable release, on the default branch (master): permeable-membrane crossing fix (compartment volume fractions are preserved when D_intra ≠ D_extra), dynamical-history signal split, explicit sphere-radii injection, SI units, the modernized PGSE protocol, multi-compartment substrates, four tutorials, pip install, and cross-platform binaries on the Releases page.

v2.3.2 fixes a population drift on permeable PLY meshes: after a permeable crossing the walker was advanced 2 nm past the membrane even beyond the end of the step, lengthening the step into the destination compartment; an equilibrium (uniform) mesh lost ~0.4 % of its intra population in 20 ms (N = 10⁶, T = 20000), growing as the step shrinks. The advance is now capped at the remaining step (the mesh then matches the analytic sphere and the GPU to ~10⁻³). Analytic spheres/cylinders and impermeable substrates are unaffected.

v2.3.1 is a hotfix to ensure SI units in all files: the T2 column of spheres_list / cylinders_list is now read in seconds like every other file quantity (it was previously taken as milliseconds). Lists with a finite T2 written in ms must be converted to seconds. Looking for an earlier version? Every release is tagged — e.g. v2.2.0, or 1.5.1 for the last 1.x — and the binaries are on the Releases page.

Table of contents

Introduction

The Monte Carlo Diffusion and Collision simulator (MC/DC) is a C++ open-source Diffusion-Weighted Magnetic Resonance Imaging (DW-MRI) Monte-Carlo simulator. For an in-detail explanation of the numerical framework and the basics of DW-MRI we refer the visitor to the following publication: https://doi.org/10.3389/fninf.2020.00008

Citation:

AUTHOR=Rafael-Patino Jonathan, Romascano David, Ramirez-Manzanares Alonso, Canales-Rodríguez Erick Jorge, Girard Gabriel, Thiran Jean-Philippe TITLE=Robust Monte-Carlo Simulations in Diffusion-MRI: Effect of the Substrate Complexity and Parameter Choice on the Reproducibility of Results JOURNAL=Frontiers in Neuroinformatics VOLUME=14 YEAR=2020 PAGES=8 URL=https://www.frontiersin.org/article/10.3389/fninf.2020.00008 DOI=10.3389/fninf.2020.00008 ISSN=1662-5196

Quick start

Several quick start options are available:

Note on units. A .conf file (and its scheme) is in standard SI units by default — metres, seconds, Tesla — scaled internally to mm/ms on load. This applies to all lengths, including the substrate-generation scales (ply_scale and the sphere/cylinder list scale are “metres per file unit”, and gamma beta/min_radius are in metres). Set use_mm_ms 1 to declare a file already in the internal units; the legacy scale_from_stu flag is still accepted but deprecated.

Status

Maintenance GitHub last commit GitHub issues ForTheBadge built-with-science

What’s included

The MC/DC Simulator uses the C++ Eigen template library for linear algebra as its only external dependency, which is bundled in the repository (src/Eigen); all other components — from the 3D-mesh handling to the MRI signal synthesis — are built from scratch as class-oriented modules with abstract base prototypes that can be inherited and re-implemented to extend the simulator.

MC/DC diffuses spin packets through a user-defined substrate and synthesizes the resulting DW-MRI signal. It supports:

Bugs and feature requests

Have a bug or a feature request? Please search the existing and closed issues first. If your problem or idea is not addressed yet, open a new issue.

Documentation

Per-parameter and per-block reference lives in the Getting started page and in the commented example configurations under docs/conf_file_examples/. Source-level API documentation can be generated with doxygen from the in-source comments.

Versioning

The first version, 1.42, is the one released with the paper and is preserved for full reproducibility of the published results at https://github.com/jonhrafe/Robust-Monte-Carlo-Simulations. Subsequent 2.x releases add features and changed the configuration conventions — most notably, .conf files are now in SI units by default (see the note under Quick start). Configuration files written for 1.42 may need updating; the bundled examples reflect the current conventions.

Developer(s)

Jonathan Rafael-Patino

GNU Lesser General Public License v2.1

Primarily used for software libraries, the GNU LGPL requires that derived works be licensed under the same license, but works that only link to it do not fall under this restriction.