OsteoOpt: A Bayesian Optimization Framework for Enhancing Bone Union Likelihood in Mandibular Reconstruction Surgery
Repository Status: Under Reconstruction
OsteoOpt is a Bayesian optimization framework designed to improve bone union likelihood in mandibular reconstruction surgery and facilitates computer-aided intervention by systematically varying key surgical parameters—resection plane orientation, donor bone positioning, and graft length—across three mandibular regions. This repository contains the core code and configuration details required to set up the system.
Demo illustrating a single iteration of the optimization process for the Body (B) defect case (video speed increased for better demonstration):
Optimization_Workflow_V2.mp4
Before installing and running the framework, ensure your system meets the following requirements (tested on Windows 10; currently only compatible with Windows):
-
Artisynth Components:
- Artisynth Core
- Artisynth VSP
- Artisynth Jaw Model
(Note: Artisynth VSP and Artisynth Jaw Model are included within this repository.)
-
Install JDK 8 or Higher (64-bit):
ArtiSynth requires a full 64-bit Java Development Kit (JDK) with a Java compiler—using only a Java Runtime Environment (JRE) is not sufficient.- Download: We recommend installing a JDK from Oracle. Visit Oracle Java Downloads and choose the appropriate installer for your system. For Windows, the easiest option is often the “x64 Installer.”
- Note for JDK Versions:
- For ARM-based Windows systems, you must still install a 64-bit Intel-based JDK (look for “x64” in the download name) to run via the Intel compatibility layer.
-
Verify the JDK Installation:
Open a CMD window and run:javac -version
-
Install Eclipse:
- Donwload and install Eclipse IDE
- Open Window > Preferences from the main menu.
- In the Preferences dialog, go to Java > Installed JREs and click Add....
- In the JRE Type dialog, keep Standard VM selected and click Next.
- In the JRE Definition dialog, enter the JDK installation folder
-
Download Required Repositories: Open Eclipse and import the GitHub project using File → Import → Projects from Git → Clone URI.
-
Artisynth Core:
The current development version ofartisynth_coreis available from GitHub. To clone it, use the following URL in Eclipse:https://github.com/artisynth/artisynth_core.git
-
Artisynth VSP & Artisynth Jaw Model:
These components are included in this repository. You can find them in theartisynth_VSPandartisynth_JawModeldirectories.
-
-
Configure Projects:
- Set the run configuration for
artisynth_coreso that it has access to the two supporting libraries. - Adjust the build settings for each supporting library to ensure they are visible during runtime.
- Launch the
artisynth_coreapplication and add the models by selecting Models -> Edit Menu -> Add Packages. - Then, go to Settings -> External Classpath -> Add Class Folder and add the folders for
artisynth_VSPandartisynth_JawModelseparately to ensure they are visible externally through MATLAB.
- Set the run configuration for
For more information on additional details, visit Artisynth Webpage.
- Set External Class Path:
Install and open MATLAB. Then add theartisynth_coreMATLAB folder to your path so that Java classes are available. For example:
addpath(fullfile('path','to','artisynth_core','matlab'));- Environment Variable:
- Set the
ARTISYNTH_HOMEenvironment variable to the path whereartisynth_coreis installed. Then set the Artisynth class path in MATLAB using:
setArtisynthClasspath(getenv('ARTISYNTH_HOME'));-
Install Python via Anaconda:
Create and activate a Python 3.8 environment (or a compatible version) using the following commands:conda create -n matlab_env python=3.8 conda activate matlab_env
-
Install PyMeshLab:
With the environment activated, install PyMeshLab:pip3 install pymeshlab
-
Connect MATLAB to Python:
In MATLAB, configure the Python executable for your Anaconda environment (e.g., an environment named "matlab_env") by running:pyenv('Version', 'C:\path\to\anaconda3\envs\matlab_env\python.exe')
Replace
C:\path\to\anaconda3\envs\matlab_env\python.exewith the full path to your Python executable for the desired environment. -
Increase Java Heap Memory in MATLAB:
Navigate to Home → Preferences → General → Java Heap Memory in MATLAB and increase the allocated memory if needed.
- Running the Framework:
- Locate the
matlabfolder withinArtisynth_JawModel. - To run the optimization for a one-segment case, execute
MainOneSegment.m. The defect type can be chosen within the code (options: Body (B) or Symphysis (S)). - To run the optimization for a two-segment case (e.g., Ramus and Body (RB)), execute
MainTwoSegment.m. - To test the three-stage workflow for a single iteration, you can run
BDefectManual.m,SDefectManual.m, orRBDefectManual.m.
- Locate the
Important: Due to ethical considerations, the patient-specific mesh file is not included in this repository. Additionally, some parameter values in this repository may differ from those reported in the paper due to ongoing experimental adjustments and fine-tuning during development.
This project is licensed under the GNU General Public License v3. See the LICENSE file for details. Please do not redistribute the current version, as it is intended for review purposes only.