ReshapedNiftiArraySeed: Virtually reshaped Nifti images as DelayedArray objects

Description Usage Arguments Value Examples

View source: R/zzz_ReshapedNiftiArray-class.R

Description

Virtually reshaped Nifti images as DelayedArray objects

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
ReshapedNiftiArraySeed(
  filepath,
  name = "image",
  header_name = "hdr",
  dim,
  type = NA,
  header = NULL,
  chunkdim = NULL
)

ReshapedNiftiArray(
  filepath,
  name = "image",
  header_name = "hdr",
  dim,
  type = NA,
  header = NULL,
  chunkdim = NULL
)

Arguments

filepath

The path (as a single character string) to the NIfTI or HDF5 file where the dataset is located. If a path to the NIfTI is provided we call RNifti::readNifti() and NiftiArray::writeNiftiArray() to convert to the HDF5 and more memory and time are used. If a path to a HDF5 file the data is simply loaded into R as an object of class NiftiArray. A path to the HDF5 file is more memory and time efficient.

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.

dim

A vector of dimensions that describes the virtual reshaping i.e. the reshaping that is virtually applied upfront to the HDF5 dataset when the ReshapedHDF5Array object gets constructed. See HDF5Array::ReshapedHDF5Array.

type

NA or the R atomic type, passed to HDF5Array::HDF5Array() corresponding to the type of the HDF5 dataset. Default is set to NA. Unless you want different types of HDF5 storage files there is no need to change default settings.

header

List of NIfTI header information to override call of nifti_header.

chunkdim

the reshaped dimensions of chunks.

Value

An object of class ReshapedNiftiArraySeed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
nii_fname = system.file("extdata",
                        "example.nii.gz", package = "RNifti")
res = NiftiArray::NiftiArray(nii_fname)
dim(res) = c(dim(res), 1)
res = writeNiftiArray(res)
A <- ReshapedNiftiArray(
  filepath = res@seed@filepath,
  name = res@seed@name,
  header_name = res@seed@header_name,
  dim=c(prod(dim(res)[1:3]), 1))

neuroconductor/NiftiArray documentation built on May 23, 2021, 8:40 a.m.