Skip to content

Instantly share code, notes, and snippets.

@Jfortin1
Created August 23, 2016 18:43
Show Gist options
  • Save Jfortin1/ee99cc459fba0d22570e4894da2bec2c to your computer and use it in GitHub Desktop.
Save Jfortin1/ee99cc459fba0d22570e4894da2bec2c to your computer and use it in GitHub Desktop.
getMNITemplatePath <- function(what=c("full", "brain", "brain_mask"), res=c("1mm", "2mm")){
require(fslr)
dir <- file.path(fsl_data_dir(), "standard")
what <- match.arg(what)
res <- match.arg(res)
if (what == "full") {
file <- file.path(dir, paste0("MNI152_T1_",res,".nii.gz"))
}
else if (what == "brain") {
file <- file.path(dir, paste0("MNI152_T1_",res,"_brain.nii.gz"))
}
else if (what == "brain_mask") {
file <- file.path(dir, paste0("MNI152_T1_",res,"_brain_mask.nii.gz"))
}
file
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment