Reading NIfTI images through RNifti
This function calls the readNifti function from the
RNifti package, and then converts the image to a nifti object
fast_readnii(fname, dtype = TRUE, drop_dim = TRUE)
fname |
file name of the NIfTI file. |
dtype |
Should |
drop_dim |
Should |
A nifti object
set.seed(5) dims = rep(10, 4) arr = array(rpois(prod(dims), lambda = 2), dim = dims) nim = oro.nifti::nifti(arr) tfile = tempfile(fileext = ".nii.gz") write_nifti(nim, tfile) rimg = fast_readnii(tfile)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.