Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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 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

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))

neurobase

'Neuroconductor' Base Package with Helper Functions for 'nifti' Objects

v1.32.1
GPL-2
Authors
John Muschelli [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.