ensure_array: Ensure an array output

View source: R/ensure_array.R

ensure_arrayR Documentation

Ensure an array output

Description

Forces an array output for manipulation and overall conversion

Usage

ensure_array(img)

Arguments

img

Image object (nifti or niftiImage)

Value

Array of same dimensions as image object

Examples

set.seed(5)
dims = rep(10, 3)
arr = array(rnorm(prod(dims)), dim = dims)
arr[,,10] = 0
nim = oro.nifti::nifti(arr)
rnifti = RNifti::asNifti(nim)
timg = tempimg(nim)
limg = list(factor(timg), factor(timg))
func = ensure_array
func(arr)
func(nim)
func(rnifti)
func(timg)
func(limg[[1]])

neurobase documentation built on May 29, 2024, 2:17 a.m.