R/mris_convert_normals.R

Defines functions mris_convert_normals

Documented in mris_convert_normals

#' @title Convert Surface to Surface normals
#' @description This function call \code{mris_convert}, 
#' using the \code{-n} option
#' @param opts (character) additional options to 
#' \code{\link{mris_convert}}
#' @param ... additional arguments to \code{\link{mris_convert}}
#' 
#' @return Result of \code{\link{mris_convert}}
#' @export
#' @examples 
#' if (have_fs()) {
#'  bert_dir = file.path(fs_subj_dir(), "bert")
#'  asc_file = mris_convert_normals(
#'  infile = file.path(bert_dir, "surf", "lh.white")
#'  )  
#' readLines(asc_file, n = 6)
#' }   
mris_convert_normals = function(
  opts = "",
  ...
){
  
  ######################################################    
  # Making output file if not specified
  ######################################################      
  opts = paste(opts, collapse = " ")
  opts = paste0(opts, " ", "-n ")
  outfile = mris_convert(..., opts = opts)
  return(outfile)
}

Try the freesurfer package in your browser

Any scripts or data that you put into this service are public.

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