mri_mask: Use Freesurfers MRI Mask

Description Usage Arguments Value Examples

View source: R/mri_mask.R

Description

This function calls mri_mask to mask an image

Usage

1
mri_mask(file, mask, outfile = NULL, retimg = TRUE, opts = "", ...)

Arguments

file

(character) input filename

mask

(character) mask filename

outfile

(character) output filename

retimg

(logical) return image of class nifti

opts

(character) additional options to mri_mask

...

additional arguments passed to fs_cmd.

Value

Character or nifti depending on retimg

Examples

1
2
3
4
5
if (have_fs() && requireNamespace("oro.nifti", quietly = TRUE)) {
   img = oro.nifti::nifti(array(rnorm(5*5*5), dim = c(5,5,5)))  
   mask = img > 1
   res = mri_mask(img, mask)
}

Example output



freesurfer documentation built on Dec. 9, 2020, 1:07 a.m.