R/utils.R

Defines functions print.maf_df format.maf_df read_formats write_formats

write_formats <- function() {
  c("vtk", "vtp", "fds")
}

read_formats <- function() {
  c(write_formats(), "tck", "trk")
}

format.maf_df <- function(x, ...) {
  n <- length(unique(x$StreamlineId))
  cli::cli_alert_info("Set of {n} fascicles.")
  dist_npts <- sapply(1:n, function(.x) sum(x$StreamlineId == .x))
  cli::cli_alert_info("Distribution of the number of sampled points per fascicles: {summary(dist_npts)}.")
}

print.maf_df <- function(x, ...) {
  cat(format(x, ...), "\n")
}

Try the riot package in your browser

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

riot documentation built on Jan. 7, 2023, 1:12 a.m.