Learn R Programming

neurobase (version 1.32.4)

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

Description

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

Usage

check_nifti_header(x)

# S4 method for nifti check_nifti_header(x)

# S4 method for character check_nifti_header(x)

# S4 method for factor check_nifti_header(x)

# S4 method for list check_nifti_header(x)

# S4 method for array check_nifti_header(x)

# S4 method for anlz check_nifti_header(x)

# S4 method for ANY check_nifti_header(x)

Value

nifti object or character

Arguments

x

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

Author

John Muschelli muschellij2@gmail.com

Examples

Run this code
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))

Run the code above in your browser using DataLab