R/read_gifti2matrix.R

Defines functions read_gifti2matrix

Documented in read_gifti2matrix

#' Reads a gifti image and reshapes to matrix.
#'
#' A short wrapper for gifti::read_gifti().
#'
#' @param name name of .gii file to read
#' @keywords AFNI, neuroimaging, gifti
#' @export
read_gifti2matrix  <- function(name){

  d <- gifti::read_gifti(name)$data

  matrix(unlist(d, use.names = FALSE), nrow = length(d), byrow = TRUE)  ## (use.names == FALSE for speed)

}
mcfreund/mikeutils documentation built on May 27, 2021, 5:46 a.m.