NiftiArrayList: Write Multiple NiftiArray Objects into a List

Description Usage Arguments Value Examples

View source: R/NiftiArrayList.R

Description

Reads multiple NiftiArray objects into elements of a list. TODO: Add more detail based on BUG fix.

Usage

1
NiftiArrayList(x, ..., verbose = FALSE)

Arguments

x

a character or list of objects to be called with writeNiftiArray

...

additional arguments to pass to NiftiArray

verbose

show progress bars if pbapply package installed.

Value

A list of class NiftiArrayList, which is a list if NiftiArray objects

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
nii_fname = system.file("extdata",
"example.nii.gz", package = "RNifti")
nii_fname = rep(nii_fname, 3)
res = NiftiArrayList(nii_fname)
if (requireNamespace("pbapply", quietly = TRUE)) {
   res = NiftiArrayList(nii_fname, verbose = TRUE)
} else {
   testthat::expect_warning({
   res = NiftiArrayList(nii_fname, verbose = TRUE)
   })
}
testthat::expect_is(res, "NiftiArrayList")
mat = as(res, "NiftiMatrix")
arr = as(res, "NiftiArray")
h5 = unlist(DelayedArray::seedApply(res, slot, "filepath"))
res2 = NiftiArrayList(h5)
testthat::expect_is(res2, "NiftiArrayList")
mat = as(res2, "NiftiMatrix")
arr = as(res2, "NiftiArray")

neuroconductor-releases/NiftiArray documentation built on Nov. 14, 2020, 11:54 p.m.