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

Description Usage Arguments Value Author(s) Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)

neuroconductor/neurobase documentation built on May 19, 2021, 5:24 a.m.