Skip to main content

Modular SWC processing toolkit with shared core for CLI and GUI

Project description

SWC-Studio

SWC-Studio is a desktop, CLI, and Python toolkit for working with neuron morphology files in SWC format.

It is designed for inspecting reconstructions, finding structural or annotation problems, repairing them, and running repeatable morphology-processing workflows from one shared backend.

Project Overview

SWC-Studio includes:

  • a shared Python backend (swcstudio)
  • a command-line interface (swcstudio)
  • a desktop GUI (swcstudio-gui)

Both the CLI and GUI use the same core feature logic.

Auto-labeling engine

Auto-labeling uses a single ML pipeline: the v9 engine. It runs a four-stage process — cell-type detection, per-subtree axon/basal/apical classification, a GraphSAGE GNN apical-vs-basal re-decision, and topology refinement — and automatically chooses between 3-class (no apical) and 4-class output per file. All four stages are required and ship trained out of the box.

The toolkit ships with bundled trained models. After pip install -e . the engine works out of the box; users can also retrain on their own labeled SWC corpus via swcstudio train auto-typing and have the toolkit pick up the new models automatically.

Documentation

Project documentation lives on the docs website:

Use the docs site for:

  • installation and getting started
  • GUI and CLI workflows
  • validation, repair, and reporting behavior
  • the auto-typing engine and retraining workflow
  • tutorials
  • API and extension references

Release Assets

Current GitHub Releases may include:

  • macOS application bundle
  • Windows executable package

Quick Start

Option 1: download a packaged executable from the GitHub Releases page and run the app directly.

Option 2: install from source. Supported Python versions: 3.10, 3.11, 3.12, 3.13.

macOS / Linux:

python3 -m venv .venv
source .venv/bin/activate
pip install -e .
swcstudio-gui

Windows PowerShell:

py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .
swcstudio-gui

A single pip install -e . pulls in everything: the CLI, the desktop GUI, the auto-typing engine (sklearn + torch + torch_geometric), and the bundled v9 model files. There are no extras to remember for normal use. Maintainers who need PyInstaller and Sphinx for release packaging and docs builds can use pip install -e ".[all]".

CLI help:

swcstudio --help
swcstudio models status     # confirm the bundled auto-typing models are reachable

If the script entry point is not on your path, fall back to module mode:

python -m swcstudio.cli.cli --help
python -m swcstudio.gui.main

Core Capabilities

  • issue-driven SWC validation and repair
  • batch processing workflows
  • v9 ML auto-typing engine: Stage 1 cell-type detector + Stage 2 per-subtree classifier + Stage 2b GraphSAGE GNN apical-vs-basal head + Stage 3 topology refinement, with bundled trained models
  • automatic apical detection (3-class vs 4-class output chosen per file)
  • one-command retraining of the engine on user data (swcstudio train auto-typing)
  • radii cleaning
  • manual morphology and geometry editing
  • shared GUI, CLI, and Python integration surface

Train your own auto-typing models

If you want models tuned to your own SWCs, the toolkit ships a one-command trainer:

swcstudio train auto-typing \
    --data-dir path/to/labeled/dataset \
    --output-dir path/to/save/models

The dataset directory must have pyramidal/ and interneuron/ subfolders of labeled .swc files (each SWC's type column is the per-node ground truth).

To use the trained models afterwards:

# One-off: pass --model-dir per call
swcstudio auto-label cell.swc --model-dir path/to/save/models

# Or set the env var for the whole shell
export SWCSTUDIO_MODEL_DIR=path/to/save/models      # macOS/Linux
$env:SWCSTUDIO_MODEL_DIR = "path\to\save\models"    # Windows PowerShell

# Or make them the persistent default by copying into the user data dir;
# see the docs site for the per-platform path.

See the Auto-Typing Engine page in the docs for the full retraining workflow, hyperparameter flags, and model resolution rules.

Recommended Workflow

  1. Open one SWC file in the GUI.
  2. Run validation and review the issue list.
  3. Apply the suggested repairs.
  4. Rerun validation.
  5. Save or export the cleaned result.

License

Released under the MIT License. See LICENSE.

Project details


Download files

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

Source Distribution

swcstudio-0.2.0.tar.gz (265.8 kB view details)

Uploaded Source

Built Distribution

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

swcstudio-0.2.0-py3-none-any.whl (313.5 kB view details)

Uploaded Python 3

File details

Details for the file swcstudio-0.2.0.tar.gz.

File metadata

  • Download URL: swcstudio-0.2.0.tar.gz
  • Upload date:
  • Size: 265.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for swcstudio-0.2.0.tar.gz
Algorithm Hash digest
SHA256 26876cb0f441d59506fd5b5cd38b405a426c254f1a9bd0ee9deffe752c50a70d
MD5 28cca1ec723342b1e3a7bc912488bb33
BLAKE2b-256 a49574388163b56afa1cfbf3a10fedd9521e322a6db785774daa6abf3ee9cf23

See more details on using hashes here.

Provenance

The following attestation bundles were made for swcstudio-0.2.0.tar.gz:

Publisher: release.yml on Mio0v0/SWC-Studio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file swcstudio-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: swcstudio-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 313.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for swcstudio-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8e9155756d76b7229e9eac4cb5ec9f1bc77502a9430b35c85fb1a5a7166d92d
MD5 fa1eba8403ffe519d2a71dc1ba138ca0
BLAKE2b-256 c3cf139a7419333c914e312cca08969fb0693eb1b438994cbb9022417d5a6d96

See more details on using hashes here.

Provenance

The following attestation bundles were made for swcstudio-0.2.0-py3-none-any.whl:

Publisher: release.yml on Mio0v0/SWC-Studio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page