Description Usage Arguments Value Examples
View source: R/writeNiftiArray.R
A function for writing NIfTI objects on disk to a specifically formatted HDF5 file. The HDF5 file will include a group for the NIfTI image or array and the NIfTI header.
1 2 3 4 5 6 7 8 9 10 11 12 |
x |
A |
filepath |
The file path (single character string) of where to save the HDF5
file converted from the NIfTI input as |
name |
The name of the group for the NIfTI image in the HDF5 file. Default is set to "image". Unless you have to other "image" groups in the HDF5 file there is no need to change default settings. |
header_name |
The name of the group for the NIfTI header in the HDF5 file. Default is set to "header". Unless you have to other "header" groups in the HDF5 file there is no need to change default settings. |
chunkdim |
The dimensions of the chunks to use for writing the data to disk. Passed to HDF5Array::writeHDF5Array. |
level |
The compression level, passed to HDF5Array::writeHDF5Array. |
verbose |
Display progress, passed to HDF5Array::writeHDF5Array. |
header |
List of header information; overrides call of nifti_header. |
overwrite |
|
extendible |
Should a single empty dimension be added to the array? Currently necessary for easy reshaping. |
A NiftiArray
object.
1 2 3 4 5 6 7 8 9 10 11 | nii_fname = system.file("extdata", "example.nii.gz", package = "RNifti")
res = writeNiftiArray(nii_fname)
filepath = tempfile(fileext = ".h5")
res = writeNiftiArray(nii_fname, filepath = filepath)
testthat::expect_error(
writeNiftiArray(nii_fname, filepath = filepath),
regexp = "already exist",
)
res = writeNiftiArray(nii_fname, filepath = filepath, overwrite = TRUE)
img = RNifti::readNifti(nii_fname)
writeNiftiArray(c(img), header = nifti_header(img))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.