Software¶
The SPECULAR project contributes to open-source software for medical simulation. All developed code is freely available for research and educational use.
SOFA Framework¶
SPECULAR is built on top of SOFA (Simulation Open Framework Architecture), an open-source framework for real-time simulation.
- SOFA Main Repository
C++ framework for multi-physics simulation
- Documentation
User guides, API reference, and tutorials
- Download
Pre-compiled binaries and source code
SPECULAR Plugins¶
ModelOrderReduction Plugin¶
Enhanced with hybrid simulation capabilities developed in SPECULAR.
Features: - Proper Generalized Decomposition (PGD) - Empirical Cubature Hyper-Reduction (ECSW) - Hybrid reduced/full model coupling - Real-time performance
SoftRobots Plugin¶
Extended with needle-specific constraints and haptic coupling.
Features: - Constraint-based contact mechanics - Haptic device integration - Force feedback rendering - Actuator models
SPECULAR Scenes¶
Sample simulation scenarios for needle insertion training.
Contents: - Liver phantom models - Needle instrument definitions - Training scenarios - Validation benchmarks
Getting Started¶
Installation¶
Prerequisites¶
- OS: Windows 10/11, Linux (Ubuntu 20.04+), macOS 10.15+
- Compiler: Visual Studio 2019+, GCC 9+, Clang 10+
- CMake 3.16+
- Python 3.7+
Quick Install¶
# Clone SOFA
git clone https://github.com/sofa-framework/sofa.git
cd sofa
# Configure and build
mkdir build && cd build
cmake ..
make -j$(nproc)
With Plugins¶
# Clone plugins
git clone https://github.com/sofa-framework/ModelOrderReduction.git
git clone https://github.com/sofa-framework/SoftRobots.git
# Configure with plugins
cmake -DPLUGIN_MODELORDERREDUCTION=ON \
-DPLUGIN_SOFTROBOTS=ON \
..
Running SPECULAR Scenes¶
Tutorials¶
Tutorial 1: Basic Needle Insertion¶
Learn to set up a simple needle insertion simulation.
Tutorial 2: Haptic Integration¶
Connect a haptic device to your simulation.
Tutorial 3: Custom Scenarios¶
Create your own training scenarios.
API Reference¶
Python Bindings¶
SOFA provides Python bindings for rapid prototyping:
import Sofa
# Create scene
def createScene(root):
root.gravity = [0, -9.81, 0]
root.dt = 0.01
# Add liver model
liver = root.addChild('liver')
liver.addObject('MechanicalObject',
template='Vec3d',
position='@meshLoader.position')
liver.addObject('TetrahedronFEMForceField',
youngModulus=5000,
poissonRatio=0.45)
return root
C++ API¶
For performance-critical components, use the C++ API:
#include <sofa/core/ObjectFactory.h>
#include <SofaBaseMechanics/MechanicalObject.h>
// Create mechanical object
MechanicalObject3::SPtr mechObj =
sofa::core::objectmodel::New<MechanicalObject3>();
Validation¶
Benchmarks¶
Performance benchmarks are provided for validation:
| Test Case | Mesh Size | Real-time Factor |
|---|---|---|
| Liver deformation | 5K tetrahedra | 50x |
| Needle insertion | 10K tetrahedra | 10x |
| Haptic coupling | 10K tetrahedra | 1kHz stable |
Unit Tests¶
Contributing¶
We welcome contributions! Please see:
Reporting Bugs¶
For SPECULAR-specific issues:
- Check existing issues
- Create new issue with label
SPECULAR - Include minimal reproducible example
Citation¶
If you use SPECULAR software in your research:
@software{specular2021,
title={SPECULAR: Simulation of Percutaneous Procedures},
author={SPECULAR Consortium},
year={2021},
url={https://specular-project.github.io}
}
@software{sofa2021,
title={SOFA: Simulation Open Framework Architecture},
author={Faure, Fran{\c{c}}ois and others},
year={2021},
url={https://www.sofa-framework.org}
}
Support¶
Community¶
- Forum: SOFA Forum
- Discord: Join SOFA Discord
- GitHub Discussions: SOFA Discussions
SPECULAR-Specific Support¶
For questions specific to SPECULAR:
- Email: support@specular-project.fr
- GitHub Issues with tag
SPECULAR
License¶
SOFA and SPECULAR plugins are released under the LGPL v2.1 license.