Comparing/averaging parcellations

I have followed the instructions here to create a brain parcellation.
If I did this for 4 subjects, how could I compare/average the resulting four parcellations?

let’s say I have

sub01_kmeans_labels_img
sub02_kmeans_labels_img
sub03_kmeans_labels_img
sub04_kmeans_labels_img

and the parcellations differ slightly. How can I create a parcellation map representative of my entire sample? Is this possible?

Hi,
I think that you need to clarify your main goal. Of course, data-driven parcellations are subject to important variability, both due to data noise and algorithmic aspects. It is actually quite hard to establish that a parcellation is good.

If you really want to quantify parcellation variability, you may resort to tools such as adjusted Rand index or normalized mutual information.
https://scikit-learn.org/stable/modules/generated/sklearn.metrics.adjusted_rand_score.html
https://scikit-learn.org/stable/modules/generated/sklearn.metrics.normalized_mutual_info_score.html

If you want to create a unique parcellation that represents 4 datasets, simply input the concatenated datasets (i.e. simply a list) to the parcellation method.

Does that answer you question ?
Best,

Thank you for your reply @bthirion. Let’s say I’d like to parcellate the thalamus, and have subject-specific masks of the thalamus.
My first thought was to do:

masks = ['/home/data/sub01_thalamus.nii.gz', '/home/data/sub02_thalamus.nii.gz']
func = ['/home/data/sub01_func.nii.gz', '/home/data/sub02_func.nii.gz']
ward = Parcellations(method='ward', n_parcels=50, mask=masks)
ward.fit(func)

but this doesn’t work as it seems mask takes a single volume

DimensionError: Input data has incompatible dimensionality:
Expected dimension is 3D and you provided a list of 3D images (4D)