R/big_neurovec.R

Defines functions BigNeuroVec

#' @keywords internal
#' @noRd
BigNeuroVec <- function(data, space, mask,type = c("double", "float", "integer"), backingfile=tempfile()) {
  type <- match.arg(type)
  stopifnot(inherits(space, "NeuroSpace"))

  p <- prep_sparsenvec(data, space, mask)

  fbm <- bigstatsr::as_FBM(p$data, type=type, backingfile=backingfile)

  new("BigNeuroVec", space=p$space, mask=p$mask,
      map=IndexLookupVol(space(p$mask), as.integer(which(p$mask))), data=fbm)

}
bbuchsbaum/neuroim2 documentation built on Nov. 3, 2024, 9:31 a.m.