Skip to contents

Save searchlight results to disk (S3 generic)

Usage

save_results(
  x,
  dir,
  level = c("standard", "minimal", "complete"),
  stack = c("none", "auto", "vec"),
  fname = "searchlight.nii.gz",
  include = NULL,
  dtype = NULL,
  overwrite = FALSE,
  quiet = FALSE
)

Arguments

x

A result object (e.g., `searchlight_result`, list of NeuroVols, etc.)

dir

Directory to write into (created if needed)

level

One of "minimal", "standard", "complete" - minimal: maps only - standard: maps + manifest (default) - complete: maps + manifest + tables + aux (if present)

stack

One of c("none","auto","vec"). - "none": Write individual NIfTI files for each metric (default) - "auto": Stack into 4D if all maps are compatible, otherwise individual files - "vec": Force stacking into one 4D NIfTI file

fname

Base filename when writing a 4D file (default "searchlight.nii.gz") Only used when stack="vec" or stack="auto" with compatible volumes

include

Character vector of extras to include; subset of c("manifest","tables","aux"). `level` sets sensible defaults.

dtype

Optional data_type for neuroim2 write_* (e.g., "FLOAT","DOUBLE")

overwrite

Logical; if FALSE and a target exists, stop.

quiet

Logical; suppress messages.

Value

(invisible) a list describing what was written.