V. H. Yu et al., "DBS-ElecNet: Automated Localization and Segmentation of DBS Electrodes in Clinical MRI," 2026 IEEE 23rd International Symposium on Biomedical Imaging (ISBI), London, United Kingdom, 2026, pp. 1-4, doi:10.1109/ISBI61048.2026.11515562
Give SALINE a raw clinical T1-weighted MR image and get a segmentation back. It runs as a fully standalone CLI tool.
It is the core of DBS-ElecNet's classical (non-deep-learning) segmentation pipeline.
SALINE is a classical, filtering-based automatic segmentation method for DBS electrodes: no training, no manual annotation, no GPU. See the paper above for how the pipeline works.
That makes it well suited to building a large labeled dataset without manual annotation, exactly how DBS-ElecNet's own training data was produced.
SALINE is two separate things: the Python package, and the imaging tools
it calls out to (SynthStrip, SynthSeg, ANTs). pip install only gives you
the first. The tools are not Python dependencies and don't come with it.
1. Create an environment and install the Python package
Requires Python 3.12+.
Pure Python:
python3.12 -m venv .venv
source .venv/bin/activate
pip install saline-dbsconda / mamba:
conda create -n saline python=3.12
conda activate saline
pip install saline-dbs(substitute mamba for conda throughout if that's what you use)
This installs the saline CLI and its Python dependencies.
2. Install Docker (recommended)
Install Docker and make sure it's running. SALINE pulls the images it needs automatically the first time it runs. There's nothing to install yourself beyond Docker itself:
With Docker running, saline --input subject.nii.gz works end to end.
Running without Docker
If Docker isn't available:
- SynthStrip and SynthSeg have no local fallback. Pass precomputed files
instead:
--brain_mask PATHand--synthseg PATH, already in the same 1mm-isotropic space SALINE would otherwise resample--inputinto. - ANTs falls back to a local install:
ResampleImage,N4BiasFieldCorrection, andImageMathonPATH.
Dual-electrode (default, also available explicitly as saline dual):
saline --input subject.nii.gzSingle-electrode:
saline single --input subject.nii.gz--input is a raw, native-space clinical MRI; SALINE handles the rest.
See Install for what that needs and how to run without Docker.
Output:
subject_saline_elecSeg.nii.gz: the electrode segmentation, in--input's native space.subject_1mm_iso.nii.gz: the resampled MRI, kept for reference.subject_1mm_iso_saline_elecSeg.nii.gz: the electrode segmentation, in 1mm-isotropic space.
Optional arguments:
--threads(default5): threads for SynthSeg.--laplacian_threshold(default0.21)--frangi_threshold(default0.25)--lower_frangi_threshold(default0.2): used if the higher threshold finds no candidates.--expand_radius(default6): dilation radius applied to the final line mask.--save_intermediate: also save the thresholded Laplacian, Frangi, and combined masks.
If you use this in your work, please cite the paper above (see CITATION.cff
for the full machine-readable record).