mri_synthstrip: Use Freesurfers MRI SynthStrip

View source: R/mri_synthstrip.R

mri_synthstripR Documentation

Use Freesurfers MRI SynthStrip

Description

This function calls mri_mask to mask an image

Usage

mri_synthstrip(
  file,
  outfile = NULL,
  retimg = TRUE,
  maskfile = NULL,
  opts = "",
  ...
)

synthstrip(
  file,
  outfile = NULL,
  retimg = TRUE,
  maskfile = NULL,
  opts = "",
  ...
)

Arguments

file

(character) input filename

outfile

(character) output filename

retimg

(logical) return image of class nifti

maskfile

(character) path for mask output

opts

(character) additional options to mri_mask

...

additional arguments passed to fs_cmd.

Value

Character or nifti depending on retimg

Examples

if (have_fs() && requireNamespace("oro.nifti", quietly = TRUE)) {
   img = oro.nifti::nifti(array(rnorm(5*5*5), dim = c(5,5,5)))  
   res = mri_synthstrip(img)
}

freesurfer documentation built on June 8, 2025, 10:17 a.m.