BlenderPhotonics is a Blender addon to enable 3-D tetrahedral mesh generation (via Iso2Mesh)
and mesh-based Monte Carlo (MMC) photon simulations (via MMCLAB) inside
the Blender environment. Both Iso2Mesh and MMCLAB are executed in GNU Octave, which interoperates with Blender
via the oct2py
module and the bpy
Python interface.
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:
PATH
environment variable.
on Ubuntu Linux, this can be done by sudo apt-get install blender octave
.
How to verify: type blender and octave in a command line window, they should startoct2py
for the bundled (built-in) Python inside Blender (not your system's Python)
python3 --version
, if the printed version is the same as Blender bundled Python
version, you may go to Step 2.4sudo apt-get install python3.x
- here "3.x" must
match what you saw in the Blender's scripting window.sudo python3 -m pip install oct2py jdata
or sudo python3.x -m pip install oct2py jdata
, this will
download and install oct2py
and jdata
and their dependencies to the system's python folder, and all
other users on the same computer can use it. If you just want to install oct2py for your own account,
or do not have sudo
, you can install by python3 -m pip install oct2py jdata --user
or
python3.x -m pip install oct2py jdata --user
. This wil install all modules
under ~/.local/lib/python3.x/site-package
folder. Run pip install bjdata
if needing binary JMesh filesoct2py
and jdata
by first typing import sys
and
sys.path
in the Python console in the Scripting view in Blender. This prints a list of paths that
Python searches to look for modules. You may copy the oct2py
and jdata
folders that you have installed
on your system's Python module folder to one of the sys.path
foldersimport oct2py
and import jdata
in the "Scripting" tab of Blender with no error~/.octaverc
with a
text editor and type
addpath('/path/to/iso2mesh');
addpath('/path/to/mmclab');
addpath('/path/to/zmat');
How to verify: start octave, and type which s2m
, which zmat
and which mmc
, you should see their paths printed
mmc
and enter in Octave command window, if you see the error message
"liboctinterp.so.4: cannot open shared object file: No such file or directory",
this suggest that you are using an Octave newer than the version that was used to compile mmc.mex
. To solve
this issue, you must run sudo ln -s /usr/lib/x86_64-linux-gnu/liboctinterp.so.7 /usr/lib/x86_64-linux-gnu/liboctinterp.so.4
or recompile mmc.mex by downloading the source code.
see this mailing list post for details.~/.config/blender/2.82/scripts/addons/BlenderPhotonics
<
button next to the x/y/z-axis icon on the right-top of the Layout view to show the
"N-Panel", and BlenderPhotonics is shown as a tab at the bottom. Click on it to see the BlenderPhotonics GUI.