# NOT RUN {
mnit1 <- antsImageRead(getANTsRData('mni'))
mask <- getMask(mnit1)
ilist <- list()
for (i in 1:10) {
ilist <- lappend(ilist, antsImageClone(mnit1) * rnorm(1))
}
response <- rnorm(10)
imat <- imageListToMatrix(ilist, mask)
residuals <- matrix(nrow = nrow(imat), ncol = ncol(imat))
tvals <- matrix(nrow = nrow(imat), ncol = ncol(imat))
for (i in 1:ncol(imat)) {
fit <- lm(response ~ imat[, i])
tvals <- coefficients(fit)[2]
residuals[, i] <- residuals(fit)
}
myfwhm <- estSmooth(residuals, mask, fit$df.residual)
res <- resels(mask, myfwhm$fwhm)
timg <- makeImage(mask, tvals)
# threshold to create peak values with p-value of .05 (default)
results1 <- rftResults(timg, res, myfwhm$fwhm, df, fieldType = "T",
threshType = "pRFT", pval = .05)
# threshold to create clusters with p-value of .05
results2 <- rftResults(timg, res, myfwhm$fwhm, df, fieldType = "T",
threshType = "cRFT", pval = .05)
# initial threshold at p-value of .001 followed by peak FDR threshTypeold at
# p-value of .05
results3 <- rftResults(timg, res, myfwhm$fwhm, df, fieldType = "T",
threshType = "pFDR", pval = .05, pp=.01)
# initial threshold at p-value of .001 followed by cluster FDR threshold at
# p-value of .05
results4 <- rftResults(timg, res, myfwhm$fwhm, df, fieldType = "T",
threshType = "cFDR", pval = .05, pp = .01)
# correcting for non-isotropic
results5 <- rftResults(timg, res, myfwhm$fwhm, df, fieldType = "T",
fwhm$RPVImg)
# }
Run the code above in your browser using DataLab