rpi_orient | R Documentation |
This function uses fslswapdim
to reorient an image
rpi_orient(file, verbose = TRUE)
rpi_orient_file(file, verbose = TRUE)
is_rpi(file, verbose = FALSE)
is.rpi(file, verbose = FALSE)
file |
Object of class |
verbose |
print diagnostic messages |
List of 3 elements
img
: Reoriented image of class nifti
convention
: Convention (Neurological/Radiological) of original image
orientation
: Original image orientations
'orient_rpi' and 'orient_rpi_file' uses 'RNifti' to ensure the reading orientation
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))
## Not run:
if (have_fsl()) {
reor = rpi_orient(rl_fname)
rev = reverse_rpi_orient(reor$img, convention = reor$convention,
orientation = reor$orientation)
stopifnot(all(rev == rl_img))
}
## End(Not run)
reor = orient_rpi(rl_fname)
stopifnot(all(img == reor$img))
rev = reverse_orient_rpi(reor$img, convention = reor$convention,
orientation = reor$orientation)
stopifnot(all(rev == rl_img))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.