Skip to main content

Schema-driven BIDS converter, curator, and editor (re-imagination of BIDS-Manager v0.2.5)

Project description

BIDS Manager

Schema-driven BIDS converter, curator, and editor. PyQt6 GUI + CLI for turning DICOM, EEG, and MEG trees into BIDS-compliant datasets, with a post-conversion Editor for sidecar / TSV / NIfTI inspection and metadata fixes.

๐Ÿ“œ documentation ๐Ÿ“œ


What's new in v1.0.0

v1.0.0 is a complete re-imagination of BIDS-Manager (0.x). The old HeuDiConv / dcm2bids two-engine pipeline + 9.2k-LOC single-file GUI has been replaced by:

  • A schema-driven engine โ€” every layer (classification, naming, GUI forms, validation, sidecar generation) reads from the same machine-readable BIDS schema via bidsschematools. Naming logic is no longer scattered across the heuristic, the config builder, and the renamer.
  • dcm2niix invoked directly as the default MRI backend โ€” no HeuDiConv / dcm2bids wrapper between us and the converter.
  • A two-tab PyQt6 GUI โ€” Converter (scan + plan + run) and Editor (post-conversion BIDS tree + sidecar form + TSV editor + NIfTI viewer + validator).
  • A NIfTI viewer in the Editor with single-pane + tri-view (sagittal / coronal / axial) sharing one crosshair, click-and-drag scrubbing, and a 4-D time-series Graph with neighbour-scope grid. All NIfTI loads run on a QThread so the GUI doesn't freeze on large BOLDs.
  • Event-sourced project bundles (.bidsmgr/ directories) recording every user action for full undo + provenance.
  • Modular, testable architecture โ€” 16 sub-packages, no Pipeline god-object, no Qt outside bidsmgr.gui. ~730 unit/GUI tests + 49 real-data tests passing.

The PyPI distribution name is bids-manager (unchanged from 0.x). The import name is bidsmgr (new) โ€” same pattern as pip install scikit-learn โ†’ import sklearn.

If you're upgrading from v0.2.5: the old from bids_manager import โ€ฆ imports and the old CLI entry points (dicom-inventory, build-heuristic, run-heudiconv, run-dcm2bids, post-conv-renamer, โ€ฆ) are gone. The replacement surface is documented below. The v0.2.5 codebase is preserved in git history.


Install

pip install bids-manager

Requires Python โ‰ฅ 3.10. Installs the bidsmgr Python package and seven console scripts (one GUI + five CLI verbs, see below).


Use

GUI

bidsmgr                  # launch the GUI
bidsmgr --theme dark     # force a theme on launch
bidsmgr --project PATH.bidsmgr   # open a saved project

The GUI has two tabs:

  • Converter โ€” point at a raw DICOM / EEG / MEG tree, review the schema-classified inventory in the inspection table, edit subject / session / sequence assignments via the Properties panel, run the conversion through dcm2niix (MRI) / mne-bids (EEG/MEG) / bidsphysio (Siemens physio). Per-subject staging with atomic commit; errors land under <bids_root>/.bidsmgr/errors/.
  • Editor โ€” open any BIDS dataset, browse it as a tree, edit JSON sidecars in a schema-aware form (required/recommended/optional fields colour-coded), edit TSVs in a table, view NIfTI volumes (2-D slice, tri-view, 4-D time-series graph), and run dataset / folder / file validation (layer 1 always; the official bidsschematools.validator.validate_bids as layer 2 via the Strict toggle).

CLI

Five verbs covering the whole pipeline:

bidsmgr-scan      <raw_root>     <inv.tsv>      [--dataset NAME] [--line-freq 50|60] [--montage NAME] [-j N] [--probe-convert]
bidsmgr-rebuild   <inv.tsv>                     [--from {entities,columns}] [--dry-run]
bidsmgr-convert   <inv.tsv>      <bids_parent>  [--dataset NAME] [-j N] [--overwrite] [--dry-run]
bidsmgr-metadata  <bids_parent>                 [--inventory-tsv โ€ฆ] [--fill-todos] [--name โ€ฆ]
bidsmgr-validate  <bids_parent>                 [--strict] [--strict-warn] [--html]

Each verb has independent CLI dispatch under bidsmgr.cli.<verb>:main and reads/writes files on disk, so any stage can be run standalone.


Project layout

BIDS-Manager/                      โ† repo root
โ”œโ”€โ”€ pyproject.toml                  PEP 621, name = "bids-manager"
โ”œโ”€โ”€ README.md                       โ† you are here
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ CLAUDE.md                       project map for Claude Code
โ”œโ”€โ”€ docs/                           architecture + planning documents
โ”‚   โ”œโ”€โ”€ architecture.md
โ”‚   โ”œโ”€โ”€ super_plan.md
โ”‚   โ”œโ”€โ”€ improvement_plan.md
โ”‚   โ”œโ”€โ”€ gui_mockups.html
โ”‚   โ””โ”€โ”€ inspector_proto/            standalone PyQt6 GUI prototype
โ”œโ”€โ”€ miscellaneous/images/           non-package image assets
โ”œโ”€โ”€ external/                       vendored Python embed (Windows installer)
โ”œโ”€โ”€ Installers/                     packaged Windows installer
โ”œโ”€โ”€ bidsmgr/                        โ† the importable Python package
โ”‚   โ”œโ”€โ”€ __init__.py                 __version__ = "1.0.0"
โ”‚   โ”œโ”€โ”€ main.py                     GUI entry
โ”‚   โ”œโ”€โ”€ schema/                     bidsschematools wrapper (keystone)
โ”‚   โ”œโ”€โ”€ inventory/                  per-modality scanners
โ”‚   โ”œโ”€โ”€ classifier/                 chained classifiers
โ”‚   โ”œโ”€โ”€ planner/                    EntityPlan + edits
โ”‚   โ”œโ”€โ”€ converter/                  pluggable backends
โ”‚   โ”‚   โ””โ”€โ”€ backends/
โ”‚   โ”œโ”€โ”€ metadata/                   post-conv schema engine
โ”‚   โ”œโ”€โ”€ fixups/                     fmap, IntendedFor, scans.tsv
โ”‚   โ”œโ”€โ”€ project/                    event-sourced .bidsmgr files
โ”‚   โ”œโ”€โ”€ editor/                     post-conv editor logic (no Qt)
โ”‚   โ”œโ”€โ”€ gui/                        โ† THE ONLY Qt subtree
โ”‚   โ”‚   โ”œโ”€โ”€ theme.qss
โ”‚   โ”‚   โ”œโ”€โ”€ theme_manager.py
โ”‚   โ”‚   โ”œโ”€โ”€ widgets/  delegates/  models/
โ”‚   โ”œโ”€โ”€ workers/                    QThread bridges
โ”‚   โ”œโ”€โ”€ cli/                        CLI verbs
โ”‚   โ””โ”€โ”€ util/                       cross-OS path safety, Qt platform helpers
โ””โ”€โ”€ tests/
    โ”œโ”€โ”€ unit/  integration/  real_data/  gui/  fixtures/

Architectural prevention guards (see docs/architecture.md):

  1. schema/ is the keystone โ€” everything imports from it; it imports nothing.
  2. gui/ is the only Qt-coupled subtree; workers/ also imports Qt (the QThread bridge); nothing else does.
  3. No Pipeline orchestrator. Orchestration is explicit code in cli/<verb>.py and gui/<panel>.py.
  4. Pure-data types only (Pydantic / dataclass; no I/O methods).
  5. Functions over classes where possible.

Develop

pip install -e ".[dev]"
python -c "import bidsmgr; print(bidsmgr.__version__)"
pytest

GUI tests run headless under QT_QPA_PLATFORM=offscreen via pytest-qt. Real-data tests are gated on env vars BIDS_MANAGER_REAL_{MRI,EEG,MEG}_DATA=1 and datasets at /Users/karelo/Development/datasets/BIDS_Manager/raw_data/.


License

MIT โ€” see LICENSE.

Citation

Authored by Karel Lรณpez Vilaret and Jochem Rieger, ANCP Lab, Carl von Ossietzky Universitรคt Oldenburg. See the About dialog in the GUI for the full acknowledgements.

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

bids_manager-1.0.0.tar.gz (657.5 kB view details)

Uploaded Source

Built Distribution

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

bids_manager-1.0.0-py3-none-any.whl (707.9 kB view details)

Uploaded Python 3

File details

Details for the file bids_manager-1.0.0.tar.gz.

File metadata

  • Download URL: bids_manager-1.0.0.tar.gz
  • Upload date:
  • Size: 657.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for bids_manager-1.0.0.tar.gz
Algorithm Hash digest
SHA256 25221ccf792635da18f612ab1e5da8169d6c0e83cb52d12543ffb350675fecee
MD5 31383b776307d7714c00b0335f4fcf68
BLAKE2b-256 2a3262c20009e304631f27a58e45b6daa53ddb1dff58cb0e65b380c8ce016faf

See more details on using hashes here.

File details

Details for the file bids_manager-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bids_manager-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 707.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for bids_manager-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e7aeff7bd34919502189eb2e4051603420fb16c17ae6a0a6756396a59598380
MD5 502a3cb1cb9b2b7449b32b1c9d9828da
BLAKE2b-256 46bffc9e15ddec7a997d14eda593f929787b03a594af067a3363796b4289d40b

See more details on using hashes here.

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