nifti | R Documentation |
nifti
: create a nifti object from input\n
as.nifti
: converts input to become a nifti object\n
is.nifti
: checks if input is a nifti object
nifti(x, header=NULL, dim=NULL) as.nifti(x, header=NULL) is.nifti(x)
x |
a vector, matrix, or array for |
header |
a list with the header attributes |
dim |
dimensions of input |
A nifti
object is an array with an additional header slot.
When the header
argument is missing or NULL
, a list is created
with all supported header attributes set to NULL
except for dim which
is set to the dim of x
.
nifti
object for nifti
and as.nifti
\n
TRUE
or FALSE
for is.nifti
Zarrar Shehzad
as.nifti-methods
nim <- nifti(0, list(dim=c(10,10,10))) # creates a 10x10x10 nifti object with values 0 tmp <- read.nifti(file.path(system.file("data", package="niftir"), "test.nii.gz")) x <- array(0, c(10,10,10)) nim <- nifti(x, header(tmp)) # OR even better nim <- as.nifti(x, header(tmp)) # both create a 10x10x10 nifti object with header from tmp is.nifti(nim) # should be TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.