Skip to contents

Write a 4d image vector to disk

Usage

write_vec(x, file_name, format, data_type, ...)

# S4 method for LatentNeuroVec,character,missing,missing
write_vec(x, file_name, nbit = FALSE, compression = 9, chunk_dim = NULL)

# S4 method for ROIVec,character,missing,missing
write_vec(x, file_name)

# S4 method for NeuroVec,character,missing,missing
write_vec(x, file_name)

# S4 method for NeuroVec,character,character,missing
write_vec(
  x,
  file_name,
  format,
  nbit = FALSE,
  compression = 5,
  chunk_dim = c(10, 10, 10, dim(x)[4])
)

# S4 method for NeuroVec,character,missing,character
write_vec(x, file_name, data_type)

Arguments

x

an image object, typically a NeuroVec instance.

file_name

output file name.

format

file format string. Since "NIFTI" is the only currently supported format, this parameter can be safely ignored and omitted.

data_type

the numeric data type. If specified should be a character vector of: "BINARY", "UBYTE", "SHORT", "INT", "FLOAT", "DOUBLE". Otherwise output format will be inferred from R the datatype of the image.

...

extra args

nbit

set nbit compression

compression

compression level 1 to 9

chunk_dim

the dimensions of each chunk

Examples


bvec <- NeuroVec(array(0, c(10,10,10,10)), NeuroSpace(c(10,10,10,10), c(1,1,1)))
if (FALSE) {
write_vec(bvol, "out.nii")
write_vec(bvol, "out.nii.gz")
write_vec(bvec, "out.nii")
write_vec(bvec, "out.nii.gz")
}