Skip to contents

Writes a single parcellated/clustered scan to an HDF5 file. Unlike write_parcellated_experiment_h5 which creates a multi-scan container, this function creates a file optimized for a single scan.

Usage

write_parcellated_scan_h5(
  filepath,
  mask,
  clusters,
  scan_data,
  scan_name = "scan_001",
  data_type = c("summary", "full"),
  scan_metadata = list(),
  cluster_metadata = NULL,
  compress = TRUE,
  verbose = FALSE
)

Arguments

filepath

Path to the output HDF5 file

mask

A LogicalNeuroVol object defining the brain mask

clusters

A ClusteredNeuroVol object defining the parcellation

scan_data

Either a named list (for full data) or matrix (for summary data): - For full data: list with cluster names as keys, each containing a voxels x time matrix - For summary data: time x clusters matrix

scan_name

Name for the scan (default: "scan_001")

data_type

Type of data: "full" for voxel-level, "summary" for cluster means

scan_metadata

Optional list of metadata for the scan

cluster_metadata

Optional data.frame with cluster information

compress

Logical, whether to compress the data (default: TRUE)

verbose

Logical, whether to print progress messages (default: FALSE)

Value

An H5ParcellatedScanSummary or H5ParcellatedScan object