rpi_orient: Reorient an Image to RPI orientation

Description Usage Arguments Value Note Examples

View source: R/rpi_orient.R

Description

This function uses fslswapdim to reorient an image

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
rpi_orient(file, verbose = TRUE)

rpi_orient_file(file, verbose = TRUE)

rpi_orient_file2(file, verbose = TRUE)

rpi_orient2(file, verbose = TRUE)

is_rpi(file, verbose = FALSE)

is.rpi(file, verbose = FALSE)

Arguments

file

Object of class nifti or character path

verbose

print diagnostic messages

Value

List of 3 elements

Note

'rpi_orient2' and 'rpi_orient_file2' uses 'RNifti' to ensure the reading orientation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
if (have_fsl()) {
lr_fname = system.file( "nifti", "mniLR.nii.gz", package = "oro.nifti")
img = readnii(lr_fname)

rl_fname = system.file( "nifti", "mniRL.nii.gz", package = "oro.nifti")
rl_img = readnii(rl_fname)
stopifnot(all(rl_img[nrow(rl_img):1,,] == img))

reor = rpi_orient(rl_fname)
rev = reverse_rpi_orient(reor$img, convention = reor$convention,
orientation = reor$orientation)
stopifnot(all(rev == rl_img))



}

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