CRAN Packages 5-10 years ago vs. today

Imaging in R: 5 years ago

Workflow: 5 years ago

  • bash flow
  • FSL flow
  • ANTs flow
  • MRIcroGL flow
  • OsiriX flow
  • SPM 12 flow
flow

Workflow: 5 years ago

Multiple pieces of software used

  • all different syntax
flow

R: Programming and Interface Language

Workflow: Now

  • all R code
    • interface/pipeline tool
    • “native” R code

Complete pipeline

  • preprocessing and analysis
flow

Imaging in R: Now

Weaknesses of Imaging in R

Strengths of Imaging in R

  • Free
  • Large/strong R community
  • RStudio
  • Validated statistical models
  • Package development system
  • Neuroconductor
  • Shiny

Threats of Imaging in R

  • Not much different than Python
    • scikit-learn/ Nipype
  • Neural Networks
  • BME have tools for advanced statistical analysis
  • Study design is not as valued in imaging (neuro)
    • one stronghold of statisticians
  • Credit/Incentives for software

Opportunities of Imaging in R

Opportunities: CONSORT diagrams

Opportunities: Moving from Linear Models

  • Task fMRI: compare baseline to 1+ conditions
  • Smoothed to account for neighborhood
  • Run LM on time-series voxelwise with AR-type correlation with HRF-convolved design matrix (\(X\)) + motion/other factors (\(Z\))

\[ Y_{iv} = X_{i} \beta_{iv} + Z_{i}\theta_{iv} + \varepsilon_{iv} \\ \varepsilon_{iv} \sim N(0, \Sigma_{iv}) \\ \Sigma_{iv} \sim \text{AR} \]

\(Z_{i}\) can be different for each \(i\) (scrubbing), but usually isn’t.

Opportunities of Stats in Imaging

  • Get \(β_i\) map in MNI space
  • Run t-test, random effects analysis (hard to find sometimes), or permutation test
  • Perform multiple comparisons correction (maybe with spatial compoent)

Opportunities of Stats in Imaging

  • What if the motion had a non-linear effect?
    • currently: use derivatives and squared effects
    • why not GAMs? (speed)voxel package
  • fully Bayes (spatial) hard because of data size (maybe empirical)

Opportunities of Stats in Imaging

Opportunities: Data

What we need: tutorials

What we really need: tutorials on fMRI

What we need: Shiny GUIs

(Maybe) What we need: challenges

“Pre”-processing is Important

“Pre”-processing is Hard

Package Showcase

Data

  • EveTemplate/MNITemplate - templates
  • kirby21 series
  • sri24 - SRI24 MRI Atlas
  • malf.templates - templates for label fusion
  • neurohcp - download data from HCP/INDI
  • nitrcbot - download data from NITRC
  • neurovault - download data from https://neurovault.org/

General Imaging Tools

Starting from Raw Data/DICOM

  • oro.dicom - read/write DICOM data
  • dcm2niir - uses dcm2niix from Chris Rorden
  • divest - Rcpp wrapped dcm2niix
  • dcmtk - interface package for DCMTK
  • matlabr - could use dicomread MATLAB code and excecute through R

Interactive Visualization using papayaWidget