Skip to content

Instantly share code, notes, and snippets.

@muschellij2
Created May 31, 2017 14:32
Show Gist options
  • Save muschellij2/b9db141d9ccb5f148d19c6f94edcd797 to your computer and use it in GitHub Desktop.
Save muschellij2/b9db141d9ccb5f148d19c6f94edcd797 to your computer and use it in GitHub Desktop.
Quick reading in of an Image
have_package = function(x) {
x %in% installed.packages()
}
if (!have_package("neurobase")) {
install.packages("neurobase")
}
library(neurobase)
fname = "training01_01_mprage.nii.gz"
if (!file.exists(fname)) {
fname = file.choose()
}
img = readnii(fname)
ortho2(img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment