Commit cd11427
committed
Add fix_rbc_release_tr.py script for TR bandpass bug
Lets users of an RBC data release re-derive a correctly-bandpassed
cleaned BOLD and all downstream metrics, by patching the template-space
`desc-head_bold.nii.gz` header (TR=0.0 on disk) with the TR read from
the native-space `desc-preproc_bold.nii.gz` before regression.
Outputs land under a parallel `--output-dir` tree using the published
release's filename conventions:
* cleaned BOLD + bandpass-filtered regressors
* ALFF / fALFF / ReHo at `desc-sm6`, `desc-smZstd`, `desc-zstd`
* Atlas-based mean timeseries (`.1D`, `(n_timepoints, n_rois)`)
* Pearson + nilearn partial-correlation matrices, per atlas
Metrics compose `rbc.workflows.metrics.single_session_metrics` and
`rbc.core.metrics.standardization.compute_zscore`. Atlas resolution
goes through `rbc_resources.ATLAS_REGISTRY` so the release-name -> file
mapping survives filename changes inside `rbc_resources`.
The script ships with PEP 723 inline metadata so it can be invoked
standalone via `uv run --script` without a clone. `--skip-metrics`
falls back to BOLD-only behavior. `--verify` scans every discoverable
run (header-only reads) and reports buggy / clean / inconclusive
counts. `RBC_WORK_DIR` is scoped to the script's tempdir for the
duration of the run so all niwrap exec folders get cleaned up.
Also promotes `_restore_tr` to a public `restore_tr` for reuse, and
adds `nilearn` to the dev dependency group (used by the partial
correlation step; declared in PEP 723 deps for standalone use).1 parent 253c9a8 commit cd11427
8 files changed
Lines changed: 1441 additions & 9 deletions
File tree
- scripts
- src/rbc/core
- functional
- longitudinal
- tests/unit
- core
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
0 commit comments