if (FALSE) {
url <- "http://nifti.nimh.nih.gov/nifti-1/data/avg152T1_LR_nifti.nii.gz"
urlfile <- file.path(system.file("nifti", package="oro.nifti"),
"mniLR.nii.gz")
download.file(url, urlfile, quiet=TRUE)
}
urlfile <- file.path(system.file("nifti", package="oro.nifti"),
"mniLR.nii.gz")
mniLR <- readNIfTI(urlfile)
cal.max(mniLR)
file = system.file("extdata", "example.nii.gz", package = "RNifti")
img = RNifti::readNifti(file)
cal.max(img)
cal_max(img)
cal.max(img) = 2500
stopifnot(cal_max(img) == 2500)
cal_max(img) = 2500
cal.min(img)
cal.min(img) = 2
stopifnot(cal_min(img) == 2)
cal_min(img)
cal_min(img) = 0
stopifnot(cal_min(img) == 0)
Run the code above in your browser using DataLab