Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fast_readnii

Reading NIfTI images through RNifti


Description

This function calls the readNifti function from the RNifti package, and then converts the image to a nifti object

Usage

fast_readnii(fname, dtype = TRUE, drop_dim = TRUE)

Arguments

fname

file name of the NIfTI file.

dtype

Should datatyper be run after reading?

drop_dim

Should drop_img_dim be run after reading?

Value

A nifti object

Examples

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)

neurobase

'Neuroconductor' Base Package with Helper Functions for 'nifti' Objects

v1.32.1
GPL-2
Authors
John Muschelli [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.