Skip to main content

example workflow example workflow

SeqSeg — Sequential Vessel Segmentation
Example coronary segmentation (SeqSeg)

SeqSeg: Sequential Vessel Segmentation and Tracking

Automatic tracking and segmentation of blood vessels in CT and MR images using deep learning and geometric tracking.

Paper License Python

News: SeqSeg now outputs a full SimVascular project in the simvascular/ subdirectory — open it directly in SimVascular with automatic pathlines and contours for every segmented branch.


Why SeqSeg?

SeqSeg segments vessels sequentially, taking steps along vessel centerlines and detecting bifurcations to grow complete vascular trees from just 1–2 seed points. By combining local deep-learning predictions (nnU-Net) with geometric tracking, it stays robust across vessel scales — from small coronaries to large aortas.

  • 🌱 Minimal supervision — only 1–2 seed points to initialize
  • 🌿 Robust bifurcation detection — automatically follows every branch
  • 🩻 Multi-modal — works with CT and MR 3D medical images
  • 📏 Scalable — vessels from ~1mm coronaries to ~30mm aortas
  • Clinically validated — coronary, aortic, cerebral, and pulmonary anatomies (pre-trained weights for aorta CT/MR and coronary CT)
  • Fast — ~2–10 min per case, Dice > 0.9 on validation, runs on CPU or GPU

SeqSeg Demo
Real-time demonstration: automatic segmentation of an abdominal aorta in a 3D MR scan.

What's new in 2.x

SeqSeg 2.0 refactors the package around a clearer CLI and a stable Python API. Existing batch workflows still work; legacy invocations without a subcommand (e.g. seqseg -data_dir ...) are rewritten to seqseg run batch automatically.

Command-line interface

Feature Description
seqseg run batch Classic dataset batch tracing (preferred entry point)
seqseg run single One volume + seeds: stages under <outdir>/_seqseg_single_staging/, then runs like batch
seqseg run plus batch Global nnU-Net sweep, then SeqSeg (replaces monolithic seqseg_plus script flow)
seqseg init dataset Scaffold images/, centerlines/, truths/, and template seeds.json
seqseg paths init / set / show Save default nnU-Net / data / out dirs in ~/.seqseg/paths.yaml
seqseg train prepare Extract patches + build nnU-Net Dataset (needs pip install "seqseg[train]")
seqseg train nnunet Run nnU-Net plan/preprocess and training
seqseg doctor Check imports (SimpleITK, vtk, nnunetv2, scipy, optional sampler) and paths
seqseg config dump / fingerprint Inspect or diff packaged YAML configs
seqseg post global-centerline Post-process segmentations into global centerlines
seqseg simvascular init Create or refresh SimVascular project layout under a case directory
seqseg --version Print installed package version

Python library API

Embed tracing in other Python code without writing SeqSeg output files:

  • seqseg.api.run_tracing — pass a sitk.Image, seed definitions, and an nnU-Net trainer folder; get a TracingResult with global probability segmentation at result.assembly.assembly
  • TracingOptions(disk_io=False) — skip VTK/MHA debug trees on disk (nnU-Net weights still load from model_folder)
  • BranchSeed, branch_seed_at_point, seeds_to_potential_branches — simple seed formats instead of hand-built step dicts
  • TracingContext / trace_centerline_from_context — lower-level control with the same in-memory image support
  • Lazy re-exports from import seqseg (see seqseg/__init__.py)

Quick example (seeds and config known):

from seqseg.api import TracingOptions, branch_seed_at_point, run_tracing

result = run_tracing(
    my_sitk_image,
    [branch_seed_at_point([x, y, z], radius)],
    "/path/to/nnUNetTrainer__nnUNetPlans__3d_fullres",
    config="global",
    options=TracingOptions(disk_io=False),
)
prob_seg = result.assembly.assembly  # sitk.Image; threshold for binary masks

See High-level API (seqseg.api) for full detail.

Internal structure (for contributors)

  • Pipeline modules: seqseg.pipeline.classic, plus, post, single_trace
  • Typed config helpers: AlgorithmConfig, NnUNetModelSpec in seqseg.config_models
  • Tracing core accepts sitk.Image or file paths for the reference volume and optional prior segmentation

Migrating from 1.x

  1. CLI: Prefer seqseg run batch (or keep legacy flags — they still work).
  2. Plus workflow: Use seqseg run plus batch instead of python -m seqseg.seqseg_plus with the same nnU-Net path flags.
  3. Library: Use run_tracing or TracingContext rather than calling trace_centerline with only file paths.
  4. Version: pip install -U seqseg and check with seqseg --version (expects 2.0.0).

Quick Start

# Install
pip install seqseg

# Download pre-trained weights (see Installation docs for links)
# Run segmentation
seqseg -data_dir your_data/ -nnunet_results_path path/to/weights/ -config_name aorta_tutorial

📖 New here? Follow the step-by-step tutorial with example data and detailed instructions.

Documentation

Guide Description
Installation Setup, dependencies, and pre-trained model weights
Usage Data preparation, CLI arguments, and output files
Configuration YAML configs and key tracking parameters
Algorithm Overview Methodology, workflow, and training strategy
Training Train nnU-Net models on a new dataset for SeqSeg
Performance & Benchmarks Accuracy, timing, and qualitative comparisons
Research & Development SimVascular / Slicer integrations and related tooling

Citation

When using SeqSeg, please cite the following paper:

@Article{SveinssonCepero2024,
author={Sveinsson Cepero, Numi
and Shadden, Shawn C.},
title={SeqSeg: Learning Local Segments for Automatic Vascular Model Construction},
journal={Annals of Biomedical Engineering},
year={2024},
month={Sep},
day={18},
issn={1573-9686},
doi={10.1007/s10439-024-03611-z},
url={https://doi.org/10.1007/s10439-024-03611-z},
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seqseg-2.1.0.tar.gz (168.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seqseg-2.1.0-py3-none-any.whl (212.7 kB view details)

Uploaded Python 3

File details

Details for the file seqseg-2.1.0.tar.gz.

File metadata

  • Download URL: seqseg-2.1.0.tar.gz
  • Upload date:
  • Size: 168.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for seqseg-2.1.0.tar.gz
Algorithm Hash digest
SHA256 33c5bb5f3540f7685703b02cdf56154c49b360e571739fe7f818989adcdb077d
MD5 a5d50a9ebeff825d0a4e6db90ec25790
BLAKE2b-256 3f55fcc31da69e87cffe1a4b6fe5a47bf7c1995ebbe56641cc808a77bb0e5755

See more details on using hashes here.

File details

Details for the file seqseg-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: seqseg-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 212.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for seqseg-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7596f71514d724065b7e330121c4569e613e39438dbf3b09a2583c985b0c577
MD5 2c83aa7e81275333c99205b0f434e1c6
BLAKE2b-256 f1daaea3c3c21113399727a6709709b79fd9b42c2e5ba03d1af7a9acda7f4705

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 files

2.0.0

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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