Clean, simple neuroimaging pipeline automation for brain banks
Project description
Clean, simple neuroimaging pipeline automation for brain banks.
Brain banks need to process neuroimaging data consistently, reproducibly, and auditably. VoxelOps makes that simple by wrapping Docker-based neuroimaging tools into clean Python functions that return plain dicts – ready for your database, your logs, and your peace of mind.
Overview
docs |
|
|---|---|
tests, CI & coverage |
|
version |
|
styling |
|
license |
Features
Simple Functions – No classes, no inheritance – just run_*() functions that return dicts
Clear Schemas – Typed dataclass inputs, outputs, and defaults for every procedure
Reproducibility – The exact Docker command is stored in every execution record
Database-Ready – Results are plain dicts, trivial to save to PostgreSQL, MongoDB, or JSON
Brain Bank Defaults – Define your standard parameters once, reuse across all participants
Comprehensive Logging – Every run logged to JSON with timestamps, duration, and exit codes
Validation Framework – Pre- and post-execution validation with detailed reports
Audit Trail – Full audit logging for every procedure run
Installation
pip install voxelops
For development:
git clone https://github.com/yalab-devops/VoxelOps.git
cd VoxelOps
pip install -e ".[dev]"
Requirements: Python >= 3.10, Docker installed and accessible.
Quick Start
Basic (direct execution):
from voxelops import run_qsiprep, QSIPrepInputs
inputs = QSIPrepInputs(
bids_dir="/data/bids",
participant="01",
)
result = run_qsiprep(inputs, nprocs=16)
print(f"Completed in: {result['duration_human']}")
print(f"Outputs: {result['expected_outputs'].qsiprep_dir}")
print(f"Command: {' '.join(result['command'])}")
With validation and audit logging (recommended):
from voxelops import run_procedure, QSIPrepInputs
inputs = QSIPrepInputs(
bids_dir="/data/bids",
participant="01",
)
result = run_procedure("qsiprep", inputs)
if result.success:
print(f"Completed in {result.duration_seconds:.1f}s")
else:
print(f"Failed: {result.get_failure_reason()}")
# Save complete audit trail to your database
db.save_procedure_result(result.to_dict())
Available Procedures
Procedure |
Purpose |
Function |
Execution |
|---|---|---|---|
HeudiConv |
DICOM to BIDS conversion |
run_heudiconv() |
Docker |
QSIPrep |
Diffusion MRI preprocessing |
run_qsiprep() |
Docker |
QSIRecon |
Diffusion reconstruction & connectivity |
run_qsirecon() |
Docker |
QSIParc |
Parcellation via parcellate |
run_qsiparc() |
Python (direct) |
Brain Bank Standards
Define your standard parameters once, use them everywhere:
from voxelops import run_qsiprep, QSIPrepInputs, QSIPrepDefaults
BRAIN_BANK_QSIPREP = QSIPrepDefaults(
nprocs=16,
mem_mb=32000,
output_resolution=1.6,
anatomical_template=["MNI152NLin2009cAsym"],
docker_image="pennlinc/qsiprep:latest",
)
for participant in participants:
inputs = QSIPrepInputs(bids_dir=bids_root, participant=participant)
result = run_qsiprep(inputs, config=BRAIN_BANK_QSIPREP)
db.save_processing_record(result)
Validation & Audit
run_procedure() wraps any runner with pre-validation, post-validation, and a full audit trail:
from voxelops import run_procedure, HeudiconvInputs, HeudiconvDefaults
inputs = HeudiconvInputs(
dicom_dir="/data/dicoms",
participant="01",
session="baseline",
)
config = HeudiconvDefaults(heuristic="/code/heuristic.py")
result = run_procedure("heudiconv", inputs, config)
# result.pre_validation -- ValidationReport before execution
# result.post_validation -- ValidationReport after execution
# result.audit_log_file -- path to the JSON audit log
Logging
All runners accept an optional log_dir parameter. When provided, an execution JSON log is written alongside any audit logs. The log directory defaults to <output_dir>/../logs derived from the inputs.
result = run_qsiprep(inputs, log_dir="/data/logs/qsiprep")
Documentation
Full documentation is available at voxelops.readthedocs.io.
License
MIT License – see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file voxelops-0.2.0.tar.gz.
File metadata
- Download URL: voxelops-0.2.0.tar.gz
- Upload date:
- Size: 22.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
312cdb3d56930e0dbec3ad3aeac57d2aa3297efb4628ad07e43ea9bbc3740c7e
|
|
| MD5 |
ffd72c6aa02c1ff814a739f5670a0b43
|
|
| BLAKE2b-256 |
819cb7aab77a020c59c438defd573be36a7bb79d4f0d235fd18964571b44fe46
|
File details
Details for the file voxelops-0.2.0-py3-none-any.whl.
File metadata
- Download URL: voxelops-0.2.0-py3-none-any.whl
- Upload date:
- Size: 51.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22d55864ee323862f969172aa74f55a9c2815d55e4e5e36e7dd295f3427c3349
|
|
| MD5 |
d42613de5bc6b846da6baffd9b1c7539
|
|
| BLAKE2b-256 |
7cdd867b68984acc831d7231b013e583c06390fecd26faa09aeff39b7f2bbc0d
|