check_nifti_header-methods: Check if nifti image or read in a nifti header

Description Usage Arguments Value Author(s) Examples

Description

Simple check to see if input is character or of class nifti and read in the header

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
check_nifti_header(x)

## S4 method for signature 'nifti'
check_nifti_header(x)

## S4 method for signature 'character'
check_nifti_header(x)

## S4 method for signature 'factor'
check_nifti_header(x)

## S4 method for signature 'list'
check_nifti_header(x)

## S4 method for signature 'array'
check_nifti_header(x)

## S4 method for signature 'anlz'
check_nifti_header(x)

## S4 method for signature 'ANY'
check_nifti_header(x)

Arguments

x

character path of image or an object of class nifti, or array

Value

nifti object or character

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, 4)
arr = array(rpois(prod(dims), lambda = 2), dim = dims)
nim = oro.nifti::nifti(arr)
check_nifti_header(nim)
check_nifti_header(as.anlz(nim))
testthat::expect_error(check_nifti_header(arr))
tfile = tempimg(nim)
check_nifti_header(tfile)
check_nifti_header(RNifti::readNifti(tfile))
check_nifti_header(c(tfile, tfile))
check_nifti_header(list(tfile, tfile))
check_nifti_header(factor(tfile))

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