The Cerebellar Probabilistic Parcellation project implements the analyses underlying the paper "A Hierarchical Atlas of the human cerebellum for functional precision mapping", by Nettekoven et al. 2024.
Diedrichsenlab/HierarchicalBayesParcel Diedrichsenlab/FunctionalFusion Diedrichsenlab/DCBC Diedrichsenlab/cortico_cereb_connectivity
Other dependencies:
see requirements.txt
Atlas was estimated using:
scripts/fit_atlas.py
Single dataset parcellations (Fig 1a)
single_parcellations.ipynb
Symmetric & asymmetric atlas (Fig 2a, 2b & 2c)
atlas_flatmaps.ipynb
Plotting MDS plots for different single dataset parcellations (Fig 1B & 1C & 1D) & Statistics for between-dataset ARI (similarity; normalized to within-dataset ARI) between all datasets and the task-general (MDTB) and rest-based (HCP) data:
notebooks/evaluate_mds.ipynb
The data underlying Figure 3c comparing the dataset reliabilities can be found in:
data/reliability.tsv
Plotting DCBC & Statistics DCBC (Fig 1E & 1F):
notebooks/evaluate_dcbc.ipynb
The data underlying Figure 3d comparing the dataset similarities to the MDTB and HCP dataset can be found in:
data/similarity.tsv
The data underlying Figure 3e comparing the performance of single dataset parcellations to the fused parcellations can be found in:
data/evaluation_dcbc_single.tsv
data/evaluation_dcbc_fusion.tsv
Comparison of existing atlasses to fusion
notebooks/evaluate_existing.ipynb
Plotting symmetry (boundary and functional symmetry, i.e. functional lateralization) and comparing asymmetric and symmetric atlas versions:
notebooks/symmetry.ipynb
Statistics on DCBC of 68 regions vs 40 regions in individual DCBC (Fig 1F):
notebooks/evaluate_dcbc.ipynb
Dendrogram (Fig 2D):
scripts/dendrogram.py
Some manual adjustments had to be made on the produced figure, because the internal ordering of the leaves within a domain is randomly generated by the dendrogram plotting algorithm (for example M4a and M4b are ordered M4b, M4a).
The parcels are reordered according to their functional profiles using the reorder_model
function in hierarchical_clustering
. Clustering of the 68 subregions into 32 regions (medium) and 4 domains (coarse) is then performed on the reordered model using the function cluster_parcel
in hierarchical_clustering.py
. Both functions are called by the function reorder_models
in scripts/parcel_hierarchy.py
.
The order of regions went through several rounds of revisions, with all rounds documented in the reorder_models
function.
Characterizing regions based on functional responses in the MDTB dataset over and above motor responses is done by estimating a linear model using ridge regression (L2 regularization) with the motor features (left hand presses, right hand presses & saccades) and task condition indicators as the design matrix. The feature model is run using:
scripts/feature_model.py
which calls the ridgeFit
function in:
scripts/ridge_reg.py
The motor, action, demand and social-linguistic-spatial regions are described in individual notebooks using all datasets and the MDTB feature model:
Motor regions
notebooks/motor.ipynb
(Fig S1)
Action regions
notebooks/action.ipynb
Demand regions
notebooks/demand.ipynb
Sociolinguistic regions
notebooks/social.ipynb
Probabilistic maps:
function export_all_probmaps
in export_atlas.py
(Fig S2a)
Region sizes:
notebooks/size_comparison.ipynb
(Fig S2b & S2)
Volumetric atlas view:
notebooks/atlas_volume.ipynb
(Fig S3)
Localizing individual regions
notebooks/task_differences.ipynb
(Fig S4)
Cortical connectivity models are estimated and evaluated in the repository
diedrichsenlab/cortico_cereb_connectivity
denoted ccc
for short.
Models were trained evaluated ccc.run_model
, which is called from ccc.scripts.script_train_eval_models.py
Models are then fused (i.e. simply averaged) using ccc.scripts.script_fuse_models.py
- Model 4: Demand, HCP and MDTB
- Model 5: all datasets including HCP
- Model 6: all datasets excluding HCP
- Model 7: all datasets excluding HCP and Somatotopic
The final model evaluation results reported in the paper can be found in ccc.notebooks.Evaluate_model_int.ipynb
.
The final model weights that show the connectivity weights for each region of the 32 cerebellar regions, i.e. the connectivity weights reported in the paper, can be found in the data
folder as a pscalar file. The cortical connectivity weights are given in Icosahedron1002 parcels. The model is the average model from all datasets excluding HCP.
data/Nettekoven_2024_Fusion_L2.pscalar.nii
:
To summarize the connectivity pattern by cerebellar regions:
import cortico_cereb_connectivity.scripts.script_summarize_weights as csw
csw.make_weight_map('Fusion','06',method='L2Regression')
To summarize further by cortical ROI:
T = csw.make_weight_table(dataset="Fusion",extension="06",cortical_roi="")
Summary figures (by MSHBM_Prior_15_fsLR32)
notebooks/cortical_connectivity.ipynb
The data underlying Figure 3b can be found in:
diedrichsenlab/cortico_cereb_connectivity/data/Nettekoven2024_model_evaluations.tsv
Full connectivity maps:
notebooks/connectivity_weights.ipynb
(Fig S5 & Fig S6)
Size comparison of left and right regions (voxel-wise) of the asymmetric atlas (Fig S8)
notebooks/size_comparison.ipynb
To get individual parcellations (previously saved as pytorch tensor to save
time) run the following script:
scripts.individual_variability.export_uhats(model_name)
Which Calls:
evaluate.get_individual_parcellation(model_name)
Plotting the individual parcellations: (Fig 5A):
notebooks/individual_parcellation.ipynb
Calculating and plotting individual variability (Fig 5B):
notebooks/individual_variability.ipynb
which calls:
scripts.individual_variability.calc_variability(Data, Info, subject_wise=False):
Plotting probability maps for parcels (Fig 5C):
notebooks/individual_group.ipynb
plot.plot_parcel_prob
Comparing group and individual parcellations with varying length of data (Fig 5D & 5E):
notebooks/individual_group.ipynb
export_atlas.export_map
takes a marginal probabilitiy of a arrangement model and generates the probseg and dseg to save in the ProbabilisticParcellationModel/Atlases directory.
The final step is to take the 2mm atlas in MNISymC2 space and resample it to 1mm isotropic in SUIT, MNIAsym and MNISym spaces defined in the FunctionalFusion/Atlases
directory. The reslicing is done on the probseg.nii
files and then a new dseg.nii
file is computed.
scripts.export_atlas_script.py
which calls
export_atlas.resample_atlas('NettekovenSym32','MNISymC2','MNI152NLin2009cSymC')
The files are then copied for inclusion into the cerebellar_atlases
repository by hand.
The spatial subdivision of the atlas is then produced in each atlas space seperately - in the final 1mm space.
subdivde_atlas_spatial(fname='NettekovenSym32',atlas='SUIT',outname='NettekovenSym128')
The comparison with the existing MDTB parcellation can be found in (Figure 1 in response to comment 1 from reviewer 1):
notebooks/mdtb_comparison.ipynb
The entropy calculation for each dataset can be found in (Figure 2 in response to comment 2 from reviewer 1):
notebooks/mdtb_comparison.ipynb