QDECR

Vertex-wise statistics for FreeSurfer, in R

QDECR is an R package for vertex-wise statistical analysis of FreeSurfer surface data, with FreeSurfer's own correction for multiple testing.

For researchers who have run their scans through FreeSurfer and analyse their data in R: write the model as a formula, and get the significant clusters back.

Stable. Latest release 0.9.0. 0.10.0 in development.

The left hemisphere of the brain seen from the side, inflated so that the folds lie flat, coloured red to yellow over most of its surface.

Where the cortex thins with age, in 99 people aged 6 to 31: the left hemisphere's significant cluster, red at p = 10−3 and yellow from p = 10−10. The analysis. Data: ABIDE I, preprocessed by the PCP, CC BY-NC-SA 3.0.

Install and run

Install

In R, once FreeSurfer is set up.

R
install.packages("pak")
pak::pak("slamballais/QDECR")
library(QDECR)

Run

One hemisphere, with pheno a data frame of your subjects.

R
out <- qdecr_fastlm(qdecr_thickness ~ age + sex, data = pheno,
                    id = "id", hemi = "lh", project = "age_sex")
out
summary(out, annot = TRUE)
qdecr_snap(out, "age")

What it gives you

One analysis from the quick start: cortical thickness against age and sex in 99 typically developing participants of ABIDE I, run with QDECR 0.9.0 in 61 seconds a hemisphere on 4 cores.

What it does

  • R's formulas

    Write the model as you would for lm(): factors, interactions, splines and transformations, fitted at every vertex.

  • FreeSurfer's correction

    Clusters are tested against the Monte Carlo simulations FreeSurfer ships, the same correction mri_glmfit-sim applies.

  • Imputed data

    Pass the datasets from mice, Amelia or mi as they are. QDECR fits every one and pools them with Rubin’s rules.

  • Weights

    A weight per subject, as in lm(), for inverse probability weighting or any other weighted regression.

  • Any surface measure

    Thickness, area, volume, curvature, gyrification, or a map of your own on the same surface.

  • Large samples

    The vertex data live in files rather than memory, and the work spreads over as many cores as you give it.

Cite QDECR

If QDECR helped your research, please cite the paper that describes it:

Lamballais S, Muetzel RL. QDECR: A Flexible, Extensible Vertex-Wise Analysis Framework in R. Frontiers in Neuroinformatics. 2021;15:561689. doi:10.3389/fninf.2021.561689