Brain geometry
OSS-DBSv2 distinguishes between a brain-only geometry and the final simulation geometry. The brain geometry defines the simulation domain, while the full model geometry combines that domain with implanted electrodes, contact surfaces, and optional encapsulation layers.
Two geometry levels
BrainGeometrydescribes the outer brain domain used for meshing and field computation.ModelGeometrycombines the brain domain with one or more electrode models and assigns the contact and material regions needed for the FEM solve.
In practical terms, most users configure geometry indirectly through the input JSON. The code then constructs the necessary CAD objects automatically.
Brain geometry definition
The brain domain can be defined in two main ways:
as a simple analytic shape such as a sphere, ellipsoid, or box
from imaging-derived information, for example by using the MRI bounding box and affine transformation
This level is mainly responsible for setting the spatial extent of the
simulation and naming the outer surface as BrainSurface.
Electrode integration
Electrodes are created separately and then inserted into the brain domain. When
the final ModelGeometry is assembled, OSS-DBSv2:
places the electrode CAD models according to position, direction, and rotation
creates contact surfaces with stable names such as
E1C1adds encapsulation layers when requested
prepares surface and volume names used later for materials, boundary conditions, and mesh refinement
This step is central because it connects the anatomical model to the numerical problem that is solved by the volume conductor model.
Practical considerations
Choose a brain region that is large enough to avoid boundary effects but not so large that meshing becomes unnecessarily expensive.
Start with standard electrode models whenever possible before introducing custom geometries.
If geometry construction fails, reduce complexity first: smaller domain, simpler shape, or no encapsulation layer.
Use the example cases to understand how contact numbering maps to the final geometry.