October 13, 2016

timeline

The MISTIE Stroke Trial

  • Minimally Invasive Surgery plus r-tPA for Intracerebral Hemorrhage Evacuation (MISTIE)
    • Multi-center, multi-national Phase II clinical trial
    • Alteplase (donated by Genentech)

MISTIE LOGO

PI: Dr. Dan Hanley Hanley

Intracranial/Intracerebral Hemorrhage (ICH)

Larger Hemorrhage Volume ⇒ Worse Outcome

Goal:
Automatic Hemorrhage Volume Estimation

How do we measure hemorrhages?

X-ray Computed Tomography (CT) Scans

Image Representation: voxels (3D pixels)


Muschelli, John, Elizabeth Sweeney, and Ciprian Crainiceanu. "brainR: Interactive 3 and 4D Images of High Resolution Neuroimage Data." R JOURNAL 6.1 (2014): 42-48.

Terminology: Neuroimaging to Data/Statistics

  • Segmentation ⇔ classification
  • Image ⇔ 3-dimensional array
    • composed of voxels
    • a typical CT has \(512 \times 512 \times 30 ≈ 7.8\) million voxels
  • Mask/Region of Interest ⇔ binary (0/1) image

How do we measure volume (currently)?

Manual Segmentation

MISTIE LOGO
MISTIE LOGO

Workflow for the Analysis

flow

Workflow for the Analysis

flow

Problem: CT Scans Capture Everything

The room

Brain Segmentation of CT Scans

  • Muschelli, John, et al. "Validated automatic brain extraction of head CT images." NeuroImage 114 (2015): 379-385. http://bit.ly/CTBET_RCODE

MISTIE LOGO
MISTIE LOGO

Workflow for the Analysis

flow

Hemorrhage Segmentation

Subject Data used: 111 scans (1 Per Patient)

  Overall
Age in Years: Mean (SD) 60.8 (11.2)
Male: N (%) 76 (68.5%)
Reader-Based Clot Location (%)
   Putamen 68 (61.3)
   Lobar 33 (29.7)
   Globus Pallidus 6 ( 5.4)
   Thalamus 4 ( 3.6)
ICH Volume in mL: Mean (SD) 37.4 (20.1)
  • Adults (inclusion criteria 18-80 years old)
  • Mostly males
  • Different sites, scanners, and locations in the brain

Workflow for the Analysis

flow

Predictors of ICH

  • Local "neighborhood" moments (mean, sd, skew, kurtosis)

Local Mean: \(\bar{x}(v) = \frac{1}{27} \sum\limits_{k}^{27} x_k(v)\)

  • Threshold intensity
  • Gaussian Smoother (big neighborhood)
Preds

Data Structure for One Patient

  • Each subject has matrix \(X_{i}\)
  • \(V_{i}\) - voxels per person
  • \(P\) - number of predictors
  • \(y_i\) - manual segmentation
MISTIE LOGO

Aggregate Data

Training Data Structure

  • Stack together 10 randomly selected patients
  • Train model/classifier on this design matrix
MISTIE LOGO

Fit Models / Classifier

Again, \(y_{i}(v)\) is the presence / absence of ICH for voxel \(v\) from person \(i\).

General model form: \[ P\{y_{i}(v) = 1\} \propto f\{X_{i}(v)\} \]

Models Fit on the Training Data

  • Logistic Regression: \(f(X_{i}(v)) = \text{expit} \left\{ \beta_0 + \sum_{k= 1}^{p} x_{i, k}(v)\beta_{k}\right\} \) (glm function)
  • Generalized Additive Model (Hastie, et al., 1990)
    • fit using penalized thin plate splines (mgcv package)
  • LASSO (Tibshirani, 1996; Friedman, et al., 2010) (glmnet package): \[ \mathcal{L}\left[\left.Y_{i}(v) \right|\, f\{X_i(v)\}\right] \propto \beta_0 + \sum_{k= 1}^{p} x_{i, k}(v) \beta_{k} + \lambda \sum_{k= 1}^{p} \left|\beta_{k}\right| \]
  • Random Forests (Liaw, et al., 2002; Breiman, 2001) (randomForest package)

    \(f(X_{i}(v)) \propto\) random forest

All results are on the 101 scans/patients
not in the training data

  • Get prediction for each voxel: \(\hat{p}_{i}(v) = \hat{P}(y_i(v) = 1)\)
  • Threshold to get a binary value: \(\hat{y}_{i} = \hat{p}_{i}(v) > 0.5\)

\[ \text{Estimated Volume}_{i} = \text{cc per voxel} \times \sum_{v}^{V_i} \hat{y}_{i}(v) \]

\[ \text{Volume}_{i} = \text{cc per voxel} \times \sum_{v}^{V_i} y_{i}(v) \]

  • cc = cubic centimeters
  • one milliliter (mL) = 1 cc
flow

Predicted Volume Estimates True Volume Reseg

All models predicted volume pretty well Reseg

Two Segmentations: Same Volume

MISTIE LOGO
MISTIE LOGO

Patient with Median Overlap

MISTIE LOGO

Conclusions of Stroke Analyses

Workflow for the Analysis

Statistical methods are just one part

  • Downstream from many steps
flow

Workflow for the Analysis

Multiple pieces of software used

  • all different syntax
flow

This isn't atypical: lots of software choices

flow

From Carp, Joshua. "The secret lives of experiments: methods reporting in the fMRI literature." Neuroimage 63.1 (2012): 289-300.

flow Neuroconductor:
A Framework for Reproducible Neuroimaging Analysis
in R

Neuroconductor Goal:

Lower the bar to entry

  • all R code
    • pipeline tool
    • native R code

Statisticians involved with entire pipeline

  • pipeline sensitivity analyses
flow

Current Progress (my R packages)

Number of downloads as of October 10, 2016 (cranlogs package):

carp_box

Neuroconductor Goal:

Provide package checks / rules / stability

  • check against other imaging software (e.g. FSL)

flow

flow

flow

Benefits of Neuroconductor:

Allow neuroimaging to use all the things R has to offer.

  • Statistics
  • Versioning and testing
  • Reproducibile reports and analyses
  • Shiny

flow Neuroconductor Downsides

  1. More control over the workflow = more work (for us statisticians!)
  2. Users need external software (versions/installation)
  3. No control over external software
    • if maintainer changes something, not much recourse
  4. Need the content (buy-in from the community)

How do I get started?

Thanks

Dan Hanley Hanley

Ciprian Crainiceanu neurohacking

Brian Caffo neurohacking

Jean-Philippe Fortin neurohacking

Adi Gherman neurohacking

Elizabeth Sweeney neurohacking

Questions

Assessing Performance

For each manual and automated segmentation, we can calculate the following 2-by-2 table, where the cells represent number of voxels and a corresponding Venn diagram:

Manual
0 1
PitCH 0 TN FN
1 FP TP

Dice Similarity

We calculate the Dice Similarity Index (DSI): \[ \definecolor{red}{RGB}{255,0,0} \definecolor{blue}{RGB}{0,0,255} \definecolor{purple}{RGB}{128,0,128} \definecolor{blac,}{RGB}{0,0,0} \frac{ \color{purple} 2 \times \# \text{TP} }{ \color{purple} 2 \times \#\text{TP} \color{black} + \color{red} \text{FN} \color{black} + \color{blue} \text{FP}} \]

  • 0 indicates no overlap
  • 1 means perfect agreement

DICE

DICE

DICE

DICE

Under Development R Packages

  1. nitrc - download data from the NITRC repository
  2. MNITemplate\(^*\) - data of a population-level "template" image
  3. EveTemplate\(^*\) - data of a different template image
  4. kirby21 - data package with 2 subjects, 2 visits with multimodal imaging
  5. rcamino - interface to analyze DTI data
  6. msseg - MS lesion segmentation
  7. extrantsr - pipelines for structural imaging analysis

Not started yet

  1. hcp - interface with Human Connectome Project
  2. afnir - R port of AFNI software (No. 2 on the chart)

\(^*\) - working with Jean-Philippe Fortin on these

The knitcitations, knitr, pander, plyr, RefManageR, rmarkdown, and tableone packages were used to create this presentation in RStudio.

 setting  value                       
 version  R version 3.3.1 (2016-06-21)
 system   x86_64, darwin13.4.0        
 ui       X11                         
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/New_York            
 date     2016-12-13                  

 package       * version     date      
 backports       1.0.4       2016-10-24
 bibtex          0.4.0       2014-12-31
 bitops          1.0-6       2013-08-17
 class           7.3-14      2015-08-30
 devtools        1.12.0.9000 2016-12-08
 digest          0.6.10      2016-08-02
 DT              0.2         2016-08-09
 e1071           1.6-7       2015-08-05
 evaluate        0.10        2016-10-11
 htmltools       0.3.6       2016-12-08
 htmlwidgets     0.8         2016-11-09
 httr            1.2.1.9000  2016-11-21
 jsonlite        1.1         2016-09-14
 knitcitations * 1.0.7.1     2016-02-01
 knitr         * 1.15.1      2016-11-22
 lattice         0.20-34     2016-09-06
 lubridate       1.6.0       2016-09-13
 magrittr        1.5         2014-11-22
 Matrix          1.2-7.1     2016-09-01
 memoise         1.0.0       2016-01-29
 pander        * 0.6.0       2016-06-17
 pkgbuild        0.0.0.9000  2016-12-08
 pkgload         0.0.0.9000  2016-12-08
 plyr          * 1.8.4       2016-06-08
 R6              2.2.0       2016-10-05
 Rcpp            0.12.8.2    2016-12-08
 RCurl           1.95-4.8    2016-03-01
 RefManageR    * 0.13.1      2016-11-13
 RJSONIO         1.3-0       2014-07-28
 rmarkdown       1.2.9000    2016-12-08
 rprojroot       1.1         2016-10-29
 stringi         1.1.2       2016-10-01
 stringr         1.1.0       2016-08-19
 survey          3.31-2      2016-09-23
 survival        2.40-1      2016-10-30
 tableone      * 0.7.3       2015-11-11
 withr           1.0.2       2016-06-20
 XML             3.98-1.5    2016-11-10
 yaml            2.1.14      2016-11-12
 zoo             1.7-13      2016-05-03
 source                                 
 CRAN (R 3.3.0)                         
 CRAN (R 3.2.0)                         
 CRAN (R 3.2.0)                         
 CRAN (R 3.3.1)                         
 Github (hadley/devtools@1ce84b0)       
 cran (@0.6.10)                         
 CRAN (R 3.3.0)                         
 CRAN (R 3.2.0)                         
 CRAN (R 3.3.0)                         
 Github (rstudio/htmltools@4fbf990)     
 CRAN (R 3.3.2)                         
 local                                  
 cran (@1.1)                            
 Github (cboettig/knitcitations@afffa3e)
 cran (@1.15.1)                         
 CRAN (R 3.3.0)                         
 CRAN (R 3.3.0)                         
 CRAN (R 3.2.0)                         
 CRAN (R 3.3.0)                         
 CRAN (R 3.2.3)                         
 Github (Rapporter/pander@48fa9ed)      
 Github (r-pkgs/pkgbuild@65eace0)       
 Github (r-pkgs/pkgload@def2b10)        
 CRAN (R 3.3.0)                         
 cran (@2.2.0)                          
 Github (RcppCore/Rcpp@8c7246e)         
 CRAN (R 3.2.4)                         
 CRAN (R 3.3.2)                         
 CRAN (R 3.2.0)                         
 Github (rstudio/rmarkdown@7a3df75)     
 cran (@1.1)                            
 CRAN (R 3.3.0)                         
 cran (@1.1.0)                          
 CRAN (R 3.3.0)                         
 CRAN (R 3.3.0)                         
 CRAN (R 3.2.2)                         
 CRAN (R 3.3.0)                         
 CRAN (R 3.3.2)                         
 CRAN (R 3.3.2)                         
 CRAN (R 3.2.4)                         

Ischemic Stroke

Not Ischemic Stroke