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

checknii-methodsR Documentation

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 signature 'nifti'
checknii(file, ...)

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

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

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

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

ensure_nii(file, ...)

Arguments

file

character or nifti object

...

options passed to checkimg

Value

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

Author(s)

John Muschelli muschellij2@gmail.com

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

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