Learn R Programming

neurobase (version 1.32.4)

checknii-methods: Force object to filename with .nii extension

Description

Ensures the output to be a character filename (or vector) from an input image or nifti, but not gzipped and has .nii extension

Usage

checknii(file, ...)

# S4 method for nifti checknii(file, ...)

# S4 method for factor checknii(file, ...)

# S4 method for character checknii(file, ...)

# S4 method for list checknii(file, ...)

# S4 method for ANY checknii(file, ...)

ensure_nii(file, ...)

Value

character filename of image or temporary nii, with .nii extension

Arguments

file

character or nifti object

...

options passed to checkimg

Author

John Muschelli muschellij2@gmail.com

Examples

Run this code
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 = checknii
func(nim)
func(rnifti)
func(timg)
func(limg)

Run the code above in your browser using DataLab