An end-to-end R pipeline for longitudinal MRI and CT analysis in spinal cord injury (SCI) research. Provides R wrappers for the Spinal Cord Toolbox (SCT), DICOM tools, SCI-specific clinical metrics, and pipeline orchestration with built-in quality control.
Prerequisites
The wrappers for image processing need the following external tools. They are optional: the metrics, registry, quality-control and plotting functions work without them.
| Tool | Version | Purpose |
|---|---|---|
| Spinal Cord Toolbox | >= 6.4 | Segmentation, labeling, parameter extraction |
| dcm2niix | any | DICOM to NIfTI conversion |
| Python 3 + pydicom | any | DICOM metadata extraction & anonymization |
Verify installation:
Quick Start
library(scimagR)
# 1. Create a new project
sci_create_project(
"~/projects/my-sci-study",
title = "Cervical SCI Longitudinal MRI",
author = "Your Name"
)
# 2. Place DICOMs in data/raw/dicom/, fill registry CSVs
# 3. Plan the processing steps; each row names the function to run
sci_run_pipeline("~/projects/my-sci-study")Modules
| Module | Key Functions | Description |
|---|---|---|
| SCT Interface |
sct_segment_sc(), sct_segment_lesion(), sct_label_vertebrae()
|
R wrappers for all SCT CLI commands |
| DICOM Tools |
extract_dicom_metadata(), anonymize_dicom(), convert_dcm2niix()
|
Metadata extraction, anonymization, conversion |
| SCI Metrics |
compute_mscc(), compute_compression_ratio(), classify_phase()
|
Domain-specific clinical measures |
| Registry |
create_registry(), validate_registry(), coverage_matrix()
|
Structured time-point tracking |
| QC System |
filter_evaluable(), log_exclusion(), integrity_summary()
|
Artifact grading and exclusion tracking |
| Visualization |
theme_sci(), scale_colour_phase(), plot_violin_box()
|
Publication-ready figures |
| Pipeline |
sci_run_pipeline(), sci_pipeline_status()
|
Step plan and output status |
| Scaffold | sci_create_project() |
Workflowr project setup |
Citation
If you use scimagR in your research, please cite:
Heller R (2026). scimagR: Spinal Cord Injury Imaging Pipeline for MRI and
CT Analysis. R package version 0.2.0.
https://github.com/CTTIR/scimagR
Use of LLM tools
Where applicable, LLM tools were used for narrowly defined, non-authorial tasks: copyediting, prose refinement, Markdown/LaTeX formatting, boilerplate scaffolding (such as CI configurations and build scripts), and code refactoring. Tools included Chat AI, the KISSKI (GWDG) service, and self-hosted Mistral Small (24B, Apache-2.0) served through a local vLLM architecture on an Ubuntu Linux workstation with Intel processors and NVIDIA GPUs. Self-hosted use also includes models that were further trained (fine-tuned) or weight-edited in-house for specific tasks. All self-hosted models ran locally, with no data sent to third parties.
All scientific claims, methodological choices, analyses, interpretations and conclusions remain the authors’ own. Where applicable, LLM-generated material must be reviewed and revised before inclusion, and references must be verified against their DOI, arXiv ID or ISBN.
Local software setup: vLLM with Python/PyTorch, plus R and RStudio.
Branding
Editable R artwork and regeneration instructions are in tools/branding.
