- Author: Qianqian Fang (q.fang at neu.edu) and Yuxuan Zhang (zhang.yuxuan1 at northeastern.edu)
- License: GNU General Public License version 3 (GPLv3)
- Version: v2023 (Beta)
- Website: http://mcx.space/BlenderPhotonics
- Acknowledgement: This project is funded by NIH awards R01-GM114365 and U24-NS124027
BlenderPhotonics is a Blender addon to enable 3-D tetrahedral mesh generation (via Iso2Mesh) and mesh-based Monte Carlo (MMC) photon simulations (via MMCLAB) and voxel-based Monte Carlo (MCX) photon simulation inside the Blender environment.
BlenderPhotonics supports three processing workflows: 1) converting 3-D Blender objects to region-labeled tetrahedral meshes and triangular surfaces; 2) converting a volumetric image stored in a NIfTI file to a multi-labeled tetrahedral mesh, and 3) defining optical properties of each region and a light source to execute and render MMC simulation results. Each feature can be achieved via a single click on the GUI.
BlenderPhotonics combines the interactive 3-D shape creation/editing and advanced modeling capabilities provided by Blender with state-of-the-art Monte Carlo (MC) light simulation techniques and GPU acceleration. It uses Blender's user-friendly computer-aided-design (CAD) interface as the front-end to allow creations of complex domains, making it easy-to-use for less-experienced users to create sophisticated optical simulations needed for a wide range of biophotonics applications.
If you use BlenderPhotonics in your research, please cite the below paper:
Yuxuan Zhang and Qianqian Fang, "BlenderPhotonics: an integrated open-source software environment for three-dimensional meshing and photon simulations in complex tissues", J. of Biomedical Optics, 27(8), 083014 (2022) doi: https://doi.org/10.1117/1.JBO.27.8.083014
- Install Blender (4.4 or higher)
- Download BlenderPhotonics as zip
- Install BlenderPhotnics in Blender: Edit->Preference->Add-ons->Install from Disk. Select BlenderPhotnics.zip to install
- Navigate to the main page, where BlenderPhotonics should appear in the sidebar. Open BlenderPhotonics, and the Dependencies tab will automatically verify the installation of the required dependencies.
- Click "Install All", wait a while (~ 5 min) to finished all preparation work
- Dependencies tap will display 'All dependencies available'. Restart Blender to initialize BlenderPhotonics.
- Construct the model: At 3D Viewport Shift + A, select Mesh->Cube. Add a cube to the scene.
- Open the PMCX tab in BlenderPhotonics and click "convert scene to voxel mesh".
- Change 3D Viewport to "Rendered", to check voxel mesh quility`P
- Click "Load voxel mesh and setup simulation" button.
- Setup light source position, direction and then setup light source paramater at Lightsource's custom properties.
- Setup optocial paramater for each region.
- Click "Run PMCX Simulation" to start mcx simulation.
- Once the simulation is finished, the results will be automatically loaded into Blender.
- Input the path of the .mat file into the
JNIfTIF File
- Click
Load volume
- Click
Concert volume to xx mesh
- Input the optical parameters file. could be .json or .mat
- Click `Load optical parameters.
.mat file example:
'node': [[1,1,1], [2,2,2]...] # vertex coordinate. pmmc workflow only. shape: N*3
'elem':[[1,3,13,4], [3,58,2,4]...] # Quadrilateral vertex index, pmmc workflow only. shape: M*4
'elemprop':[[1,2,4,5,4,2,8...]] # Index of the quadrilateral optical domain, pmmc workflow only. shape: M*1
'vol':[[[1,1,3,4,5,2,3,4], [1,1,3,4,5,2,3,4]...]...] # Voxel Grid Data. The value represents the optical domain index. pmcx workflow only
'prop': [[0,0,1,1.37], [0.01,0.05,1.1,1.35]...] # Optical properties of optical domains. required if .mat file used to load optical paramater. shape:Z *4, Z is the domain number
.json file example:
# give name according to your total region number. For example, if your have 15 regions, you should have:'region_01', 'region_02` ...
'region_001':[0,0,1,1.37]
'region_002': [0.01,0.05,1.1,1.35]
...