Regress QAP measures against scanning parameters


In [6]:
# Load some needed packages
library(grid)
library(gridExtra)
library(ggplot2)
library(dplyr)
library(repr)
library(reshape2)
library(tidyr)
library(lme4)
library(utils)
library(multcomp)
library(xtable)

Utility functions


In [ ]:
timestamp_to_numeric <- function(x) {
    times=unlist(strsplit(as.character(x), ":"))
    out_time = NaN
    
    if ( length(times) > 0 )
    {
        out_time <- as.numeric(times[1])*60.0
    }
    if ( length(times) > 1 )
    {
        out_time <- out_time + as.numeric(times[2])
    }
    if ( length(times) > 2 )
    {
        out_time <- out_time + as.numeric(times[3])/100.0
    }
    return(out_time)
}

sMRI DATA

1. Read in and tidy the sMRI scanning parameters for ABIDE


In [189]:
abide_smri_scan_params<-read.csv("anat_abide_scan_params_bids.csv")

# reduce to just the Siemens systems
abide_smri_scan_params<-abide_smri_scan_params %>% 
                     filter(Manufacturer == "Siemens") %>%
                         mutate(Scanner = paste(Manufacturer,ManufacturersModelName))
abide_smri_scan_params$Scanner<-factor(abide_smri_scan_params$Scanner)

abide_smri_scan_params<-abide_smri_scan_params %>% 
                     rowwise() %>% 
                       mutate(VoxelVolume = as.numeric(SliceThickness)*
                                            prod(as.numeric(unlist(strsplit(as.character(PixelSpacing), "x"))))) 

abide_smri_scan_params<-abide_smri_scan_params %>% 
                     rowwise() %>%
                       mutate(AcquisitionDuration = timestamp_to_numeric(AcquisitionDuration))

abide_smri_scan_params<-abide_smri_scan_params %>% 
                     rowwise() %>%
                       mutate(AcquisitionDurationCalc = RepetitionTime * NumberOfSlices)

abide_smri_scan_params<-abide_smri_scan_params %>% 
                      dplyr::select(Site,Scanner,EchoTime,RepetitionTime,InversionTime,FlipAngle,VoxelVolume) %>% 
                      drop_na()

abide_smri_scan_params$Scanner<-droplevels(abide_smri_scan_params$Scanner)

In [190]:
abide_smri_scan_params %>% tbl_df()


SiteScannerEchoTimeRepetitionTimeInversionTimeFlipAngleVoxelVolume
CMU_a Siemens Verio 0.002480 1.87 1.100 8 1.000
CMU_b Siemens Verio 0.002480 1.87 1.100 8 1.000
Caltech Siemens TrioTim0.002730 1.59 0.800 10 1.000
MaxMun_a Siemens Verio 0.003060 1.80 0.900 9 1.000
MaxMun_b Siemens Verio 0.003060 1.80 0.900 9 1.000
MaxMun_c Siemens Verio 0.003060 1.80 0.900 9 1.000
MaxMun_d Siemens Verio 0.003060 1.80 0.900 9 1.000
NYU Siemens Allegra0.003250 2.53 1.100 7 1.690
OHSU Siemens TrioTim0.003589 2.30 0.900 10 1.100
Olin Siemens Allegra0.002740 2.50 0.900 8 1.000
Pitt Siemens Allegra0.003930 2.10 1.000 7 1.331
UCLA_1 Siemens TrioTim0.002840 2.30 0.853 9 1.200
UCLA_2 Siemens TrioTim0.002840 2.30 0.853 9 1.200
USM Siemens TrioTim0.002910 2.30 0.900 9 1.200
Yale Siemens TrioTim0.001730 1.23 0.624 9 1.000

2. Read in and tidy the sMRI QAP measures for ABIDE


In [191]:
abide_anat_spat_df<-read.csv("2016_05_ABIDE_qap_anatomical_spatial.csv")

id.vars=c('Participant','Site','Session','Series')
measure.vars=c('CNR','Cortical.Contrast','EFC','FBER','FWHM','Qi1','SNR')
abide_anat_spat_df<-abide_anat_spat_df[c(id.vars,measure.vars)]

# reduce to just session_1 and anat_1 and remove rows with missing values
abide_anat_spat_df <- abide_anat_spat_df %>% 
                        filter(Session == "session_1" & Series == "anat_1") %>% 
                           drop_na()

# make sure that participant is a factor
abide_anat_spat_df$Participant <- factor(abide_anat_spat_df$Participant)

# summary(abide_anat_spat_df)

# plots
qap_label_strings=c(CNR='CNR',
                Cortical.Contrast='Cortical Contrast',
                EFC='EFC',
                FBER='FBER',
                FWHM='Smoothness (FWHM)',
                Qi1='Fraction of Artifact Voxels',
                SNR='SNR')

# combine with parameters
abide_anat_df <- inner_join(abide_anat_spat_df, abide_smri_scan_params, by="Site")

In [192]:
abide_anat_df %>% tbl_df()


ParticipantSiteSessionSeriesCNRCortical.ContrastEFCFBERFWHMQi1SNRScannerEchoTimeRepetitionTimeInversionTimeFlipAngleVoxelVolume
50002 Pitt session_1 anat_1 11.737636 0.3916667 0.5026067 249.3866 3.845912 0.15565057 17.75640 Siemens Allegra0.00393 2.1 1 7 1.331
50003 Pitt session_1 anat_1 9.307147 0.3205829 0.4786799 194.6180 4.246237 0.15879603 16.71580 Siemens Allegra0.00393 2.1 1 7 1.331
50004 Pitt session_1 anat_1 12.188784 0.3945931 0.4730299 264.1895 3.837011 0.16217479 18.77359 Siemens Allegra0.00393 2.1 1 7 1.331
50005 Pitt session_1 anat_1 12.461291 0.3810753 0.4629147 274.4577 3.633874 0.11558958 19.43004 Siemens Allegra0.00393 2.1 1 7 1.331
50006 Pitt session_1 anat_1 13.148553 0.3893785 0.4227490 469.4240 3.633893 0.12287874 22.24350 Siemens Allegra0.00393 2.1 1 7 1.331
50007 Pitt session_1 anat_1 9.443249 0.3565112 0.4976299 206.1733 4.094131 0.22746124 15.76759 Siemens Allegra0.00393 2.1 1 7 1.331
50008 Pitt session_1 anat_1 12.116583 0.3923378 0.4710950 273.5004 3.754357 0.09592457 18.49452 Siemens Allegra0.00393 2.1 1 7 1.331
50009 Pitt session_1 anat_1 11.007108 0.4003765 0.5061345 223.2074 3.520997 0.18468458 17.44546 Siemens Allegra0.00393 2.1 1 7 1.331
50010 Pitt session_1 anat_1 13.123298 0.3815857 0.4074926 371.6116 3.769759 0.07750221 20.05090 Siemens Allegra0.00393 2.1 1 7 1.331
50011 Pitt session_1 anat_1 11.428044 0.4132088 0.5134501 204.3232 3.697480 0.13473372 16.36881 Siemens Allegra0.00393 2.1 1 7 1.331
50012 Pitt session_1 anat_1 8.995753 0.3500738 0.4376514 196.9005 3.890813 0.14840170 15.76012 Siemens Allegra0.00393 2.1 1 7 1.331
50013 Pitt session_1 anat_1 9.174357 0.3499265 0.4306701 219.4858 3.494429 0.18543568 16.38546 Siemens Allegra0.00393 2.1 1 7 1.331
50014 Pitt session_1 anat_1 12.436444 0.3952133 0.4340672 274.5585 3.926672 0.16228184 19.19092 Siemens Allegra0.00393 2.1 1 7 1.331
50015 Pitt session_1 anat_1 8.948994 0.3716148 0.4744626 164.7965 3.641756 0.24926249 14.21924 Siemens Allegra0.00393 2.1 1 7 1.331
50016 Pitt session_1 anat_1 10.435515 0.3674520 0.5007416 219.0012 4.029820 0.15805636 16.84435 Siemens Allegra0.00393 2.1 1 7 1.331
50017 Pitt session_1 anat_1 8.505581 0.3489843 0.5013194 149.5650 4.140289 0.29399534 13.28307 Siemens Allegra0.00393 2.1 1 7 1.331
50019 Pitt session_1 anat_1 8.918376 0.3617896 0.5470615 172.9798 3.709617 0.21990234 14.73317 Siemens Allegra0.00393 2.1 1 7 1.331
50020 Pitt session_1 anat_1 9.973146 0.3547867 0.4745832 205.9919 3.892041 0.16745260 16.46782 Siemens Allegra0.00393 2.1 1 7 1.331
50022 Pitt session_1 anat_1 10.890865 0.3741403 0.4896525 242.7705 3.832651 0.14152910 17.44201 Siemens Allegra0.00393 2.1 1 7 1.331
50023 Pitt session_1 anat_1 10.904627 0.3522709 0.4524089 274.8482 3.800268 0.16965761 19.21544 Siemens Allegra0.00393 2.1 1 7 1.331
50024 Pitt session_1 anat_1 11.499695 0.4068101 0.4859200 266.0042 3.657424 0.14413157 17.34190 Siemens Allegra0.00393 2.1 1 7 1.331
50025 Pitt session_1 anat_1 11.255064 0.3702713 0.4297802 308.9681 3.970317 0.12499885 18.16390 Siemens Allegra0.00393 2.1 1 7 1.331
50026 Pitt session_1 anat_1 10.818378 0.3731273 0.4816916 229.7497 3.749759 0.12896351 17.47949 Siemens Allegra0.00393 2.1 1 7 1.331
50027 Pitt session_1 anat_1 12.525527 0.3457031 0.3912875 465.5549 3.856839 0.11372831 22.08733 Siemens Allegra0.00393 2.1 1 7 1.331
50028 Pitt session_1 anat_1 11.940501 0.3937470 0.4571809 302.5666 3.810091 0.13449301 19.38886 Siemens Allegra0.00393 2.1 1 7 1.331
50029 Pitt session_1 anat_1 11.260409 0.3664364 0.4624807 283.6135 3.731673 0.14933376 18.61858 Siemens Allegra0.00393 2.1 1 7 1.331
50030 Pitt session_1 anat_1 12.075057 0.3981433 0.4510633 288.5380 3.856011 0.13608678 18.87861 Siemens Allegra0.00393 2.1 1 7 1.331
50031 Pitt session_1 anat_1 11.200224 0.3843319 0.4229953 329.9401 3.817745 0.24096567 18.78067 Siemens Allegra0.00393 2.1 1 7 1.331
50032 Pitt session_1 anat_1 10.883530 0.3648506 0.4777923 231.1769 4.326073 0.15606793 17.94484 Siemens Allegra0.00393 2.1 1 7 1.331
50033 Pitt session_1 anat_1 8.921755 0.2999749 0.4386195 295.2672 3.880180 0.21236300 18.11786 Siemens Allegra0.00393 2.1 1 7 1.331
51466 Caltech session_1 anat_1 6.660019 0.2438837 0.4452260 722.4087 4.09601 0.1937314 19.54214 Siemens TrioTim0.00273 1.59 0.8 10 1
51467 Caltech session_1 anat_1 6.506545 0.2524716 0.4703647 616.4903 3.91694 0.2198122 19.71028 Siemens TrioTim0.00273 1.59 0.8 10 1
51468 Caltech session_1 anat_1 5.334768 0.2333655 0.4790850 485.7116 3.73186 0.2342913 17.06448 Siemens TrioTim0.00273 1.59 0.8 10 1
51469 Caltech session_1 anat_1 5.881435 0.2594429 0.4677300 479.0710 3.94138 0.2818857 17.11285 Siemens TrioTim0.00273 1.59 0.8 10 1
51470 Caltech session_1 anat_1 5.587748 0.2357116 0.4812705 576.1273 4.02518 0.2111913 17.52328 Siemens TrioTim0.00273 1.59 0.8 10 1
51471 Caltech session_1 anat_1 6.522206 0.2398581 0.3999525 1115.1993 4.23991 0.1672471 19.10395 Siemens TrioTim0.00273 1.59 0.8 10 1
51472 Caltech session_1 anat_1 5.637487 0.2411256 0.4815824 572.5240 3.89045 0.2512142 17.57716 Siemens TrioTim0.00273 1.59 0.8 10 1
51473 Caltech session_1 anat_1 5.762078 0.2436058 0.4542766 467.1601 4.16734 0.1910841 17.76601 Siemens TrioTim0.00273 1.59 0.8 10 1
51474 Caltech session_1 anat_1 5.578467 0.2248470 0.4662945 732.6478 4.11134 0.2286688 18.27766 Siemens TrioTim0.00273 1.59 0.8 10 1
51475 Caltech session_1 anat_1 6.176974 0.2524423 0.4690993 590.0235 4.02479 0.1943708 17.78963 Siemens TrioTim0.00273 1.59 0.8 10 1
51476 Caltech session_1 anat_1 6.650642 0.2360913 0.4561825 680.5526 3.73673 0.1969910 21.09029 Siemens TrioTim0.00273 1.59 0.8 10 1
51477 Caltech session_1 anat_1 9.098066 0.2941534 0.4104597 746.4130 4.23118 0.1829251 20.01324 Siemens TrioTim0.00273 1.59 0.8 10 1
51478 Caltech session_1 anat_1 7.324864 0.2597834 0.4414028 564.9378 3.85871 0.1742026 19.67715 Siemens TrioTim0.00273 1.59 0.8 10 1
51479 Caltech session_1 anat_1 6.672267 0.2354929 0.4020843 497.8908 3.89646 0.1853865 20.14610 Siemens TrioTim0.00273 1.59 0.8 10 1
51480 Caltech session_1 anat_1 6.153572 0.2163521 0.3980642 945.5222 4.04232 0.1751034 20.01856 Siemens TrioTim0.00273 1.59 0.8 10 1
51481 Caltech session_1 anat_1 6.283337 0.2342528 0.4403301 919.1408 4.13031 0.2285309 19.54290 Siemens TrioTim0.00273 1.59 0.8 10 1
51482 Caltech session_1 anat_1 6.173293 0.2285663 0.4178716 536.2321 3.72868 0.1830480 19.83396 Siemens TrioTim0.00273 1.59 0.8 10 1
51483 Caltech session_1 anat_1 6.326246 0.2495687 0.4521458 386.7966 4.03714 0.2007545 18.06961 Siemens TrioTim0.00273 1.59 0.8 10 1
51484 Caltech session_1 anat_1 6.637877 0.2344217 0.4268186 848.1191 3.90806 0.2872536 21.56789 Siemens TrioTim0.00273 1.59 0.8 10 1
51485 Caltech session_1 anat_1 6.535869 0.2659260 0.4663206 601.5331 3.73049 0.1861644 19.13603 Siemens TrioTim0.00273 1.59 0.8 10 1
51486 Caltech session_1 anat_1 6.578249 0.2399006 0.4547199 605.0218 3.69595 0.2180342 20.63494 Siemens TrioTim0.00273 1.59 0.8 10 1
51487 Caltech session_1 anat_1 4.766988 0.2336522 0.4396351 495.6648 3.87763 0.1529582 16.06125 Siemens TrioTim0.00273 1.59 0.8 10 1
51488 Caltech session_1 anat_1 7.679461 0.2569582 0.4060907 578.8029 3.91503 0.1340552 21.06555 Siemens TrioTim0.00273 1.59 0.8 10 1
51489 Caltech session_1 anat_1 7.672472 0.2595990 0.4556080 751.6770 3.79479 0.1737410 23.10580 Siemens TrioTim0.00273 1.59 0.8 10 1
51490 Caltech session_1 anat_1 6.058567 0.2360540 0.4352169 461.7335 4.35532 0.1594382 18.25794 Siemens TrioTim0.00273 1.59 0.8 10 1
51491 Caltech session_1 anat_1 6.078353 0.2321323 0.4283398 717.0707 3.97257 0.1921293 19.50954 Siemens TrioTim0.00273 1.59 0.8 10 1
51492 Caltech session_1 anat_1 6.203358 0.2312271 0.4588071 490.4555 4.07080 0.2118493 20.00688 Siemens TrioTim0.00273 1.59 0.8 10 1
51493 Caltech session_1 anat_1 6.635450 0.2340501 0.4225696 853.9426 4.13325 0.2150384 20.52887 Siemens TrioTim0.00273 1.59 0.8 10 1
51606 MaxMun_a session_1 anat_1 6.404401 0.3327894 0.4501676 254.1895 3.24776 0.1494735 15.80297 Siemens Verio 0.00306 1.80 0.9 9 1
51607 MaxMun_a session_1 anat_1 7.240628 0.3208306 0.4785082 423.8323 3.47066 0.1017022 17.25503 Siemens Verio 0.00306 1.80 0.9 9 1

3. Read in and tidy the sMRI scanning parameters for CORR


In [193]:
corr_smri_scan_params<-read.csv("anat_corr_scan_params.csv")

corr_smri_scan_params<-corr_smri_scan_params %>%
                     filter(Manufacturer == "Siemens") %>%
                         mutate(Scanner = paste(Manufacturer,ManufacturersModelName))
corr_smri_scan_params$Scanner<-factor(corr_smri_scan_params$Scanner)

corr_smri_scan_params<-corr_smri_scan_params %>% 
                     rowwise() %>% 
                       mutate(VoxelVolume = as.numeric(SliceThickness)*
                                            prod(as.numeric(unlist(strsplit(as.character(PixelSpacing), "x")))))

corr_smri_scan_params<-corr_smri_scan_params %>%
                     filter(PulseSequenceType != "3D MP2RAGE") %>%
                       filter(PulseSequenceType != "3D MEMPR")

corr_smri_scan_params<-corr_smri_scan_params %>% 
                     dplyr::select(Site,Scanner,EchoTime,RepetitionTime,InversionTime,FlipAngle,VoxelVolume) %>% 
                       drop_na()


# tidy up columns, dropping unused levels and converting cols to numeric
for( i in colnames(corr_smri_scan_params)){
    if (( i != "Site" ) & ( i != "Scanner" )){
        if (! is.numeric(corr_smri_scan_params[[i]])){
            corr_smri_scan_params[[i]]<-as.numeric(levels(corr_smri_scan_params[[i]]))[corr_smri_scan_params[[i]]]
        }
    }
}

# corr_smri_scan_params$Site<-droplevels(corr_smri_scan_params$Site)
# corr_smri_scan_params$Scanner<-droplevels(corr_smri_scan_params$Scanner)

corr_smri_scan_params %>% tbl_df()


Warning message:
“NAs introduced by coercion”Warning message:
“NAs introduced by coercion”Warning message:
“NAs introduced by coercion”
SiteScannerEchoTimeRepetitionTimeInversionTimeFlipAngleVoxelVolume
BMB 1 Siemens TrioTim0.00298 2.30 0.90 9 1.000000
BNU 1 Siemens TrioTim0.00339 2.53 1.10 7 1.690000
BNU 2 ses-1 Siemens TrioTim0.00339 2.53 1.10 7 1.690000
BNU 2 ses-2 Siemens TrioTim0.00345 2.53 1.10 7 1.000000
BNU 3 Siemens TrioTim0.00339 2.53 1.10 7 1.729000
IBA TRT Siemens TrioTim0.00302 2.60 0.90 8 1.000000
IPCAS 1 Siemens TrioTim0.00251 2.53 1.10 7 1.300000
IPCAS 2 Siemens TrioTim0.00295 2.30 0.90 9 1.054688
IPCAS 3 Siemens TrioTim0.00251 2.53 1.10 7 1.330000
IPCAS 5 Siemens TrioTim0.00350 2.53 1.10 7 1.000000
IPCAS 6 Siemens TrioTim0.00252 1.90 0.90 9 1.000000
IPCAS 7 Siemens TrioTim0.00302 2.60 0.90 8 1.000000
IPCAS 8 Siemens TrioTim0.00339 2.53 1.10 7 1.690000
JHNU Siemens TrioTim0.00298 2.30 0.90 9 1.000000
LMU 2 Siemens Verio 0.00306 2.40 0.90 9 1.000000
LMU 3 Siemens TrioTim0.00306 2.40 0.90 9 1.000000
NKI TRT Siemens TrioTim0.00252 1.90 0.90 9 1.000000
NYU 1 Siemens Allegra0.00325 2.53 1.10 7 1.690000
NYU 2 Siemens Allegra0.00393 2.50 0.90 8 1.000000
SWU 1 Siemens TrioTim0.00252 1.90 0.90 9 1.000000
SWU 2 Siemens TrioTim0.00252 1.90 0.90 9 1.000000
SWU 3 Siemens TrioTim0.00252 1.90 0.90 9 1.000000
SWU 4 Siemens TrioTim0.00252 1.90 0.90 9 1.000000
UM Siemens TrioTim0.00298 2.30 0.90 9 1.000000
UPSM 1 Siemens TrioTim0.00343 2.10 1.05 8 1.000000
Utah 1 Siemens TrioTim0.00291 2.30 0.90 9 1.200000
Utah 2 Siemens TrioTim0.00291 2.30 0.90 9 1.200000
XHCUMS Siemens TrioTim0.00215 1.60 0.80 9 1.000000

4. Read in and tidy the sMRI QAP measures for CORR


In [15]:
corr_anat_spat_df<-read.csv("2016_05_CORR_qap_anatomical_spatial.csv")

id.vars=c('Participant','Site','Session','Series')
measure.vars=c('CNR','Cortical.Contrast','EFC','FBER','FWHM','Qi1','SNR')
corr_anat_spat_df<-corr_anat_spat_df[c(id.vars,measure.vars)]

# reduce to just session_1 and anat_1 and remove rows with missing values
corr_anat_spat_df <- corr_anat_spat_df %>% 
                        filter(Session == "session_1" & Series == "anat_1") %>% 
                           drop_na()

# make sure that participant is a factor
corr_anat_spat_df$Participant <- factor(corr_anat_spat_df$Participant)

# summary(abide_anat_spat_df)

# plots
qap_label_strings=c(CNR='CNR',
                Cortical.Contrast='Cortical Contrast',
                EFC='EFC',
                FBER='FBER',
                FWHM='Smoothness (FWHM)',
                Qi1='Fraction of Artifact Voxels',
                SNR='SNR')

corr_anat_spat_df <- inner_join(corr_anat_spat_df, corr_smri_scan_params, by="Site")


Warning message in inner_join_impl(x, y, by$x, by$y, suffix$x, suffix$y):
“joining factors with different levels, coercing to character vector”

In [16]:
corr_anat_spat_df %>% tbl_df()


ParticipantSiteSessionSeriesCNRCortical.ContrastEFCFBERFWHMQi1SNRScannerEchoTimeRepetitionTimeInversionTimeFlipAngleVoxelVolume
25599 JHNU session_1 anat_1 10.595293 0.3195716 0.4407884 516.3453 3.51983 0.08878368 26.09653 Siemens TrioTim0.00298 2.3 0.9 9 1
25600 JHNU session_1 anat_1 10.988521 0.3188174 0.4454495 677.4726 4.20135 0.09439833 26.58296 Siemens TrioTim0.00298 2.3 0.9 9 1
25601 JHNU session_1 anat_1 12.270253 0.3321005 0.4481019 863.2795 3.61285 0.11224674 28.71940 Siemens TrioTim0.00298 2.3 0.9 9 1
25602 JHNU session_1 anat_1 10.025403 0.3190558 0.5021002 855.3761 3.12180 0.19547611 29.61605 Siemens TrioTim0.00298 2.3 0.9 9 1
25603 JHNU session_1 anat_1 12.544036 0.3787305 0.4084452 530.8371 3.33419 0.10272382 25.69635 Siemens TrioTim0.00298 2.3 0.9 9 1
25604 JHNU session_1 anat_1 12.152581 0.3327836 0.4175791 403.3878 4.69805 0.10388854 25.79123 Siemens TrioTim0.00298 2.3 0.9 9 1
25605 JHNU session_1 anat_1 13.688974 0.3797904 0.4062813 578.4140 3.06218 0.09054422 26.51364 Siemens TrioTim0.00298 2.3 0.9 9 1
25606 JHNU session_1 anat_1 12.730425 0.3468796 0.4465486 656.8925 3.71535 0.10712243 28.04013 Siemens TrioTim0.00298 2.3 0.9 9 1
25607 JHNU session_1 anat_1 11.528671 0.3245080 0.4311167 523.4361 3.61318 0.08763413 27.32128 Siemens TrioTim0.00298 2.3 0.9 9 1
25608 JHNU session_1 anat_1 11.826949 0.3242923 0.4250187 608.4486 4.16382 0.11716681 27.40298 Siemens TrioTim0.00298 2.3 0.9 9 1
25609 JHNU session_1 anat_1 12.238456 0.3381451 0.3995467 620.3747 3.91487 0.10901782 28.79680 Siemens TrioTim0.00298 2.3 0.9 9 1
25610 JHNU session_1 anat_1 11.309542 0.3367292 0.4281955 881.0388 3.40882 0.09874725 24.44176 Siemens TrioTim0.00298 2.3 0.9 9 1
25611 JHNU session_1 anat_1 13.470544 0.3558664 0.4192633 586.8050 4.12755 0.08606097 27.62723 Siemens TrioTim0.00298 2.3 0.9 9 1
25612 JHNU session_1 anat_1 8.645684 0.2977106 0.4453596 462.4596 4.46864 0.09712282 19.85199 Siemens TrioTim0.00298 2.3 0.9 9 1
25613 JHNU session_1 anat_1 12.752049 0.3388094 0.4322445 552.7173 3.77009 0.07720465 26.99698 Siemens TrioTim0.00298 2.3 0.9 9 1
25614 JHNU session_1 anat_1 13.128541 0.3560932 0.4178333 607.4139 3.67929 0.11272085 27.29393 Siemens TrioTim0.00298 2.3 0.9 9 1
25615 JHNU session_1 anat_1 12.493555 0.3320407 0.3957912 534.3109 4.00628 0.11763893 28.06574 Siemens TrioTim0.00298 2.3 0.9 9 1
25616 JHNU session_1 anat_1 12.100841 0.3358233 0.3909610 631.5207 3.47020 0.11816637 27.63418 Siemens TrioTim0.00298 2.3 0.9 9 1
25617 JHNU session_1 anat_1 12.579497 0.3610589 0.4120538 1159.6793 3.43812 0.11668590 27.63934 Siemens TrioTim0.00298 2.3 0.9 9 1
25618 JHNU session_1 anat_1 11.712311 0.3191987 0.4079668 561.8305 3.64745 0.10990890 28.26249 Siemens TrioTim0.00298 2.3 0.9 9 1
25619 JHNU session_1 anat_1 9.683800 0.3079847 0.3675980 282.9724 5.72723 0.10274749 20.78240 Siemens TrioTim0.00298 2.3 0.9 9 1
25620 JHNU session_1 anat_1 11.143734 0.3175089 0.4275288 344.4685 3.78999 0.11429798 26.15079 Siemens TrioTim0.00298 2.3 0.9 9 1
25621 JHNU session_1 anat_1 9.252729 0.3054736 0.4337574 388.6720 4.23178 0.13020943 20.84872 Siemens TrioTim0.00298 2.3 0.9 9 1
25622 JHNU session_1 anat_1 7.478309 0.2900267 0.4064271 195.8460 6.59275 0.11708864 16.48775 Siemens TrioTim0.00298 2.3 0.9 9 1
25623 JHNU session_1 anat_1 13.896433 0.3620806 0.4032113 710.0368 3.66272 0.10370805 29.93276 Siemens TrioTim0.00298 2.3 0.9 9 1
25624 JHNU session_1 anat_1 12.234291 0.3419169 0.4435940 604.1223 3.84930 0.13465701 26.79835 Siemens TrioTim0.00298 2.3 0.9 9 1
25625 JHNU session_1 anat_1 12.397413 0.3262199 0.4081092 768.8470 3.77378 0.08019270 30.12439 Siemens TrioTim0.00298 2.3 0.9 9 1
25626 JHNU session_1 anat_1 10.763702 0.3392741 0.4260002 395.3013 4.77003 0.11769623 23.23200 Siemens TrioTim0.00298 2.3 0.9 9 1
25627 JHNU session_1 anat_1 12.698088 0.3398868 0.4201620 485.3086 3.06329 0.07706542 27.38785 Siemens TrioTim0.00298 2.3 0.9 9 1
25628 JHNU session_1 anat_1 12.427450 0.3751264 0.4162460 539.7959 3.91746 0.10574461 25.20689 Siemens TrioTim0.00298 2.3 0.9 9 1
26160 UM session_1 anat_1 9.002513 0.3378994 0.3826090 360.5517 3.30634 0.12260802 18.48827 Siemens TrioTim0.00298 2.3 0.9 9 1
26161 UM session_1 anat_1 7.694474 0.3498128 0.4687773 440.3615 2.91489 0.14515406 17.23960 Siemens TrioTim0.00298 2.3 0.9 9 1
26162 UM session_1 anat_1 8.036548 0.3440363 0.4100895 543.0422 3.49900 0.12704340 19.39491 Siemens TrioTim0.00298 2.3 0.9 9 1
26163 UM session_1 anat_1 7.632384 0.3526415 0.4393568 239.7349 3.22215 0.18551649 16.17904 Siemens TrioTim0.00298 2.3 0.9 9 1
26164 UM session_1 anat_1 9.124683 0.3608815 0.4183121 400.7695 3.00759 0.13071770 19.52153 Siemens TrioTim0.00298 2.3 0.9 9 1
26165 UM session_1 anat_1 7.188612 0.3221443 0.4734986 398.7309 3.04127 0.19212596 17.77000 Siemens TrioTim0.00298 2.3 0.9 9 1
26166 UM session_1 anat_1 9.247303 0.3503997 0.3991803 514.7295 3.17636 0.11050316 21.86554 Siemens TrioTim0.00298 2.3 0.9 9 1
26167 UM session_1 anat_1 8.836284 0.3580216 0.4377547 496.5645 2.90141 0.13543083 19.66627 Siemens TrioTim0.00298 2.3 0.9 9 1
26168 UM session_1 anat_1 10.160002 0.3675972 0.3965207 344.7545 3.37670 0.13244017 19.34043 Siemens TrioTim0.00298 2.3 0.9 9 1
26169 UM session_1 anat_1 7.535737 0.3312683 0.4303499 522.0415 3.23008 0.14900119 18.75422 Siemens TrioTim0.00298 2.3 0.9 9 1
26170 UM session_1 anat_1 9.377190 0.3615355 0.4023969 489.4799 3.16801 0.12998287 18.72217 Siemens TrioTim0.00298 2.3 0.9 9 1
26171 UM session_1 anat_1 7.627970 0.3402495 0.4290077 371.4765 2.76521 0.14961443 17.93978 Siemens TrioTim0.00298 2.3 0.9 9 1
26172 UM session_1 anat_1 8.848437 0.3526934 0.4099057 437.3831 3.25260 0.10563847 20.76705 Siemens TrioTim0.00298 2.3 0.9 9 1
26173 UM session_1 anat_1 8.617062 0.3573804 0.4128883 416.5424 3.13554 0.15294401 18.36879 Siemens TrioTim0.00298 2.3 0.9 9 1
26174 UM session_1 anat_1 8.218682 0.3636057 0.4614068 476.0776 2.82188 0.21542047 18.41423 Siemens TrioTim0.00298 2.3 0.9 9 1
26175 UM session_1 anat_1 9.262675 0.3521472 0.4076345 300.8720 3.18069 0.11662819 18.74956 Siemens TrioTim0.00298 2.3 0.9 9 1
26176 UM session_1 anat_1 8.666539 0.3758933 0.4552701 411.7892 2.98844 0.21013699 17.23947 Siemens TrioTim0.00298 2.3 0.9 9 1
26177 UM session_1 anat_1 9.137239 0.3698254 0.3996506 491.4201 3.00039 0.18484166 19.49568 Siemens TrioTim0.00298 2.3 0.9 9 1
26178 UM session_1 anat_1 8.137340 0.3520671 0.4247407 496.9779 3.16026 0.16392932 18.77231 Siemens TrioTim0.00298 2.3 0.9 9 1
26179 UM session_1 anat_1 8.217363 0.3482196 0.4482893 521.0055 2.90420 0.12794084 19.71387 Siemens TrioTim0.00298 2.3 0.9 9 1
26180 UM session_1 anat_1 7.993928 0.3391041 0.4335963 471.1600 3.60836 0.12573604 18.34141 Siemens TrioTim0.00298 2.3 0.9 9 1
26181 UM session_1 anat_1 9.169253 0.3570126 0.3872553 420.9572 3.29322 0.10160388 18.94048 Siemens TrioTim0.00298 2.3 0.9 9 1
26182 UM session_1 anat_1 9.232018 0.3573676 0.3882625 497.7237 3.28058 0.11184002 20.32748 Siemens TrioTim0.00298 2.3 0.9 9 1
26183 UM session_1 anat_1 8.290993 0.3273746 0.3990797 340.7854 3.53490 0.09255542 20.16299 Siemens TrioTim0.00298 2.3 0.9 9 1
26184 UM session_1 anat_1 9.765486 0.3804343 0.3925676 437.9159 3.21608 0.10455970 19.65109 Siemens TrioTim0.00298 2.3 0.9 9 1
26185 UM session_1 anat_1 6.885567 0.3198912 0.4763813 445.5145 3.13464 0.19157534 16.42671 Siemens TrioTim0.00298 2.3 0.9 9 1
26186 UM session_1 anat_1 8.492759 0.3671337 0.4539056 478.0915 2.92564 0.15354669 18.59718 Siemens TrioTim0.00298 2.3 0.9 9 1
26187 UM session_1 anat_1 9.096452 0.3564102 0.4058980 463.9429 3.19637 0.12960924 19.78593 Siemens TrioTim0.00298 2.3 0.9 9 1
26188 UM session_1 anat_1 8.884883 0.3599244 0.4204147 515.5967 3.12468 0.18447600 19.63769 Siemens TrioTim0.00298 2.3 0.9 9 1
26189 UM session_1 anat_1 8.311886 0.3404259 0.4293393 468.0817 3.08274 0.13850570 19.71912 Siemens TrioTim0.00298 2.3 0.9 9 1

5. Analyze!


In [17]:
# Combine the twodatasets into one large dataframe
qap_param_df<-bind_rows(abide_anat_df,corr_anat_spat_df)

# mean center all of the covariates
qap_param_df<-qap_param_df %>% mutate_if(is.numeric, funs(scale(., scale=TRUE)))


Warning message in bind_rows_(x, .id):
“Unequal factor levels: coercing to character”Warning message in bind_rows_(x, .id):
“binding factor and character vector, coercing into character vector”Warning message in bind_rows_(x, .id):
“Unequal factor levels: coercing to character”Warning message in bind_rows_(x, .id):
“Unequal factor levels: coercing to character”Warning message in bind_rows_(x, .id):
“Unequal factor levels: coercing to character”

In [194]:
meas_stats=data.frame()
for ( meas in measure.vars ){
    print(meas)
    full_formula=as.formula(
        sprintf("%s ~ 0 + Scanner + EchoTime + InversionTime + RepetitionTime + FlipAngle + VoxelVolume",
                  meas))
    reduced_formula=as.formula(
        sprintf("%s ~ 0 + EchoTime + InversionTime + RepetitionTime + FlipAngle + VoxelVolume",
                  meas))
    full_model<-lm(full_formula, qap_param_df)
    reduced_model<-lm(reduced_formula, qap_param_df)
    scanner_f=anova(full_model,reduced_model)
    all_t=summary(full_model)
    
    meas_stats <- rbind(meas_stats,
                       data.frame(Measure=meas,
                          covariate="Scanner",
                          stat=scanner_f$F[2],
                          val_p=scanner_f[2,"Pr(>F)"]))
    
    for( covariate in c('EchoTime', 'InversionTime', 'RepetitionTime', 'FlipAngle', 'VoxelVolume')){
            meas_stats <- rbind(meas_stats,
                       data.frame(Measure=meas,
                          covariate=covariate,
                          stat=all_t$coefficients[covariate,'t value'],
                          val_p=all_t$coefficients[covariate,'Pr(>|t|)']))
    }
    
}

meas_stats$val_p <- p.adjust(meas_stats$val_p, "BH")
# smri_qap_param_model_red<-lm(SNR ~ 0 + EchoTime + InversionTime + 
#                                RepetitionTime + FlipAngle + VoxelVolume,
#                                qap_param_df)
# # summary(smri_qap_param_model)
# # anova(smri_qap_param_model,smri_qap_param_model_red)


[1] "CNR"
[1] "Cortical.Contrast"
[1] "EFC"
[1] "FBER"
[1] "FWHM"
[1] "Qi1"
[1] "SNR"

In [140]:
meas_stats = meas_stats %>% 
    gather(mes, value, -Measure, -covariate) %>% 
        mutate( cov_stat = paste(covariate, mes, sep="_")) %>% 
            dplyr::select(Measure, cov_stat, value) %>%
                spread(cov_stat, value)

In [141]:
meas_stats %>%tbl_df()


MeasureEchoTime_statEchoTime_val_pFlipAngle_statFlipAngle_val_pInversionTime_statInversionTime_val_pRepetitionTime_statRepetitionTime_val_pScanner_statScanner_val_pVoxelVolume_statVoxelVolume_val_p
CNR 1.418004 1.730561e-01 -9.384289 1.247423e-19 3.87476134 1.425093e-04 -8.607014 6.782255e-17 41.82401 1.032657e-24 -4.3652618 1.882541e-05
Cortical.Contrast 4.737734 3.573231e-06 -13.563284 1.838982e-37 -14.64388421 1.055955e-42 18.034716 1.352785e-60 34.02688 2.260130e-20 7.9970424 7.389488e-15
EFC 4.579905 7.294963e-06 6.577464 1.287629e-10 0.01713395 9.863340e-01 1.809167 8.036319e-02 31.36848 6.313651e-19 -4.8582139 2.060004e-06
FBER -15.038849 1.126026e-44 3.914693 1.249080e-04 26.39859789 1.219142e-109 -20.984189 3.004838e-77 122.94146 1.379259e-64 -17.3007857 1.410534e-56
FWHM -1.140737 2.738800e-01 -3.443972 7.232608e-04 0.58162879 5.890277e-01 -7.371662 6.485370e-13 21.69937 2.577427e-13 0.4089238 6.993552e-01
Qi1 9.476575 5.928352e-20 9.328483 1.917401e-19 14.37695358 2.137408e-41 -21.910161 1.393153e-82 38.04655 1.298559e-22 -13.8132914 1.206296e-38
SNR -9.724294 7.614931e-21 -3.157919 1.922636e-03 18.34820288 2.724213e-62 -18.531834 2.992323e-63 92.05821 1.365529e-50 -15.4270729 1.226371e-46

In [142]:
print(xtable(meas_stats, digits=3, display=c('s','s','g','g','g','g','g','g','g','g','g','g','g','g')))


% latex table generated in R 3.3.2 by xtable 1.8-2 package
% Thu Mar 23 17:53:32 2017
\begin{table}[ht]
\centering
\begin{tabular}{rlrrrrrrrrrrrr}
  \hline
 & Measure & EchoTime\_stat & EchoTime\_val\_p & FlipAngle\_stat & FlipAngle\_val\_p & InversionTime\_stat & InversionTime\_val\_p & RepetitionTime\_stat & RepetitionTime\_val\_p & Scanner\_stat & Scanner\_val\_p & VoxelVolume\_stat & VoxelVolume\_val\_p \\ 
  \hline
1 & CNR & 1.42 & 0.173 & -9.38 & 1.25e-19 & 3.87 & 0.000143 & -8.61 & 6.78e-17 & 41.8 & 1.03e-24 & -4.37 & 1.88e-05 \\ 
  2 & Cortical.Contrast & 4.74 & 3.57e-06 & -13.6 & 1.84e-37 & -14.6 & 1.06e-42 &   18 & 1.35e-60 &   34 & 2.26e-20 &    8 & 7.39e-15 \\ 
  3 & EFC & 4.58 & 7.29e-06 & 6.58 & 1.29e-10 & 0.0171 & 0.986 & 1.81 & 0.0804 & 31.4 & 6.31e-19 & -4.86 & 2.06e-06 \\ 
  4 & FBER &  -15 & 1.13e-44 & 3.91 & 0.000125 & 26.4 & 1.22e-109 &  -21 & 3e-77 &  123 & 1.38e-64 & -17.3 & 1.41e-56 \\ 
  5 & FWHM & -1.14 & 0.274 & -3.44 & 0.000723 & 0.582 & 0.589 & -7.37 & 6.49e-13 & 21.7 & 2.58e-13 & 0.409 & 0.699 \\ 
  6 & Qi1 & 9.48 & 5.93e-20 & 9.33 & 1.92e-19 & 14.4 & 2.14e-41 & -21.9 & 1.39e-82 &   38 & 1.3e-22 & -13.8 & 1.21e-38 \\ 
  7 & SNR & -9.72 & 7.61e-21 & -3.16 & 0.00192 & 18.3 & 2.72e-62 & -18.5 & 2.99e-63 & 92.1 & 1.37e-50 & -15.4 & 1.23e-46 \\ 
   \hline
\end{tabular}
\end{table}

fMRI DATA

1. Read in and tidy the fMRI acquisition parameters for ABIDE


In [209]:
abide_fmri_scan_params<-read.csv("rest_abide_scan_params_bids_slicetimes.csv")

# reduce to just the Siemens systems
abide_fmri_scan_params<-abide_fmri_scan_params %>% 
                     filter(Manufacturer == "Siemens") %>%
                         mutate(Scanner = paste(Manufacturer,ManufacturersModelName))
abide_fmri_scan_params$Scanner<-factor(abide_fmri_scan_params$Scanner)
       
abide_fmri_scan_params<-abide_fmri_scan_params %>% 
                     rowwise() %>% 
                       mutate(VoxelVolume = as.numeric(SliceThickness)*
                                            prod(as.numeric(unlist(strsplit(as.character(PixelSpacing), "x"))))) 

abide_fmri_scan_params<-abide_fmri_scan_params %>% 
                     rowwise() %>%
                       mutate(AcquisitionDuration = timestamp_to_numeric(AcquisitionDuration))

abide_fmri_scan_params<-abide_fmri_scan_params %>% 
                      dplyr::select(Site, Scanner, AcquisitionDuration, EchoTime ,RepetitionTime, FlipAngle, VoxelVolume) %>% 
                      drop_na()

abide_fmri_scan_params$Scanner<-droplevels(abide_fmri_scan_params$Scanner)

In [210]:
abide_fmri_scan_params %>% tbl_df()


SiteScannerAcquisitionDurationEchoTimeRepetitionTimeFlipAngleVoxelVolume
CMU_a Siemens Verio 486 0.030 2.0 73 27.000
CMU_b Siemens Verio 486 0.030 1.5 73 27.000
Caltech Siemens TrioTim304 0.030 2.0 75 42.875
MaxMun_a Siemens Verio 366 0.030 3.0 80 36.000
MaxMun_b Siemens Verio 366 0.030 3.0 80 36.000
MaxMun_c Siemens Verio 366 0.030 3.0 80 27.000
MaxMun_d Siemens Verio 606 0.030 3.0 80 27.000
NYU Siemens Allegra360 0.015 2.0 90 36.000
OHSU Siemens TrioTim212 0.030 2.5 90 54.872
Olin Siemens Allegra315 0.027 1.5 60 46.240
Pitt Siemens Allegra306 0.025 1.5 70 38.440
UCLA_1 Siemens TrioTim366 0.028 3.0 90 36.000
UCLA_2 Siemens TrioTim366 0.028 3.0 90 36.000
USM Siemens TrioTim486 0.028 2.0 90 34.680
Yale Siemens TrioTim400 0.025 2.0 60 46.240

2. Read in and tidy the fMRI QAP measures for ABIDE


In [211]:
abide_func_spat_df<-read.csv("2016_05_ABIDE_qap_functional_spatial.csv")

id.vars=c('Participant','Site','Session','Series')
measure.vars.spat=c('EFC','FBER','FWHM','Ghost_y','SNR')

# reduce to just the columns that we are interested in
abide_func_spat_df<-abide_func_spat_df[c(id.vars,measure.vars.spat)]

abide_func_temp_df<-read.csv("2016_05_ABIDE_qap_functional_temporal.csv")

id.vars=c('Participant','Site','Session','Series')
measure.vars.temp=c('Fraction.of.Outliers..Mean.','GCOR','Quality..Mean.',
               'RMSD..Mean.', 'Std..DVARS..Mean.')

# reduce to just the columns that we are interested in
abide_func_temp_df<-abide_func_temp_df[c(id.vars, measure.vars.temp)]

# join the spatial and temporal measures
abide_func_df<-inner_join(abide_func_spat_df, abide_func_temp_df)


# reduce to just session_1 and anat_1 and remove rows with missing values
abide_func_df <- abide_func_df %>% 
                     filter(Session == "session_1" & Series == "rest_1") %>% 
                         droplevels() %>%
                             drop_na()

# make sure that participant is a factor
abide_func_df$Participant <- factor(abide_func_df$Participant)


# plots
qap_label_strings=c(Ghost_y='GSR',
                EFC='EFC',
                FBER='FBER',
                FWHM='Smoothness (FWHM)',
                SNR='SNR',
                Fraction.of.Outliers..Mean.='Mean % Outliers',
                GCOR='GCOR',
                Quality..Mean.='Mean Quality',
                RMSD..Mean.='Mean RMSD',
                Std..DVARS..Mean.="Mean Std. Dvars.")

# combine with parameters
abide_func_df <- inner_join(abide_func_df, abide_fmri_scan_params, by="Site")


summary(abide_func_df)


Joining, by = c("Participant", "Site", "Session", "Series")
  Participant       Site          Session       Series         EFC        
 50002  :  1   NYU    :184   session_1:692   rest_1:692   Min.   :0.4185  
 50003  :  1   USM    :101                                1st Qu.:0.4984  
 50004  :  1   UCLA_1 : 81                                Median :0.5276  
 50005  :  1   Pitt   : 57                                Mean   :0.5294  
 50006  :  1   Yale   : 56                                3rd Qu.:0.5596  
 50007  :  1   Caltech: 38                                Max.   :0.6704  
 (Other):686   (Other):175                                                
      FBER             FWHM          Ghost_y                SNR        
 Min.   : 8.141   Min.   :1.576   Min.   :-0.0164149   Min.   : 6.273  
 1st Qu.:21.985   1st Qu.:1.811   1st Qu.: 0.0005513   1st Qu.: 9.837  
 Median :26.633   Median :1.915   Median : 0.0349412   Median :10.819  
 Mean   :27.635   Mean   :1.977   Mean   : 0.0299075   Mean   :10.991  
 3rd Qu.:32.769   3rd Qu.:2.066   3rd Qu.: 0.0464784   3rd Qu.:12.029  
 Max.   :48.473   Max.   :3.312   Max.   : 0.1041648   Max.   :16.072  
                                                                       
 Fraction.of.Outliers..Mean.      GCOR          Quality..Mean.    
 Min.   :0.0008716           Min.   :0.002471   Min.   :0.007735  
 1st Qu.:0.0023308           1st Qu.:0.019821   1st Qu.:0.040967  
 Median :0.0028090           Median :0.049580   Median :0.062805  
 Mean   :0.0043114           Mean   :0.197378   Mean   :0.091271  
 3rd Qu.:0.0047975           3rd Qu.:0.424073   3rd Qu.:0.149152  
 Max.   :0.0307659           Max.   :0.775381   Max.   :0.270276  
                                                                  
  RMSD..Mean.      Std..DVARS..Mean.            Scanner    AcquisitionDuration
 Min.   :0.01978   Min.   :0.6195    Siemens Allegra:277   Min.   :212.0      
 1st Qu.:0.05654   1st Qu.:0.9804    Siemens TrioTim:331   1st Qu.:360.0      
 Median :0.08627   Median :1.0536    Siemens Verio  : 84   Median :366.0      
 Mean   :0.13135   Mean   :1.0573                          Mean   :377.7      
 3rd Qu.:0.14092   3rd Qu.:1.1301                          3rd Qu.:400.0      
 Max.   :1.27064   Max.   :1.5065                          Max.   :606.0      
                                                                              
    EchoTime       RepetitionTime    FlipAngle      VoxelVolume   
 Min.   :0.01500   Min.   :1.500   Min.   :60.00   Min.   :27.00  
 1st Qu.:0.01500   1st Qu.:2.000   1st Qu.:73.00   1st Qu.:36.00  
 Median :0.02800   Median :2.000   Median :90.00   Median :36.00  
 Mean   :0.02443   Mean   :2.182   Mean   :82.05   Mean   :37.73  
 3rd Qu.:0.02800   3rd Qu.:2.500   3rd Qu.:90.00   3rd Qu.:38.44  
 Max.   :0.03000   Max.   :3.000   Max.   :90.00   Max.   :54.87  
                                                                  

3. Read in and tidy the fMRI acquisition parameters for CoRR


In [214]:
corr_fmri_scan_params<-read.csv("func_corr_scan_params.csv")

# reduce to just the Siemens systems
corr_fmri_scan_params<-corr_fmri_scan_params %>% 
                     filter(Manufacturer == "Siemens") %>%
                         mutate(Scanner = paste(Manufacturer,ManufacturersModelName))
corr_fmri_scan_params$Scanner<-factor(corr_fmri_scan_params$Scanner)

        
corr_fmri_scan_params<-corr_fmri_scan_params %>% 
                     rowwise() %>% 
                       mutate(VoxelVolume = as.numeric(SliceThickness)*
                                            prod(as.numeric(unlist(strsplit(as.character(PixelSpacing), "x"))))) 

corr_fmri_scan_params<-corr_fmri_scan_params %>% 
                     rowwise() %>%
                       mutate(AcquisitionDuration = timestamp_to_numeric(AcquisitionDuration))

corr_fmri_scan_params<-corr_fmri_scan_params %>% 
                      dplyr::select(Site, Scanner, AcquisitionDuration, EchoTime ,RepetitionTime, FlipAngle, VoxelVolume) %>% 
                      drop_na()

corr_fmri_scan_params$Scanner<-droplevels(corr_fmri_scan_params$Scanner)

In [215]:
summary(corr_fmri_scan_params)


                   Site                Scanner   AcquisitionDuration
 NKI TRT acq-tr1400ms: 4   Siemens Allegra : 2   Min.   :122.0      
 NKI TRT acq-tr645ms : 3   Siemens Magentom: 2   1st Qu.:352.0      
 IBA_TRT             : 2   Siemens TrioTim :34   Median :465.0      
 BMB 1               : 1   Siemens Verio   : 1   Mean   :431.2      
 BNU 1               : 1                         3rd Qu.:494.0      
 BNU 2 ses-1         : 1                         Max.   :915.0      
 (Other)             :27                                            
    EchoTime      RepetitionTime    FlipAngle      VoxelVolume    
 Min.   :0.0150   Min.   :0.645   Min.   :60.00   Min.   : 0.512  
 1st Qu.:0.0300   1st Qu.:1.750   1st Qu.:72.50   1st Qu.:27.000  
 Median :0.0300   Median :2.000   Median :90.00   Median :34.680  
 Mean   :0.0289   Mean   :2.009   Mean   :82.18   Mean   :32.691  
 3rd Qu.:0.0300   3rd Qu.:2.150   3rd Qu.:90.00   3rd Qu.:40.028  
 Max.   :0.0300   Max.   :4.000   Max.   :90.00   Max.   :64.000  
                                                                  

4. Read in and tidy the fMRI QAP measures for CoRR


In [216]:
corr_func_spat_df<-read.csv("2016_05_CoRR_qap_functional_spatial.csv")

id.vars=c('Participant','Site','Session','Series')

# reduce to just the columns that we are interested in
corr_func_spat_df<-corr_func_spat_df[c(id.vars,measure.vars.spat)]

corr_func_temp_df<-read.csv("2016_05_CORR_qap_functional_temporal.csv")


# reduce to just the columns that we are interested in
corr_func_temp_df<-corr_func_temp_df[c(id.vars, measure.vars.temp)]

# join the spatial and temporal measures
corr_func_df<-inner_join(corr_func_spat_df, corr_func_temp_df)


# reduce to just session_1 and anat_1 and remove rows with missing values
corr_func_df <- corr_func_df %>% 
                     filter(Session == "session_1" & Series == "rest_1") %>% 
                         droplevels() %>%
                             drop_na()

# make sure that participant is a factor
corr_func_df$Participant <- factor(corr_func_df$Participant)


# plots
qap_label_strings=c(Ghost_y='GSR',
                EFC='EFC',
                FBER='FBER',
                FWHM='Smoothness (FWHM)',
                SNR='SNR',
                Fraction.of.Outliers..Mean.='Mean % Outliers',
                GCOR='GCOR',
                Quality..Mean.='Mean Quality',
                RMSD..Mean.='Mean RMSD',
                Std..DVARS..Mean.="Mean Std. Dvars.")

# combine with parameters
corr_func_df <- inner_join(corr_func_df, corr_fmri_scan_params, by="Site")


summary(corr_func_df)


Joining, by = c("Participant", "Site", "Session", "Series")
Warning message in inner_join_impl(x, y, by$x, by$y, suffix$x, suffix$y):
“joining factors with different levels, coercing to character vector”
  Participant      Site                Session       Series         EFC        
 27223  :  2   Length:250         session_1:250   rest_1:250   Min.   :0.3816  
 27224  :  2   Class :character                                1st Qu.:0.4205  
 27225  :  2   Mode  :character                                Median :0.4585  
 27226  :  2                                                   Mean   :0.4688  
 27227  :  2                                                   3rd Qu.:0.5121  
 27228  :  2                                                   Max.   :0.6053  
 (Other):238                                                                   
      FBER            FWHM          Ghost_y               SNR        
 Min.   :12.78   Min.   :1.640   Min.   :-0.005613   Min.   : 8.536  
 1st Qu.:20.50   1st Qu.:1.873   1st Qu.: 0.018513   1st Qu.:10.925  
 Median :24.42   Median :1.976   Median : 0.023375   Median :12.022  
 Mean   :24.84   Mean   :1.972   Mean   : 0.025588   Mean   :12.180  
 3rd Qu.:27.83   3rd Qu.:2.084   3rd Qu.: 0.033225   3rd Qu.:13.481  
 Max.   :41.45   Max.   :2.395   Max.   : 0.057029   Max.   :16.213  
                                                                     
 Fraction.of.Outliers..Mean.      GCOR          Quality..Mean.   
 Min.   :0.0004811           Min.   :0.006252   Min.   :0.03215  
 1st Qu.:0.0012760           1st Qu.:0.023622   1st Qu.:0.05412  
 Median :0.0019885           Median :0.037393   Median :0.06585  
 Mean   :0.0025591           Mean   :0.041826   Mean   :0.07722  
 3rd Qu.:0.0028791           3rd Qu.:0.055916   3rd Qu.:0.08076  
 Max.   :0.0251615           Max.   :0.186937   Max.   :0.19548  
                                                                 
  RMSD..Mean.      Std..DVARS..Mean.             Scanner    AcquisitionDuration
 Min.   :0.01959   Min.   :0.8374    Siemens Allegra :  0   Min.   :304.0      
 1st Qu.:0.07940   1st Qu.:1.0840    Siemens Magentom:  0   1st Qu.:304.0      
 Median :0.10462   Median :1.1318    Siemens TrioTim :250   Median :380.0      
 Mean   :0.12470   Mean   :1.1387    Siemens Verio   :  0   Mean   :391.3      
 3rd Qu.:0.15174   3rd Qu.:1.1950                           3rd Qu.:500.0      
 Max.   :0.75317   Max.   :1.4773                           Max.   :604.0      
                                                                               
    EchoTime       RepetitionTime    FlipAngle      VoxelVolume   
 Min.   :0.02900   Min.   :1.750   Min.   :75.00   Min.   :27.00  
 1st Qu.:0.03000   1st Qu.:1.750   1st Qu.:90.00   1st Qu.:41.62  
 Median :0.03000   Median :2.000   Median :90.00   Median :50.54  
 Mean   :0.02982   Mean   :2.024   Mean   :87.36   Mean   :50.70  
 3rd Qu.:0.03000   3rd Qu.:2.000   3rd Qu.:90.00   3rd Qu.:64.00  
 Max.   :0.03000   Max.   :3.000   Max.   :90.00   Max.   :64.00  
                                                                  

5. Analyze!


In [217]:
# Combine the twodatasets into one large dataframe
qap_param_df<-bind_rows(abide_func_df,corr_func_spat_df)

# mean center all of the covariates
qap_param_df<-qap_param_df %>% mutate_if(is.numeric, funs(scale(., scale=TRUE)))


Warning message in bind_rows_(x, .id):
“Unequal factor levels: coercing to character”Warning message in bind_rows_(x, .id):
“Unequal factor levels: coercing to character”Warning message in bind_rows_(x, .id):
“Unequal factor levels: coercing to character”Warning message in bind_rows_(x, .id):
“Unequal factor levels: coercing to character”

In [203]:
qap_param_df


ParticipantSiteSessionSeriesEFCFBERFWHMGhost_ySNRFraction.of.Outliers..Mean.GCORQuality..Mean.RMSD..Mean.Std..DVARS..Mean.ScannerAcquisitionDurationEchoTimeRepetitionTimeFlipAngleVoxelVolume
50002 Pitt session_1 rest_1 1.47377133 -0.01385772 -0.50218953 0.998439378 -0.106669225 -0.8013943 -0.8698341 -0.89192640 -0.206601871 -0.13278639 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50003 Pitt session_1 rest_1 0.96379411 -0.01385759 -0.05448966 0.503054741 -0.085882238 -0.6937101 -0.8667884 -0.44974995 0.872790938 -0.69583159 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50004 Pitt session_1 rest_1 0.98154742 -0.01385721 -0.51973548 0.682490033 -0.077662417 1.8380488 -0.8161337 -0.53721653 -0.066484897 1.55996963 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50005 Pitt session_1 rest_1 0.63890681 -0.01385724 -0.37015482 -0.002368603 -0.061692146 -0.5915727 -0.8335101 -0.46933533 -0.040888296 0.28232800 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50006 Pitt session_1 rest_1 0.73697402 -0.01385682 0.53787150 0.984277246 -0.053682195 -0.5019714 -0.8414969 -0.41723312 -0.401070301 0.37218124 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50007 Pitt session_1 rest_1 1.40143283 -0.01385674 -0.63141636 1.026926411 -0.072152576 -0.6017484 -0.7469466 -0.58694522 0.103067537 -0.07545324 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50008 Pitt session_1 rest_1 0.86018776 -0.01385740 -0.37723387 1.006136805 -0.082103961 -0.6605079 -0.8076164 -0.46311233 0.261722150 -0.35515382 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50009 Pitt session_1 rest_1 1.23419488 -0.01385700 -0.04957923 0.878903439 -0.074574871 -0.4163302 -0.8634816 -0.71512284 0.274690903 1.04388777 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50010 Pitt session_1 rest_1 -0.30991437 -0.01385760 -0.03703717 0.323274884 -0.039454824 -0.7202115 -0.8782309 0.22924641 -0.128150630 0.44281621 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50011 Pitt session_1 rest_1 1.19405215 -0.01385642 -0.02354602 0.829860120 -0.042798309 -0.7503846 -0.8933540 -0.57634444 -0.431468666 0.28373556 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50012 Pitt session_1 rest_1 0.70407875 -0.01385711 0.26435140 0.815809373 -0.065787884 -0.7658580 -0.8064137 -0.27925660 -0.217761560 0.55552315 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50013 Pitt session_1 rest_1 0.31496256 -0.01385631 -0.36124593 0.217647060 -0.009204807 0.3766934 -0.7621772 -0.08723867 0.704647566 0.39965274 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50014 Pitt session_1 rest_1 0.67123947 -0.01385702 -0.43989643 0.359000754 -0.057334755 -0.7443789 -0.8829994 -0.15973703 -0.609424811 0.72737292 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50015 Pitt session_1 rest_1 0.81362419 -0.01385699 -0.08266336 0.633508101 -0.059571027 -0.6935396 -0.8923922 -0.36283465 -0.251322092 0.96761297 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50016 Pitt session_1 rest_1 1.46612480 -0.01385729 -0.48321617 1.109471814 -0.098585632 -0.7997158 -0.7766705 -0.77628914 -0.251846961 0.14352571 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50017 Pitt session_1 rest_1 0.88840873 -0.01385703 -0.39838484 0.880428788 -0.056970020 0.2698878 -0.6123143 -0.33444067 1.418329949 -1.00288064 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50019 Pitt session_1 rest_1 1.54134663 -0.01385717 -0.33771935 1.387009994 -0.088588343 -0.5726244 -0.8214756 -0.81329245 0.850808780 -0.10878396 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50020 Pitt session_1 rest_1 0.99666627 -0.01385773 -0.44143911 1.479845208 -0.104246407 -0.7539645 -0.8229772 -0.50541080 -0.190112017 -0.14183434 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50022 Pitt session_1 rest_1 1.00287914 -0.01385726 -0.30684188 1.087171444 -0.075766457 -0.6996634 -0.8257969 -0.55830851 -0.364137388 -0.07744888 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50023 Pitt session_1 rest_1 0.89364033 -0.01385666 0.13575087 0.502974050 -0.052884717 -0.7616225 -0.8375716 -0.36036623 0.003734441 -0.74386214 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50024 Pitt session_1 rest_1 0.76058201 -0.01385723 -0.33752220 1.152326666 -0.070114937 -0.8238307 -0.8564976 -0.53224905 -0.374809323 0.14625685 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50025 Pitt session_1 rest_1 0.38861918 -0.01385766 0.11851477 0.839652867 -0.079539968 -0.7994011 -0.8455701 -0.12666270 -0.262613125 -0.16507325 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50026 Pitt session_1 rest_1 1.10994299 -0.01385682 -0.22488373 1.067713441 -0.063827737 -0.6142714 -0.8022279 -0.59454054 1.442602235 0.83130354 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50027 Pitt session_1 rest_1 0.02997712 -0.01385711 -0.02443009 0.206652978 -0.027978169 1.1503097 -0.8520043 -0.01129054 -0.036807923 1.74299720 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50028 Pitt session_1 rest_1 1.01810731 -0.01385635 -0.30610022 0.667746399 -0.045571205 -0.7731751 -0.8350757 -0.46125310 0.540034059 0.50127990 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50029 Pitt session_1 rest_1 1.27509932 -0.01385638 -0.14429625 0.434440372 -0.051006203 -0.5808069 -0.8620241 -0.71145701 -0.315294339 0.89586773 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50030 Pitt session_1 rest_1 1.07964841 -0.01385719 -0.11947411 0.784909115 -0.082844255 -0.6225064 -0.8748255 -0.65315729 -0.347754845 1.14644864 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50031 Pitt session_1 rest_1 0.88091863 -0.01385619 -0.04285780 0.764703646 -0.038591163 -0.2321970 -0.7531877 -0.27001332 0.055441877 -0.76903600 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50032 Pitt session_1 rest_1 1.09351935 -0.01385762 -0.39304344 1.397394521 -0.103659711 -0.5796792 -0.8249763 -0.51498583 -0.475962095 0.04724877 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
50033 Pitt session_1 rest_1 0.54040586 -0.01385635 -0.45802789 0.242344683 -0.022357702 -0.1517224 -0.8006936 -0.24376685 -0.147426609 -0.22057167 Siemens Allegra-0.9600646 0.09596658 -1.353209 -1.093522 0.1186266
Utah_2 inputs session_8 rest_2 0.2034799 -0.01385748-0.5192216 0.1782764 -0.02772775NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_8 rest_10 0.2963627 -0.01385761-0.5784294 0.3771867 -0.03924971NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_7 rest_9 0.2582095 -0.01385764-0.4834700 0.3601600 -0.04371267NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_4 rest_3 0.1838652 -0.01385741-0.5395305 0.2423794 -0.01927100NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_4 rest_4 0.2014065 -0.01385744-0.5548045 0.2464655 -0.02137052NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_4 rest_10 0.2440474 -0.01385749-0.5663492 0.3551127 -0.02724815NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_4 rest_2 0.1843374 -0.01385740-0.5240405 0.2072688 -0.01762412NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_6 rest_6 0.2194030 -0.01385752-0.6783020 0.2345280 -0.03070614NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_7 rest_10 0.2751903 -0.01385765-0.4784914 0.4289167 -0.04517526NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_6 rest_8 0.2373737 -0.01385756-0.6544705 0.2754746 -0.03481657NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_6 rest_5 0.2081473 -0.01385751-0.6760945 0.2401260 -0.03027554NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_6 rest_9 0.2557583 -0.01385760-0.6508539 0.3173985 -0.03820308NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_6 rest_7 0.2372949 -0.01385758-0.6706744 0.2908671 -0.03618684NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_7 rest_1 0.1827074 -0.01385760-0.3617292 0.2815347 -0.04208606NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_7 rest_2 0.1956328 -0.01385758-0.3729827 0.2622145 -0.04016339NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_9 rest_6 0.2322327 -0.01385755-0.4860904 0.3399201 -0.03602327NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_9 rest_3 0.2089317 -0.01385746-0.4887958 0.2637202 -0.02617677NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_9 rest_10 0.2554239 -0.01385752-0.4473513 0.3390075 -0.03184792NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_9 rest_2 0.1908778 -0.01385743-0.4660445 0.2183020 -0.02336773NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_9 rest_4 0.2101153 -0.01385745-0.4928538 0.2295536 -0.02539458NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_9 rest_5 0.2215132 -0.01385748-0.4968555 0.2635289 -0.02737592NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_8 rest_5 0.2406012 -0.01385753-0.5705106 0.2125670 -0.03339904NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_9 rest_1 0.1820791 -0.01385738-0.4784628 0.2053223 -0.01823922NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_8 rest_6 0.2558931 -0.01385755-0.5826659 0.2422283 -0.03475998NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_8 rest_7 0.2659792 -0.01385756-0.5748880 0.2693916 -0.03463819NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_8 rest_8 0.2700603 -0.01385756-0.5487268 0.2822499 -0.03565386NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_8 rest_9 0.2848573 -0.01385760-0.5664244 0.3500945 -0.03841471NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_9 rest_8 0.2448178 -0.01385754-0.5099595 0.3624368 -0.03478574NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_9 rest_7 0.2456663 -0.01385752-0.5036376 0.3226885 -0.03216605NA NA NA NA NA NA NA NA NA NA NA
Utah_2 inputs session_9 rest_9 0.2518989 -0.01385753-0.4672469 0.3471674 -0.03195428NA NA NA NA NA NA NA NA NA NA NA

In [218]:
meas_stats=data.frame()
measure.vars=c(measure.vars.spat, measure.vars.temp)
for ( meas in measure.vars ){
    print(meas)
    full_formula=as.formula(
        sprintf("%s ~ 0 + Scanner + EchoTime + RepetitionTime + FlipAngle + VoxelVolume",
                  meas))
    reduced_formula=as.formula(
        sprintf("%s ~ 0 + EchoTime + RepetitionTime + FlipAngle + VoxelVolume",
                  meas))
    full_model<-lm(full_formula, qap_param_df)
    reduced_model<-lm(reduced_formula, qap_param_df)
    scanner_f=anova(full_model,reduced_model)
    all_t=summary(full_model)
    
    meas_stats <- rbind(meas_stats,
                       data.frame(Measure=meas,
                          covariate="Scanner",
                          stat=scanner_f$F[2],
                          val_p=scanner_f[2,"Pr(>F)"]))
    
    for( covariate in c('EchoTime', 'RepetitionTime', 'FlipAngle', 'VoxelVolume')){
            meas_stats <- rbind(meas_stats,
                       data.frame(Measure=meas,
                          covariate=covariate,
                          stat=all_t$coefficients[covariate,'t value'],
                          val_p=all_t$coefficients[covariate,'Pr(>|t|)']))
    }
    
}

meas_stats$val_p <- p.adjust(meas_stats$val_p, "BH")
# smri_qap_param_model_red<-lm(SNR ~ 0 + EchoTime + InversionTime + 
#                                RepetitionTime + FlipAngle + VoxelVolume,
#                                qap_param_df)
# # summary(smri_qap_param_model)
# # anova(smri_qap_param_model,smri_qap_param_model_red)


[1] "EFC"
[1] "FBER"
[1] "FWHM"
[1] "Ghost_y"
[1] "SNR"
[1] "Fraction.of.Outliers..Mean."
[1] "GCOR"
[1] "Quality..Mean."
[1] "RMSD..Mean."
[1] "Std..DVARS..Mean."

In [219]:
meas_stats = meas_stats %>% 
    gather(mes, value, -Measure, -covariate) %>% 
        mutate( cov_stat = paste(covariate, mes, sep="_")) %>% 
            dplyr::select(Measure, cov_stat, value) %>%
                spread(cov_stat, value)

In [220]:
meas_stats %>% tbl_df()


MeasureEchoTime_statEchoTime_val_pFlipAngle_statFlipAngle_val_pRepetitionTime_statRepetitionTime_val_pScanner_statScanner_val_pVoxelVolume_statVoxelVolume_val_p
EFC 13.754052 1.336055e-37 -5.849484 1.232003e-08 8.1936891 2.491276e-15 1.122550e+02 2.221127e-58 -22.28261186 3.845292e-82
FBER -2.374903 2.073021e-02 2.821346 6.150967e-03 4.0078408 9.713840e-05 1.432801e+11 0.000000e+00 1.62235385 1.168753e-01
FWHM -18.526318 1.261025e-61 -23.785381 1.570914e-90 10.1849640 2.322621e-22 1.961074e+02 1.438225e-90 3.21937860 1.724780e-03
Ghost_y 20.155494 1.936884e-70 -15.891455 5.526106e-48 1.3293640 1.959260e-01 1.959804e+01 6.020816e-12 -11.23322263 1.597880e-26
SNR -7.773324 5.399918e-14 10.040259 7.979241e-22 -2.8084838 6.243073e-03 5.675585e+01 2.980316e-32 12.85361307 1.779466e-33
Fraction.of.Outliers..Mean. -6.096606 3.015487e-09 -9.029344 3.934606e-18 5.7713006 1.862566e-08 2.230548e+01 1.602586e-13 0.01060031 9.915454e-01
GCOR -40.923330 9.450498e-185 -21.346374 5.624446e-77 4.6209551 6.915883e-06 5.362295e+01 1.202523e-30 9.05759315 3.271965e-18
Quality..Mean. -17.737224 1.639631e-57 10.706646 2.137059e-24 -3.2194972 1.724780e-03 8.412095e+01 1.005625e-45 8.19350390 2.491276e-15
RMSD..Mean. 4.552246 9.235782e-06 -1.868116 7.065066e-02 -0.8316739 4.227946e-01 7.526710e-01 5.316464e-01 -3.93379190 1.279674e-04
Std..DVARS..Mean. 9.005337 4.577658e-18 6.491042 2.821079e-10 1.5146860 1.416448e-01 3.467936e+00 1.897236e-02 3.25330524 1.617185e-03

In [222]:
print(xtable(meas_stats, digits=3, display=c('s','s','g','g','g','g','g','g','g','g','g','g')))


% latex table generated in R 3.3.2 by xtable 1.8-2 package
% Mon Mar 27 16:24:47 2017
\begin{table}[ht]
\centering
\begin{tabular}{rlrrrrrrrrrr}
  \hline
 & Measure & EchoTime\_stat & EchoTime\_val\_p & FlipAngle\_stat & FlipAngle\_val\_p & RepetitionTime\_stat & RepetitionTime\_val\_p & Scanner\_stat & Scanner\_val\_p & VoxelVolume\_stat & VoxelVolume\_val\_p \\ 
  \hline
1 & EFC & 13.8 & 1.34e-37 & -5.85 & 1.23e-08 & 8.19 & 2.49e-15 &  112 & 2.22e-58 & -22.3 & 3.85e-82 \\ 
  2 & FBER & -2.37 & 0.0207 & 2.82 & 0.00615 & 4.01 & 9.71e-05 & 1.43e+11 &    0 & 1.62 & 0.117 \\ 
  3 & FWHM & -18.5 & 1.26e-61 & -23.8 & 1.57e-90 & 10.2 & 2.32e-22 &  196 & 1.44e-90 & 3.22 & 0.00172 \\ 
  4 & Ghost\_y & 20.2 & 1.94e-70 & -15.9 & 5.53e-48 & 1.33 & 0.196 & 19.6 & 6.02e-12 & -11.2 & 1.6e-26 \\ 
  5 & SNR & -7.77 & 5.4e-14 &   10 & 7.98e-22 & -2.81 & 0.00624 & 56.8 & 2.98e-32 & 12.9 & 1.78e-33 \\ 
  6 & Fraction.of.Outliers..Mean. & -6.1 & 3.02e-09 & -9.03 & 3.93e-18 & 5.77 & 1.86e-08 & 22.3 & 1.6e-13 & 0.0106 & 0.992 \\ 
  7 & GCOR & -40.9 & 9.45e-185 & -21.3 & 5.62e-77 & 4.62 & 6.92e-06 & 53.6 & 1.2e-30 & 9.06 & 3.27e-18 \\ 
  8 & Quality..Mean. & -17.7 & 1.64e-57 & 10.7 & 2.14e-24 & -3.22 & 0.00172 & 84.1 & 1.01e-45 & 8.19 & 2.49e-15 \\ 
  9 & RMSD..Mean. & 4.55 & 9.24e-06 & -1.87 & 0.0707 & -0.832 & 0.423 & 0.753 & 0.532 & -3.93 & 0.000128 \\ 
  10 & Std..DVARS..Mean. & 9.01 & 4.58e-18 & 6.49 & 2.82e-10 & 1.51 & 0.142 & 3.47 & 0.019 & 3.25 & 0.00162 \\ 
   \hline
\end{tabular}
\end{table}