Process Multiple Subjects¶
Use csttool batch to run the full pipeline across many subjects. Two input modes are supported.
Option A: BIDS auto-discovery¶
Point --bids-dir at a BIDS root and csttool will enumerate every sub-* (and optional ses-*) with a dwi/ directory.
The --bids-out flag writes outputs in BIDS-Derivatives layout so they can be consumed by downstream BIDS apps.
Filtering subjects¶
Option B: JSON manifest¶
When inputs are not BIDS, describe each subject explicitly.
{
"subjects": [
{
"subject_id": "sub-001",
"dicom": "/raw/sub-001/dicom",
"session_id": "ses-01"
},
{
"subject_id": "sub-002",
"nifti": "/raw/sub-002/dwi.nii.gz",
"bval": "/raw/sub-002/dwi.bval",
"bvec": "/raw/sub-002/dwi.bvec"
}
]
}
Dry-run before launching¶
Always preview a long run first.
--dry-run lists the planned actions without touching disk. --validate-only goes a step further and exits non-zero on any manifest or BIDS discovery error.
Re-running and resuming¶
batch skips subjects whose outputs already exist. To force re-processing of a specific subject, delete its output folder or pass --force.
Performance tips¶
Parallelism
batch runs subjects sequentially within a single process. For real parallelism, partition subjects across hosts with --include and orchestrate at the shell or scheduler level (e.g. SLURM array jobs).
Time-box hung subjects
Pass --timeout-minutes 120 so a stuck registration or denoising step does not block the whole cohort.