Skip to main content

QSIParc logo

CI Docs PyPI Python License: MIT

QSIParc

Parcellated diffusion feature extraction from QSIRecon outputs.

QSIParc reads atlas parcellations and diffusion scalar maps produced by QSIRecon, computes per-region distribution statistics using direct numpy masking, and writes analysis-ready TSV files in a BIDS-derivative layout. It also repackages QSIRecon's structural connectivity matrices with standardized JSON sidecar metadata.

Part of the SNBB neuroimaging extraction stack, paired with fsatlas (FreeSurfer morphometrics).

Installation

pip install -e ".[dev]"

Quick start

# Extract all atlases, all subjects
qsiparc /data/qsirecon /data/qsiparc-out -v

# Single atlas, single subject
qsiparc /data/qsirecon /data/qsiparc-out \
    --atlas Schaefer2018N100Tian2020S2 \
    --participant-label sub-001 \
    -vv

# Only specific scalars
qsiparc /data/qsirecon /data/qsiparc-out --scalars FA MD ICVF

# Dry run
qsiparc /data/qsirecon /data/qsiparc-out --dry-run

Output layout

qsiparc-out/
├── dataset_description.json
└── sub-001/
    └── ses-01/
        └── dwi/
            └── atlas-Schaefer2018N100Tian2020S2/
                ├── sub-001_ses-01_atlas-Schaefer2018N100Tian2020S2_diffmap.tsv
                ├── sub-001_ses-01_atlas-Schaefer2018N100Tian2020S2_desc-streamline_count_connmatrix.csv
                └── sub-001_ses-01_atlas-Schaefer2018N100Tian2020S2_desc-streamline_count_connmatrix.json

Diffusion scalar TSV (long-format)

Each row is one region × one scalar:

| region_index | region_name | hemisphere | scalar | mean | median | std | iqr | skewness | kurtosis | n_voxels | coverage | |---|---|---|---|---|---|---|---|---|---|---|---|---| | 1 | LH_Vis_1 | L | cortex | FA | 0.42 | 0.41 | 0.08 | 0.11 | 0.15 | -0.32 | 847 | 0.98 |

Connectivity matrix

Square CSV (no headers) + JSON sidecar with region labels, edge weight type, and provenance.

Architecture

qsiparc/
├── discover.py    # BIDS file discovery (globs, entity parsing)
├── atlas.py       # Atlas LUT loading (TSV, JSON, FreeSurfer format)
├── extract.py     # Per-region scalar extraction (numpy masking)
├── connectome.py  # Connectivity matrix passthrough
├── output.py      # BIDS-derivative TSV/JSON writing
└── cli.py         # Click CLI

Key design decisions:

  • Direct numpy masking (not nilearn) for full voxel distribution access
  • No atlas warping — consumes QSIRecon's subject-space parcellations
  • Long-format TSV with rich statistics (mean, median, std, IQR, skewness, kurtosis)
  • Connectome passthrough (repackaging, not recomputation)

Testing

pytest
pytest --cov=qsiparc

All tests use synthetic 10×10×10 NIfTI volumes — no real data required.

Contributing

Bug reports, documentation fixes, and pull requests are welcome. See CONTRIBUTING for setup instructions, code style, and guidelines on what is in scope.

License

MIT

Metadata

Release files for qsiparc 0.1.2

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

Source distribution (sdist)

Source distribution for qsiparc 0.1.2
File Size Uploaded Provenance Actions
qsiparc-0.1.2.tar.gz 3.5 MB Without provenance Details for qsiparc-0.1.2.tar.gz

Release files / qsiparc-0.1.2.tar.gz

Download URL qsiparc-0.1.2.tar.gz
Size 3.5 MB
Tags Source
SHA-256 checksum
How to use checksums
132c1a93cff3a9f4184595a0d38611ba6d4e9cc83a8a05fa6e1b2f02c9a5818e
BLAKE2b-256 checksum
How to use checksums
6a1751890bff14a4b60d36b200467e962f313b35798c4fd7df528252a95c890d
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for qsiparc 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.1.2 This release

1 release file No 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