readrpi: Read NIfTI file reoriented to RPI

Description Usage Arguments Note Examples

View source: R/readrpi.R

Description

This function calls the readnii function after calling rpi_orient_file to force RPI orientation.

Usage

1
2
3
readrpi(file, ..., verbose = TRUE)

readrpi2(file, ..., verbose = TRUE)

Arguments

file

file name of the NIfTI file.

...

Arguments to pass to readnii

verbose

print diagnostics, passed to rpi_orient_file

Note

'readrpi2' uses 'RNifti' to ensure the reading orientation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
if (have.fsl()){
print(fsl_version())
in_ci <- function() {
 nzchar(Sys.getenv("CI"))
 }
 if (in_ci()) {
 destfile = tempfile(fileext = ".nii.gz")
 url = paste0("https://ndownloader.figshare.com/", 
 "files/18068546")
 old_url = paste0("https://github.com/muschellij2/", 
 "Neurohacking/files/3454385/113-01-MPRAGE2.nii.gz")
 dl = tryCatch(download.file(url,
 destfile = destfile))
 if (inherits(dl, "try-error") || dl != 0) {
 dl = download.file(old_url, destfile = destfile)
 }
 res = readrpi(destfile)
 }
 }   

neuroconductor-devel/fslr documentation built on May 6, 2021, 1:44 p.m.