Compute functional connectivity from parcellated BOLD timeseries
Source:R/compute_fc.R
compute_fc.RdEstimates a ROI-to-ROI functional connectivity matrix from a parcellated BOLD timeseries using Pearson correlation (default) or partial correlation. Returns both the full symmetric matrix and a tidy long-format data frame.
Usage
compute_fc(parcellated, method = c("pearson", "partial"), fisher_z = TRUE)Arguments
- parcellated
A
boldr_parcellatedobject fromparcellate().- method
Character. Connectivity metric. One of:
"pearson"(Default) Pearson product-moment correlation.
"partial"Partial correlation (requires
corpcorin Suggests).
- fisher_z
Logical. Whether to apply Fisher r-to-z transformation before returning values. Default
TRUE. Diagonal is set toNA.
Value
A list of class boldr_fc with components:
- matrix
Numeric matrix (n_rois × n_rois). Symmetric FC matrix with
NAon the diagonal.- long
Data frame (long format). Columns:
roi_i,roi_j,roi_name_i,roi_name_j,fc.- method
Character. Connectivity method used.
- fisher_z
Logical. Whether Fisher z was applied.
- atlas_name
Character. Atlas identifier.
Examples
if (FALSE) { # \dontrun{
parc <- parcellate(cleaned, atlas)
fc <- compute_fc(parc)
dim(fc$matrix)
head(fc$long)
} # }