sci_run_pipeline() orchestrates the full SCI imaging
processing workflow in 8 sequential steps. Each step is idempotent and
the pipeline can be interrupted and resumed at any point.
| Step | Name | Tool | Output |
|---|---|---|---|
| 1 | DICOM metadata extraction | pydicom | metadata CSV |
| 2 | Anonymization (optional) | pydicom | anonymized DICOMs + mapping |
| 3 | DICOM to NIfTI conversion | dcm2niix | .nii.gz files |
| 4 | Spinal cord segmentation | SCT | _seg.nii.gz |
| 5 | Lesion segmentation | SCT (SCIsegV2) | _lesion_seg.nii.gz |
| 6 | Vertebral labeling | SCT | _labels-disc.nii.gz |
| 7 | Parameter extraction | SCT | CSVs with metrics |
| 8 | Merge & export | R | combined dataset |
Run only specific steps by setting the steps
argument:
After Step 5 (lesion segmentation), the pipeline pauses for manual QC. This is critical: automated lesion segmentation must be visually verified before extracting quantitative parameters.
During the QC pause:
data/qc/This returns a tibble showing which steps are complete for each patient and session.
After visual QC, assign artifact grades (0-4) in the imaging registry:
Use filter_evaluable() to exclude sessions with grade
> 2:
After processing, check your data coverage:
This tile plot shows which modalities are available for each patient at each timepoint, with artifact grades overlaid.
The pipeline is designed to be resilient to interruptions. Simply re-run with the same arguments — existing outputs will be detected and skipped: