fname = system.file("nifti", "mniRL.nii.gz",
package = "oro.nifti")
img = readNIfTI(fname)
oimg = origin(img)
stopifnot(all(oimg == c(-90, -126, -72)))
zero_img = img
origin(zero_img) = rep(0, 3)
stopifnot(all(origin(zero_img) == 0))
Run the code above in your browser using DataLab