Create a matrix that compute the average value for each parcel.
parc_mean_mat(parc)
The parcellation matrix
A single-column "dlabel" "xifti"
object.
From a single-column "dlabel" "xifti"
object, make a \(K \times V\)
matrix where row \(k\) is a vector corresponding to the kth Key value,
with \(1/k_i\) at locations with that key value, and \(0\) elsewhere.
\(k_i\) is the total number of locations inside Key \(k\).
So, the sum of each row will be \(1\), and each column will only
have exactly one non-zero value (because each location only has one Key
value) except medial wall locations will have all zeroes.
Multiplying the result of parc_mean_mat
with a \(V \times T\) matrix
of timeseries data, e.g. from as.matrix(dlabel_xii)
, will yield the
average value for each Key.