Creates a new H5ClusterRunSummary
object, representing a single run of
summary cluster time-series data from an HDF5 file.
This function handles file opening/closing, validates the summary dataset,
determines n_time
from the dataset dimensions, and reconciles cluster names/IDs.
Arguments
- file
Character string path to the HDF5 file.
- scan_name
The character string name of the scan (e.g., "run1").
- mask
A
LogicalNeuroVol
object for the brain mask (used for reference/consistency).- clusters
(Optional) A
ClusteredNeuroVol
object for cluster assignments. IfNULL
, cluster names/IDs must be provided or derivable from the dataset.- cluster_names
(Optional) Character vector of names for the clusters.
- cluster_ids
(Optional) Integer vector of IDs for the clusters.
- summary_dset
(Optional) The name of the dataset within the run's summary group (default: "summary_data").
Examples
if (FALSE) { # \dontrun{
# Create temporary HDF5 file with minimal experiment structure
temp_file <- tempfile(fileext = ".h5")
exp_file <- fmristore:::create_minimal_h5_for_H5ClusterExperiment(file_path = temp_file)
# Create mask
mask <- fmristore:::create_minimal_LogicalNeuroVol(dims = c(5, 5, 4))
# Create H5ClusterRunSummary object
run_summary <- H5ClusterRunSummary(exp_file, scan_name = "Run2_Summary", mask = mask)
# Access properties
print(run_summary@cluster_names)
print(run_summary@n_time)
# Clean up
close(run_summary)
unlink(temp_file)
} # }