Skip to main content

SALINE (part of DBS-ElecNet)

Segmentation Algorithm using LINe-fitting for Electrodes

Version License Release PyPI

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 usage: a raw MRI goes into the saline CLI, which returns the final mask, the resampled MRI, and the mask in 1mm-isotropic space

Table of Contents

Why SALINE?

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.

Install

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-dbs

conda / 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 PATH and --synthseg PATH, already in the same 1mm-isotropic space SALINE would otherwise resample --input into.
  • ANTs falls back to a local install: ResampleImage, N4BiasFieldCorrection, and ImageMath on PATH.

Usage

Dual-electrode (default, also available explicitly as saline dual):

saline --input subject.nii.gz

Single-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 (default 5): threads for SynthSeg.
  • --laplacian_threshold (default 0.21)
  • --frangi_threshold (default 0.25)
  • --lower_frangi_threshold (default 0.2): used if the higher threshold finds no candidates.
  • --expand_radius (default 6): dilation radius applied to the final line mask.
  • --save_intermediate: also save the thresholded Laplacian, Frangi, and combined masks.

Citation

If you use this in your work, please cite the paper above (see CITATION.cff for the full machine-readable record).

Contributors

Vanessa H. Yu and Sriranga Kashyap

Metadata

Release files for saline-dbs 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for saline-dbs 0.3.1
File Size Uploaded Provenance Actions
saline_dbs-0.3.1.tar.gz 14.4 kB With provenance Details for saline_dbs-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for saline-dbs 0.3.1
File Interpreter ABI Platform Actions
saline_dbs-0.3.1-py3-none-any.whl Python 3 none any Details for saline_dbs-0.3.1-py3-none-any.whl

Total release size: 29.0 kB

Release files / saline_dbs-0.3.1.tar.gz

Download URL saline_dbs-0.3.1.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8e35aff53ae5eba0d335a97b1f3bc3d1f917295aac55a9e1c6cbe741fe994ee8
BLAKE2b-256 checksum
How to use checksums
2c1f7787c1c75974a198dcbb54c3506308a7542c4bdaa3df44d456be1cacdb92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / saline_dbs-0.3.1-py3-none-any.whl

Download URL saline_dbs-0.3.1-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6c2232e9af3e7def69628c5a0c42d841cb8ce874516ea0bce8a70490f1f0005
BLAKE2b-256 checksum
How to use checksums
8ce0449cac7bda8be49b71671b77f53b51e746f1ad609b6a4798ce0283b38f6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Security for saline-dbs 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for saline_dbs-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page