MOP-MCML: A User Guide and Technical Introduction
This manual provides a comprehensive guide for researchers modeling light propagation in biological tissues. Building upon the foundational physical models of standard MCML, the MOP-MCML framework extends capabilities to quantify the Mean Optical Path (MOP) traversed by photons from emission to detection. This document details the underlying principles, new features, input/output specifications, visualization tools, and a complete end-to-end workflow with validation examples.
1. Background and Objectives
In the design of wearable or implantable biomedical systems, Near-Infrared Spectroscopy (NIRS) is a cornerstone technology for assessing tissue physiology. However, relying solely on surface measurements of Reflectance (
- "Reachability": Does light penetrate to the target layer (e.g., muscle or deep vessels)?
- Pathlength: What is the effective optical pathlength for applying the Beer-Lambert law?
MOP-MCML addresses these needs by introducing:
- Configurable geometric detection regions (photodiodes).
- User-defined source profiles (Point, Gaussian, Flat-top).
- Direct computation and visualization of the Mean Optical Path (MOP).
- Device-consistent estimation of
and .
2. Overview of MCML
The Monte Carlo Multi-Layer (MCML) model, developed in the 1990s, remains the gold standard for steady-state optical simulations in turbid media [1]. It models tissue as a semi-infinite stack of layers aligned along the
Where:
: Absorption coefficient ( ) : Scattering coefficient ( ) : Anisotropy factor (dimensionless) : Refractive index
The reduced scattering coefficient is given by
MCML simulates photon packets undergoing random walk events (absorption, scattering, reflection/refraction) [2]. The statistical error of the simulation decreases with the total number of photon packets
3. Simulation Principles and Computational Methods
3.1 Photon Packets and Free-Path Sampling
The step size
In biological tissues (visible–NIR), the mean free path ranges from
3.2 Computing Reflectance and Transmittance
Standard MCML calculates
MOP-MCML introduces finite detectors. We define rectangular Photodiodes (PDs) on the reflection (
Where
3.3 Mean Optical Path and Penetration Depth
For the
We define the Intensity-Weighted Mean Optical Path (
Under the diffusion approximation, the theoretical penetration depth
This theoretical value serves as a benchmark for verifying numerical results.
4. Source–Detector Separation and DPF
4.1 Source–Detector Separation (SDS)
Geometry is critical in NIRS. MOP-MCML allows precise placement of sources and detectors. The SDS is calculated as:
- Reflection Mode:
- Transmission Mode:
4.2 The Differential Pathlength Factor (DPF)
The Modified Beer–Lambert Law (MBLL) relates absorbance changes
We can express
In the diffusive regime,
5. From MCML to MOP-MCML: Key Extensions
5.1 Measurement Geometry Modeling
MOP-MCML adds specific geometric definitions to the input file:
- detectors: Rectangular PDs defined by center coordinates and side lengths.
- Sources:
- Type 1: Point Source
- Type 2: Gaussian Beam
- Type 3: Flat-top Uniform Beam
5.2 Enhanced Output Statistics
New outputs include:
- Device-consistent
and : Based on finite detector aperture. : Intensity-weighted mean optical path.- Summary File: A
summary.csvis automatically generated, appending and from batch runs for easy analysis.
5.3 Improved I/O and Visualization
The output .mco file format is extended to include geometric metadata. This enables the MATLAB visualization scripts to:
- Draw exact source and detector positions.
- Visualize the source profile (e.g., inverted triangle for point, semi-transparent shape for area).
- Overlay these on the photon fluence map for clear interpretation.
6. Installation and Usage
6.1 Clone and Build
MOP-MCML is written in C.
1 | git clone https://github.com/Pasdeau/MOP-MCML.git |
Build Commands:
- Linux/macOS:
1
gcc -O3 -o mop-mcml *.c -lm
- Windows: Use Visual Studio with Release configuration and
/O2optimization.
6.2 Input File (.mci) Essentials
The input file structure dictates the simulation. Key additions for MOP-MCML are the source type and geometric coordinates for PDs. Ensure strict adherence to the format (avoid sparse blank lines between data blocks).
6.3 Running the Simulation
1 | ./mop-mcml your_input_file.mci |
6.4 MATLAB Visualization
Using the provided MATLAB scripts:
- Parse: Read the
.mcofile. - Render: Use
imagescto plot . - Overlay: The script automatically draws the source (top) and detectors (reflection/transmission) based on the file metadata.
7. Validation Results
We verified MOP-MCML against analytical models and standard test cases.
- Single-Layer Tissue (
nm):- Simulated penetration depth agreed with diffusion theory (
cm) within . - Transmittance matched theoretical expectations.
- Simulated penetration depth agreed with diffusion theory (
- Non-Scattering Medium:
- Compared against Beer-Lambert Law (
). - Error was
across .
- Compared against Beer-Lambert Law (
8. Practical Guide: Parameter Selection
- Photon Count: Start with
for quick scans, then use or for final high-precision results. - SDS Optimization: Use batch mode to scan multiple SDS values to find the sweet spot between signal strength (
) and penetration depth. - Detector Sizing: Match the simulated PD size to your physical hardware (e.g.,
mm) to get realistic photon counts. - Troubleshooting: If MATLAB fails to parse
.mco, check if the geometric metadata lines exist at the end of the file. Legacy readers may need updates.
9. Examples
A. Batch Simulation Input (.mci)
This example defines two runs with different source wavelengths (
1 | 1.0 # file version |
B. Visualization: Optical Path Distribution
The figure below compares Reflection Mode (left) and Transmission Mode (right). Note how photon paths distribute differently, affecting the sampled volume.
C. Multilayer Ankle Model
A complex model simulating light propagation through Epidermis, Dermis, Hypodermis, and Ligament layers. By setting SDS
References
[1] S.L. Jacques. "History of Monte Carlo modeling of light transport in tissues using mcml.c." J. Biomed. Opt., 27(8), 083002, 2022. DOI: 10.1117/1.JBO.27.8.083002.
[2] S. Chatterjee, P.A. Kyriacou. "Monte Carlo Analysis of Optical Interactions in Reflectance and Transmittance Finger Photoplethysmography." Sensors, 19(4), 2019. DOI: 10.3390/s19040789.
[3] S. Chatterjee et al. "Monte Carlo investigation of the effect of blood volume and oxygen saturation..." Biomed. Phys. Eng. Express, 2(6), 065018, 2016. DOI: 10.1088/2057-1976/2/6/065018.
[4] A.N. Bashkatov et al. "Optical properties of skin, subcutaneous, and muscle tissues: a review." J. Innov. Opt. Health Sci., 4(01): 9–38, 2011. DOI: 10.1142/S1793545811001319.
[5] I. Saliba, W. Wang et al. "A Review of Chronic Lateral Ankle Instability..." J. Clin. Med., 13, 442, 2024. DOI: 10.3390/jcm13020442.