Learn R Programming

freesurfer (version 1.6.10)

mri_deface: MRI Deface

Description

This calls Freesurfer's mri_deface

Usage

mri_deface(file, brain_template = NULL, face_template = NULL, ...)

Value

Result of fs_cmd, which type depends on arguments to ...

Arguments

file

File to pass to mri_deface

brain_template

gca brain template file to pass to mri_deface

face_template

gca face template file to pass to mri_deface

...

Additional arguments to pass to fs_cmd

Examples

Run this code
# \donttest{
if (have_fs()){
   base_url = "https://surfer.nmr.mgh.harvard.edu/pub/dist/mri_deface"
   url = file.path(base_url, "sample_T1_input.mgz")
   x = tempfile(fileext = ".mgz")
   out = try({
   utils::download.file(url, destfile = x)
   })
   if (!inherits(out, "try-error")) {
      noface = mri_deface(x)
   } else {
      url = paste0(
         "https://raw.githubusercontent.com/muschellij2/kirby21.t1/master/", 
         "inst/visit_1/113/113-01-T1.nii.gz")
      x = tempfile(fileext = ".nii.gz")
      out = try({
          utils::download.file(url, destfile = x)
      })
      noface = mri_deface(x)
   }
}
# }

Run the code above in your browser using DataLab