Multimodal multicentre investigation of diagnostic and prognostic markers in disorders of consciousness.
The 4 matches
- [1] § Results › Feature importance differs in diagnostic and prognostic models ↔ modeling/01_efm_model-results.py, lines 108–165 · score 0.82 · symbolic mutual information, permutation entropy, Kolmogorov complexity, half brain, EEG RS, beta
- [2] § Results › Feature importance differs in diagnostic and prognostic models ↔ modeling/07_auc_ci_per_feature.py, lines 209–245 · score 0.77 · symbolic mutual information, permutation entropy, Kolmogorov complexity, EEG RS, beta, evoked
- [3] § Results › Feature importance differs in diagnostic and prognostic models ↔ fmri_markers/fmri_functions.py, lines 217–324 · score 0.64 · connectivity features, subcortical areas, subcortical regions, limbic, volume, network
- [4] § Results › Multimodal integration improves predictive accuracy ↔ modeling/06_efm_model_outputs_and_surrogates_plots_generalization.py, lines 60–113 · score 0.53 · Mann Whitney, Bonferroni corrected, Balanced accuracy, model, modalities
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 1,276 lines · 58 KB · no license · 1 match
- #%%
- import seaborn as sns
- import pandas as pd
- import matplotlib.pyplot as plt
- import numpy as np
- import os
- import seaborn as sns
- import nibabel as nib
- from nilearn import datasets
- from nilearn.datasets import fetch_atlas_harvard_oxford
- from nilearn import plotting
- from pdf2image import convert_from_path
- # %%
- base_path = '/home/Documents/codes/permed'
- efm_figs_dir = os.path.join(base_path, '00_derivatives/model_outputs/EarlyFusionMultimodal/figs')
- surrogates_analysis = False
- clinical_prediction = 'diagnosis' # '6m1y2y-prognosis' # 'diagnosis'
- name_ext=f'single-mods_allmod-per-patient_norfe_rskf_{clinical_prediction}_RandomForestClassifier'
- if clinical_prediction == '6m1y2y-prognosis': name_ext = name_ext + '_no-lata'
- if surrogates_analysis: name_ext = f'{name_ext}_surrogates'
- metric = 'balanced_accuracy'
- df_efm= pd.read_csv(os.path.join(base_path,
- f'00_derivatives/model_outputs/EarlyFusionMultimodal/csvs/efm_{name_ext}_folds-500.csv'))
- df_efm_fi = pd.read_csv(os.path.join(base_path,
- f'00_derivatives/model_outputs/EarlyFusionMultimodal/csvs/efm_feat-importances_{name_ext}_folds-500.csv'))
- df_efm_fi.set_index('Unnamed: 0', inplace=True)
- # %%
- eeg_rs_features = list(np.load(os.path.join(base_path, '00_derivatives/intermediate/eeg_rs_features.npy'), allow_pickle=True))
- eeg_lg_features = list(np.load(os.path.join(base_path, '00_derivatives/intermediate/eeg_lg_features.npy'), allow_pickle=True))
- anat_features = list(np.load(os.path.join(base_path, '00_derivatives/intermediate/anat_features.npy'), allow_pickle=True))[1:]
- func_rs_features = list(np.load(os.path.join(base_path, '00_derivatives/intermediate/func_rs_features.npy'), allow_pickle=True))[1:]
- dti_features = list(np.load(os.path.join(base_path, '00_derivatives/intermediate/dti_features.npy'), allow_pickle=True))
- pet_features = list(np.load(os.path.join(base_path, '00_derivatives/intermediate/pet_features.npy'), allow_pickle=True))
- # %%
- df_efm
- # in df_efm create a column with the difference between the accuracy and balanced accuracy and plot the violin plot
- df_efm['diff_acc_bal_acc'] = df_efm['accuracy'] - df_efm['balanced_accuracy']
- df_efm['diff_acc_bal_acc'].describe()
- # %%
- sns.set_theme()
- sns.set_context("paper")
- sns.set_style("white")
- metric = 'auc' # 'auc' 'balanced_accuracy'
- # %%
- # Separate the feature importances per modality
- # From df_efm_fi keep only the rows that have /rs/ in the index name, and eeg_rs in the column name
- fi_eeg_rs = df_efm_fi[df_efm_fi.index.str.contains('/rs/')]
- fi_eeg_rs = fi_eeg_rs[fi_eeg_rs.columns[fi_eeg_rs.columns.str.contains('eeg_rs')]]
- fi_eeg_lg = df_efm_fi[df_efm_fi.index.str.contains('/lg/')]
- fi_eeg_lg = fi_eeg_lg[fi_eeg_lg.columns[fi_eeg_lg.columns.str.contains('eeg_lg')]]
- fi_anat = df_efm_fi[df_efm_fi.index.str.contains('anat_')]
- fi_anat = fi_anat[fi_anat.columns[fi_anat.columns.str.contains('anat')]]
- fi_func = df_efm_fi[df_efm_fi.index.str.contains('func-')]
- fi_func = fi_func[fi_func.columns[fi_func.columns.str.contains('func')]]
- fi_dti = df_efm_fi[df_efm_fi.index.str.contains('maskJHU')]
- fi_dti = fi_dti.append(df_efm_fi[df_efm_fi.index.str.contains('fa_global')])
- fi_dti = fi_dti.append(df_efm_fi[df_efm_fi.index.str.contains('md_global')])
- fi_dti = fi_dti[fi_dti.columns[fi_dti.columns.str.contains('dti')]]
- fi_pet = df_efm_fi[df_efm_fi.index.str.contains('pet_')]
- fi_pet = fi_pet[fi_pet.columns[fi_pet.columns.str.contains('pet')]]
- # %%
- fi_eeg_rs_mean_std = fi_eeg_rs.copy().apply(lambda x: pd.Series({"mean":x.mean(),"std":x.std()}), axis = 1)
- fi_eeg_rs_mean_std_sorted = fi_eeg_rs_mean_std.sort_values(by='mean', ascending=False, inplace=False)
- fi_eeg_lg_mean_std = fi_eeg_lg.copy().apply(lambda x: pd.Series({"mean":x.mean(),"std":x.std()}), axis = 1)
- fi_eeg_lg_mean_std_sorted = fi_eeg_lg_mean_std.sort_values(by='mean', ascending=False, inplace=False)
- fi_anat_mean_std = fi_anat.copy().apply(lambda x: pd.Series({"mean":x.mean(),"std":x.std()}), axis = 1)
- fi_anat_mean_std_sorted = fi_anat_mean_std.sort_values(by='mean', ascending=False, inplace=False)
- fi_func_mean_std = fi_func.copy().apply(lambda x: pd.Series({"mean":x.mean(),"std":x.std()}), axis = 1)
- fi_func_mean_std_sorted = fi_func_mean_std.sort_values(by='mean', ascending=False, inplace=False)
- fi_dti_mean_std = fi_dti.copy().apply(lambda x: pd.Series({"mean":x.mean(),"std":x.std()}), axis = 1)
- fi_dti_mean_std_sorted = fi_dti_mean_std.sort_values(by='mean', ascending=False, inplace=False)
- fi_pet_mean_std = fi_pet.copy().apply(lambda x: pd.Series({"mean":x.mean(),"std":x.std()}), axis = 1)
- fi_pet_mean_std_sorted = fi_pet_mean_std.sort_values(by='mean', ascending=False, inplace=False)
- # Summarizing feat importances per cortical networks and subcortical
- # or by conceptual families etc
- sns.set_context("talk")
- plot_feature_groups = True
- if plot_feature_groups:
- nets = ['Cont', 'Default', 'DorsAttn', 'Limbic', 'SalVentAttn', 'SomMot', 'Vis']
- ###### DISTRIBUTIONS
- # aMRI
- anat = fi_anat_mean_std['mean'].to_frame()
- # Add the 'region_groups' column
- anat['region_groups'] = anat.index.to_series().apply(
- lambda x: next((net for net in nets if net in x), 'Subcortical' if any(sub in x for sub in ['stem', 'left', 'right']) else 'Other')
- )
- # pet
- pet = fi_pet_mean_std['mean'].to_frame()
- # Add the 'region_groups' column
- pet['region_groups'] = pet.index.to_series().apply(
- lambda x: next((net for net in nets if net in x), 'Subcortical' if any(sub in x for sub in ['Stem', 'Left', 'Right']) else 'Other')
- )
- # add the value 'Half Brain' in the column region_groups for the features that contain 'high_mi' or 'low_mi'
- pet.loc[pet.index.str.contains('high_mi|low_mi'), 'region_groups'] = 'Half Brain'
- # func
- func = fi_func_mean_std['mean'].to_frame()
- def assign_region_group(x):
- if any(sub in x for sub in ['subcortical', 'Left', 'Right', 'Stem']):
- return 'Subcortical'
- elif 'sub-to-cort' in x:
- return 'Subcortical to Cortical'
- else:
- return next((net for net in nets if net in x), 'Other')
- func['region_groups'] = func.index.to_series().apply(assign_region_group)
- # EEG RS
- # 3 divisions (code in the 021_efm_model-results.py)
- # 5 divisions
- eeg_rs = fi_eeg_rs_mean_std['mean'].to_frame()
- def assign_region_group(x):
- if 'PowerSpectralDensity' in x:
- if any(sub in x for sub in ['delta', 'theta', 'alpha']):
- return 'Spectral: Low'
- elif any(sub in x for sub in ['beta', 'gamma']):
- return 'Spectral: High'
- else:
- return 'Spectral: Other'
- elif 'SymbolicMutualInformation' in x:
- return 'Connectivity'
- elif any(sub in x for sub in ['KolmogorovComplexity', 'PermutationEntropy']):
- return 'Information theory'
- else:
- return 'Other'
- eeg_rs['region_groups'] = eeg_rs.index.to_series().apply(assign_region_group)
- # EEG LG
- eeg_lg = fi_eeg_lg_mean_std['mean'].to_frame()
- def assign_region_group(x):
- if 'PowerSpectralDensity' in x:
- if any(sub in x for sub in ['delta', 'theta', 'alpha']):
- return 'Spectral: Low'
- elif any(sub in x for sub in ['beta', 'gamma']):
- return 'Spectral: High'
- else:
- return 'Spectral: Other'
- elif 'SymbolicMutualInformation' in x:
- return 'Connectivity'
- elif any(sub in x for sub in ['KolmogorovComplexity', 'PermutationEntropy']):
- return 'Information theory'
- elif any(sub in x for sub in ['TimeLockedTopography', 'TimeLockedContrast', 'ContingentNegativeVariation', 'WindowDecoding']):
- return 'Evoked'
- else:
- return 'Other'
- eeg_lg['region_groups'] = eeg_lg.index.to_series().apply(assign_region_group)
- # DTI
- dti = fi_dti_mean_std['mean'].to_frame()
- region_dict = {
- "maskJHU_FA_1_MCP": "Brainstem",
- "maskJHU_FA_2_PCT": "Brainstem",
- "maskJHU_FA_3_gCC": "Commissural fibers",
- "maskJHU_FA_4_bCC": "Commissural fibers",
- "maskJHU_FA_5_sCC": "Commissural fibers",
- "maskJHU_FA_7_CST_R": "Brainstem",
- "maskJHU_FA_8_CST_L": "Brainstem",
- "maskJHU_FA_9_mLEM_R": "Brainstem",
- "maskJHU_FA_10_mLEM_L": "Brainstem",
- "maskJHU_FA_11_ICP_R": "Brainstem",
- "maskJHU_FA_12_ICP_L": "Brainstem",
- "maskJHU_FA_13_SCP_R": "Brainstem",
- "maskJHU_FA_14_SCP_L": "Brainstem",
- "maskJHU_FA_15_CP_R": "Projection fibers",
- "maskJHU_FA_16_CP_L": "Projection fibers",
- "maskJHU_FA_17_ALIC_R": "Projection fibers",
- "maskJHU_FA_18_ALIC_L": "Projection fibers",
- "maskJHU_FA_19_PLIC_R": "Projection fibers",
- "maskJHU_FA_20_PLIC_L": "Projection fibers",
- "maskJHU_FA_21_RLIC_R": "Projection fibers",
- "maskJHU_FA_22_RLIC_L": "Projection fibers",
- "maskJHU_FA_23_ACR_R": "Projection fibers",
- "maskJHU_FA_24_ACR_L": "Projection fibers",
- "maskJHU_FA_25_SCR_R": "Projection fibers",
- "maskJHU_FA_26_SCR_L": "Projection fibers",
- "maskJHU_FA_27_PCR_R": "Projection fibers",
- "maskJHU_FA_28_PCR_L": "Projection fibers",
- "maskJHU_FA_29_PTR_R": "Projection fibers",
- "maskJHU_FA_30_PTR_L": "Projection fibers",
- "maskJHU_FA_31_ILF_IFOF_R": "Associative fibers",
- "maskJHU_FA_32_ILF_IFOF_L": "Associative fibers",
- "maskJHU_FA_33_EC_R": "Associative fibers",
- "maskJHU_FA_34_EC_L": "Associative fibers",
- "maskJHU_FA_35_Cing_R": "Associative fibers",
- "maskJHU_FA_36_Cing_L": "Associative fibers",
- "maskJHU_FA_37_Cing_h_R": "Associative fibers",
- "maskJHU_FA_38_Cing_h_L": "Associative fibers",
- "maskJHU_FA_41_SLF_R": "Associative fibers",
- "maskJHU_FA_42_SLF_L": "Associative fibers",
- "maskJHU_FA_43_SFOF_R": "Associative fibers",
- "maskJHU_FA_44_SFOF_L": "Associative fibers",
- "maskJHU_FA_45_UNC_R": "Associative fibers",
- "maskJHU_FA_46_UNC_L": "Associative fibers",
- "maskJHU_MD_1_MCP": "Brainstem",
- "maskJHU_MD_2_PCT": "Brainstem",
- "maskJHU_MD_3_gCC": "Commissural fibers",
- "maskJHU_MD_4_bCC": "Commissural fibers",
- "maskJHU_MD_5_sCC": "Commissural fibers",
- "maskJHU_MD_7_CST_R": "Brainstem",
- "maskJHU_MD_8_CST_L": "Brainstem",
- "maskJHU_MD_9_mLEM_R": "Brainstem",
- "maskJHU_MD_10_mLEM_L": "Brainstem",
- "maskJHU_MD_11_ICP_R": "Brainstem",
- "maskJHU_MD_12_ICP_L": "Brainstem",
- "maskJHU_MD_13_SCP_R": "Brainstem",
- "maskJHU_MD_14_SCP_L": "Brainstem",
- "maskJHU_MD_15_CP_R": "Projection fibers",
- "maskJHU_MD_16_CP_L": "Projection fibers",
- "maskJHU_MD_17_ALIC_R": "Projection fibers",
- "maskJHU_MD_18_ALIC_L": "Projection fibers",
- "maskJHU_MD_19_PLIC_R": "Projection fibers",
- "maskJHU_MD_20_PLIC_L": "Projection fibers",
- "maskJHU_MD_21_RLIC_R": "Projection fibers",
- "maskJHU_MD_22_RLIC_L": "Projection fibers",
- "maskJHU_MD_23_ACR_R": "Projection fibers",
- "maskJHU_MD_24_ACR_L": "Projection fibers",
- "maskJHU_MD_25_SCR_R": "Projection fibers",
- "maskJHU_MD_26_SCR_L": "Projection fibers",
- "maskJHU_MD_27_PCR_R": "Projection fibers",
- "maskJHU_MD_28_PCR_L": "Projection fibers",
- "maskJHU_MD_29_PTR_R": "Projection fibers",
- "maskJHU_MD_30_PTR_L": "Projection fibers",
- "maskJHU_MD_31_ILF_IFOF_R": "Associative fibers",
- "maskJHU_MD_32_ILF_IFOF_L": "Associative fibers",
- "maskJHU_MD_33_EC_R": "Associative fibers",
- "maskJHU_MD_34_EC_L": "Associative fibers",
- "maskJHU_MD_35_Cing_R": "Associative fibers",
- "maskJHU_MD_36_Cing_L": "Associative fibers",
- "maskJHU_MD_37_Cing_h_R": "Associative fibers",
- "maskJHU_MD_38_Cing_h_L": "Associative fibers",
- "maskJHU_MD_41_SLF_R": "Associative fibers",
- "maskJHU_MD_42_SLF_L": "Associative fibers",
- "maskJHU_MD_43_SFOF_R": "Associative fibers",
- "maskJHU_MD_44_SFOF_L": "Associative fibers",
- "maskJHU_MD_45_UNC_R": "Associative fibers",
- "maskJHU_MD_46_UNC_L": "Associative fibers",
- "fa_global": "Global",
- "md_global": "Global"
- }
- region_dict_split = {
- "maskJHU_FA_1_MCP": "FA Brainstem",
- "maskJHU_FA_2_PCT": "FA Brainstem",
- "maskJHU_FA_3_gCC": "FA Commissural fibers",
- "maskJHU_FA_4_bCC": "FA Commissural fibers",
- "maskJHU_FA_5_sCC": "FA Commissural fibers",
- "maskJHU_FA_7_CST_R": "FA Brainstem",
- "maskJHU_FA_8_CST_L": "FA Brainstem",
- "maskJHU_FA_9_mLEM_R": "FA Brainstem",
- "maskJHU_FA_10_mLEM_L": "FA Brainstem",
- "maskJHU_FA_11_ICP_R": "FA Brainstem",
- "maskJHU_FA_12_ICP_L": "FA Brainstem",
- "maskJHU_FA_13_SCP_R": "FA Brainstem",
- "maskJHU_FA_14_SCP_L": "FA Brainstem",
- "maskJHU_FA_15_CP_R": "FA Projection fibers",
- "maskJHU_FA_16_CP_L": "FA Projection fibers",
- "maskJHU_FA_17_ALIC_R": "FA Projection fibers",
- "maskJHU_FA_18_ALIC_L": "FA Projection fibers",
- "maskJHU_FA_19_PLIC_R": "FA Projection fibers",
- "maskJHU_FA_20_PLIC_L": "FA Projection fibers",
- "maskJHU_FA_21_RLIC_R": "FA Projection fibers",
- "maskJHU_FA_22_RLIC_L": "FA Projection fibers",
- "maskJHU_FA_23_ACR_R": "FA Projection fibers",
- "maskJHU_FA_24_ACR_L": "FA Projection fibers",
- "maskJHU_FA_25_SCR_R": "FA Projection fibers",
- "maskJHU_FA_26_SCR_L": "FA Projection fibers",
- "maskJHU_FA_27_PCR_R": "FA Projection fibers",
- "maskJHU_FA_28_PCR_L": "FA Projection fibers",
- "maskJHU_FA_29_PTR_R": "FA Projection fibers",
- "maskJHU_FA_30_PTR_L": "FA Projection fibers",
- "maskJHU_FA_31_ILF_IFOF_R": "FA Associative fibers",
- "maskJHU_FA_32_ILF_IFOF_L": "FA Associative fibers",
- "maskJHU_FA_33_EC_R": "FA Associative fibers",
- "maskJHU_FA_34_EC_L": "FA Associative fibers",
- "maskJHU_FA_35_Cing_R": "FA Associative fibers",
- "maskJHU_FA_36_Cing_L": "FA Associative fibers",
- "maskJHU_FA_37_Cing_h_R": "FA Associative fibers",
- "maskJHU_FA_38_Cing_h_L": "FA Associative fibers",
- "maskJHU_FA_41_SLF_R": "FA Associative fibers",
- "maskJHU_FA_42_SLF_L": "FA Associative fibers",
- "maskJHU_FA_43_SFOF_R": "FA Associative fibers",
- "maskJHU_FA_44_SFOF_L": "FA Associative fibers",
- "maskJHU_FA_45_UNC_R": "FA Associative fibers",
- "maskJHU_FA_46_UNC_L": "FA Associative fibers",
- "maskJHU_MD_1_MCP": "MD Brainstem",
- "maskJHU_MD_2_PCT": "MD Brainstem",
- "maskJHU_MD_3_gCC": "MD Commissural fibers",
- "maskJHU_MD_4_bCC": "MD Commissural fibers",
- "maskJHU_MD_5_sCC": "MD Commissural fibers",
- "maskJHU_MD_7_CST_R": "MD Brainstem",
- "maskJHU_MD_8_CST_L": "MD Brainstem",
- "maskJHU_MD_9_mLEM_R": "MD Brainstem",
- "maskJHU_MD_10_mLEM_L": "MD Brainstem",
- "maskJHU_MD_11_ICP_R": "MD Brainstem",
- "maskJHU_MD_12_ICP_L": "MD Brainstem",
- "maskJHU_MD_13_SCP_R": "MD Brainstem",
- "maskJHU_MD_14_SCP_L": "MD Brainstem",
- "maskJHU_MD_15_CP_R": "MD Projection fibers",
- "maskJHU_MD_16_CP_L": "MD Projection fibers",
- "maskJHU_MD_17_ALIC_R": "MD Projection fibers",
- "maskJHU_MD_18_ALIC_L": "MD Projection fibers",
- "maskJHU_MD_19_PLIC_R": "MD Projection fibers",
- "maskJHU_MD_20_PLIC_L": "MD Projection fibers",
- "maskJHU_MD_21_RLIC_R": "MD Projection fibers",
- "maskJHU_MD_22_RLIC_L": "MD Projection fibers",
- "maskJHU_MD_23_ACR_R": "MD Projection fibers",
- "maskJHU_MD_24_ACR_L": "MD Projection fibers",
- "maskJHU_MD_25_SCR_R": "MD Projection fibers",
- "maskJHU_MD_26_SCR_L": "MD Projection fibers",
- "maskJHU_MD_27_PCR_R": "MD Projection fibers",
- "maskJHU_MD_28_PCR_L": "MD Projection fibers",
- "maskJHU_MD_29_PTR_R": "MD Projection fibers",
- "maskJHU_MD_30_PTR_L": "MD Projection fibers",
- "maskJHU_MD_31_ILF_IFOF_R": "MD Associative fibers",
- "maskJHU_MD_32_ILF_IFOF_L": "MD Associative fibers",
- "maskJHU_MD_33_EC_R": "MD Associative fibers",
- "maskJHU_MD_34_EC_L": "MD Associative fibers",
- "maskJHU_MD_35_Cing_R": "MD Associative fibers",
- "maskJHU_MD_36_Cing_L": "MD Associative fibers",
- "maskJHU_MD_37_Cing_h_R": "MD Associative fibers",
- "maskJHU_MD_38_Cing_h_L": "MD Associative fibers",
- "maskJHU_MD_41_SLF_R": "MD Associative fibers",
- "maskJHU_MD_42_SLF_L": "MD Associative fibers",
- "maskJHU_MD_43_SFOF_R": "MD Associative fibers",
- "maskJHU_MD_44_SFOF_L": "MD Associative fibers",
- "maskJHU_MD_45_UNC_R": "MD Associative fibers",
- "maskJHU_MD_46_UNC_L": "MD Associative fibers",
- "fa_global": "FA Global",
- "md_global": "MD Global"
- }
- dti['region_groups'] = dti.index.to_series().apply(lambda x: region_dict_split[x])
- #
- def plot_ordered_boxplot(df, modality_name, clin_pred, fig_name, arrows_plot=False, arrows_info=None,
- x_limits=None, x_ticks=None, x_tick_labels=None):
- """
- Plot a boxplot with the regions ordered by the mean of the feature importance.
- Parameters
- ----------
- df : DataFrame
- DataFrame with the feature importances.
- modality_name : str
- Name of the modality.
- clin_pred : str
- Clinical prediction.
- fig_name : str
- Name of the figure.
- arrows_plot : bool, optional
- If True, plot arrows in the plot. The default is False.
- arrows_info : list
- List of tuples with the number of arrows, color and location of the arrows in the plot.
- x_limits : tuple, optional
- Limits for the x-axis.
- x_ticks : list, optional
- Ticks for the x-axis.
- x_tick_labels : list, optional
- Labels for the x-axis ticks.
- """
- # Calculate the order
- order = df.groupby('region_groups')['mean'].mean().sort_values(ascending=False).index
- sns.boxplot(x='mean', y='region_groups', data=df, order=order, orient="h", color=".8")
- plt.xlabel("Mean Feature Importance")
- if clin_pred == 'diagnosis':
- plt.ylabel("Groups of Features")
- plt.title(f'Diagnosis: {modality_name}')
- else:
- plt.ylabel('')
- plt.title(f'Prognosis: {modality_name}')
- sns.despine(top=True, right=True)
- if x_limits:
- plt.xlim(x_limits)
- if x_ticks:
- plt.xticks(x_ticks)
- if x_tick_labels:
- plt.gca().set_xticklabels(x_tick_labels)
- if arrows_plot:
- # Add arrows to y-labels
- for i, (n_arrows, sign, location) in enumerate(arrows_info):
- color = 'green' if sign == '↑' else 'red'
- plt.text(location[0], location[1], str(n_arrows)+' x'+sign if n_arrows != 0 else '',
- color=color,
- va='center',
- ha='center',
- fontsize=12
- )
- plt.savefig(base_path+f'/00_derivatives/feature_importances_groups_{clin_pred}/{fig_name}.pdf',
- bbox_inches='tight')
- plt.show()
- if clinical_prediction == 'diagnosis':
- arrows_plot = False
- elif clinical_prediction == '6m1y2y-prognosis':
- arrows_plot = False # TODO changed
- fig_name = f'{clinical_prediction}_mean-groups'
- if arrows_plot:
- fig_name = fig_name + '_arrows-plot'
- # Define the tick limits, values, and labels based on the clinical prediction
- if clinical_prediction == 'diagnosis':
- eeg_rs_x_limits = (0, 0.05)
- eeg_rs_x_ticks = [0, 0.01, 0.02, 0.03, 0.04, 0.05]
- eeg_rs_x_tick_labels = ['0', '0.01', '0.02', '0.03', '0.04', '0.05']
- pet_x_limits = (0, 0.05)
- pet_x_ticks = [0, 0.01, 0.02, 0.03, 0.04, 0.05]
- pet_x_tick_labels = ['0', '0.01', '0.02', '0.03', '0.04', '0.05']
- elif clinical_prediction == '6m1y2y-prognosis':
- amri_x_limits = (0, 0.05)
- amri_x_ticks = [0, 0.01, 0.02, 0.03, 0.04, 0.05]
- amri_x_tick_labels = ['0', '0.01', '0.02', '0.03', '0.04', '0.05']
- # Plot the ordered boxplots with the specified tick limits, values, and labels
- plot_ordered_boxplot(anat, 'aMRI', clinical_prediction,
- f'{fig_name}_anat',
- arrows_plot=arrows_plot,
- arrows_info=[(7, '↑', (-0.0058, 0)), # Subcortical
- (1, '↑', (-0.006, 1)), # SalVentAttn
- (2, '↑', (-0.001, 2)), # Vis
- (3, '↑', (-0.003, 3)), # Limbic
- (1, '↑', (-0.002, 4)), # Cont
- (5, '↓', (-0.004, 5)), # SomMot
- (3, '↓', (-0.0045, 6)), # DorsAttn
- (6, '↓', (-0.0037, 7)) # Default
- ],
- x_limits=amri_x_limits if clinical_prediction == '6m1y2y-prognosis' else None,
- x_ticks=amri_x_ticks if clinical_prediction == '6m1y2y-prognosis' else None,
- x_tick_labels=amri_x_tick_labels if clinical_prediction == '6m1y2y-prognosis' else None)
- plot_ordered_boxplot(pet, 'PET', clinical_prediction,
- f'{fig_name}_pet',
- arrows_plot=arrows_plot,
- arrows_info=[(7, '↑', (-0.0075, 0)), # Subcortical
- (0, '', (-0.0008, 1)), # SomMot
- (4, '↑', (-0.004, 2)), # Cont
- (2, '↑', (-0.0065, 3)), # DorsAttn
- (1, '↓', (-0.0078, 4)), # SalVentAttn
- (3, '↑', (-0.005, 5)), # Limbic
- (2, '↓', (-0.0055, 6)), # Default
- (5, '↓', (-0.003, 7)), # Vis
- (8, '↓', (-0.007, 8)), # Half Brain
- ],
- x_limits=pet_x_limits if clinical_prediction == 'diagnosis' else None,
- x_ticks=pet_x_ticks if clinical_prediction == 'diagnosis' else None,
- x_tick_labels=pet_x_tick_labels if clinical_prediction == 'diagnosis' else None)
- plot_ordered_boxplot(func, 'fMRI', clinical_prediction,
- f'{fig_name}_func',
- arrows_plot=arrows_plot,
- arrows_info=[(2, '↑', (-0.0093, 0)), # SomMot
- (0, '', (-0.0075, 1)), # Subcortical
- (2, '↓', (-0.0182, 2)), # Subcortical to Cortical
- (3, '↑', (-0.0083, 3)), # Limbic
- (4, '↑', (-0.007, 4)), # Cont
- (0, '', (-0.0055, 5)), # Default
- (2, '↓', (-0.0115, 6)), # SalVentAttn
- (0, '', (-0.0065, 7)), # DorsAttn
- (5, '↓', (-0.006, 8)), # Vis
- ])
- plot_ordered_boxplot(eeg_rs, 'EEG RS', clinical_prediction,
- f'{fig_name}_eeg_rs',
- arrows_plot=arrows_plot,
- arrows_info=[(1, '↑', (-0.0001, 0)), # Spectral: High
- (1, '↓', (0.0003, 1)), # Spectral: Low
- (1, '↑', (0.0008, 2)), # Connectivity
- (1, '↑', (-0.0004, 3)), # Spectral: Other
- (2, '↓', (-0.002, 4)) # Information theory
- ],
- x_limits=eeg_rs_x_limits if clinical_prediction == 'diagnosis' else None,
- x_ticks=eeg_rs_x_ticks if clinical_prediction == 'diagnosis' else None,
- x_tick_labels=eeg_rs_x_tick_labels if clinical_prediction == 'diagnosis' else None)
- plot_ordered_boxplot(eeg_lg, 'EEG LG', clinical_prediction,
- f'{fig_name}_eeg_lg',
- arrows_plot=arrows_plot,
- arrows_info=[(3, '↑', (-0.0077, 0)), # Spectral: High
- (3, '↑', (-0.0082, 1)), # Spectral: Other
- (2, '↓', (-0.0074, 2)), # Spectral: Low
- (1, '↓', (-0.0095, 3)), # Information theory
- (3, '↓', (-0.007, 4)), # Connectivity
- (0, '', (-0.005, 5)) # Evoked
- ])
- plot_ordered_boxplot(dti, 'dMRI', clinical_prediction,
- f'{fig_name}_dti',
- arrows_plot=arrows_plot,
- arrows_info=[(0, '', (-0.015, 0)), # FA global
- (1, '↑', (-0.02, 1)), # FA brainstem
- (7, '↑', (-0.0325, 2)), # MD commissural fibers
- (2, '↓', (-0.0275, 3)), # FA projection fibers
- (0, '', (-0.03, 4)), # FA associative
- (2, '↓', (-0.031, 5)), # FA commissural
- (0, '', (-0.03, 6)), # MD projection
- (0, '', (-0.03, 7)), # MD associative
- (3, '↓', (-0.022, 8)), # MD brainstem
- (1, '↓', (-0.017, 9)) # MD global
- ])
- #%% Brain plots for aMRI, fMRI, PET
- ################################
- # CORTICAL PLOTS - 4 brains for supplementary material
- def plot_nice_surf(data, density='32k', cmap='coolwarm', dpi=250, template='inflated',
- atlas=None, cbar_label=None, vmin=None, vmax=None, threshold=None,
- organization='2x2', clin_pred=None, fig_name=None):
- """
- Plot nice plots in fsLR space.
- Parameters
- ----------
- data : array_like or tuple
- ROI-wise or vertex-wise data. If tuple, assumes (left, right) hemisphere.
- density : str
- Density of surface plot, can be '8k', '32k' or '164k'.
- cmap : str
- Colormap.
- template : str
- Type of surface plot. Can be 'inflated', 'veryinflated', 'sphere' or 'midthickness'
- dpi : int
- Resolution of plot.
- atlas : Path, optional
- Path to an atlas in .dlabel.nii format.
- cbar_label: str, optional
- Colorbar label.
- vmin/vmax : int, optional
- Minimun/ maximum value in the plot.
- threshold : float, optional
- Threshold for the data. If None, no thresholding is applied.
- organization : str, optional
- How to organize the plots. Can be '1x4' or '2x2'.
- # the orig threshold was -1e-14
- """
- from nilearn.plotting import plot_surf
- from neuromaps.datasets import fetch_fslr
- from neuromaps.parcellate import Parcellater
- from neuromaps.images import dlabel_to_gifti
- if atlas is not None:
- atlas = dlabel_to_gifti(atlas)
- surf_masker = Parcellater(atlas, "fslr")
- data = surf_masker.inverse_transform(data)
- l_data, r_data = data[0].agg_data(), data[1].agg_data()
- else:
- if not isinstance(data, tuple):
- raise ValueError("Data input must be tuple-of-arrays. Alternatively provide 'atlas' for ROI data.")
- l_data, r_data = data[0], data[1]
- if None in (vmin, vmax):
- # Handle NaNs in left hemisphere data
- l_min, l_max = np.nanmin(l_data), np.nanmax(l_data)
- l_data = np.nan_to_num(l_data, nan=l_min)
- # Handle NaNs in right hemisphere data
- r_min, r_max = np.nanmin(r_data), np.nanmax(r_data)
- r_data = np.nan_to_num(r_data, nan=r_min)
- # min/max values in the data
- vmin = np.min([l_min, r_min])
- vmax = np.max([l_max, r_max])
- print(f'vmin: {vmin}, vmax: {vmax}')
- # Fetch surface template for plot
- surfaces = fetch_fslr(density=density)
- lh, rh = surfaces[template]
- if organization == '1x4':
- # Plot both hemispheres
- fig, ax = plt.subplots(nrows=1,ncols=4,subplot_kw={'projection': '3d'}, figsize=(12, 4), dpi=dpi)
- plot_surf(lh, l_data, threshold=threshold, cmap=cmap, alpha=1, view='lateral',
- colorbar=False, axes=ax.flat[0],
- vmin=vmin, vmax=vmax)
- plot_surf(lh, l_data, threshold=threshold, cmap=cmap, alpha=1, view='medial',
- colorbar=False, axes=ax.flat[1],
- vmin=vmin, vmax=vmax)
- plot_surf(rh, r_data, threshold=threshold, cmap=cmap, alpha=1, view='lateral',
- colorbar=False, axes=ax.flat[2],
- vmin=vmin, vmax=vmax)
- p = plot_surf(rh, r_data, threshold=threshold, cmap=cmap, alpha=1, view='medial',
- colorbar=True, axes=ax.flat[3],
- vmin=vmin, vmax=vmax)
- p.axes[-1].set_ylabel(cbar_label, fontsize=14, labelpad=0.5)
- p.axes[-1].set_yticks([vmin, vmax])
- #p.axes[-1].set_yticklabels(['min', 'max'])
- p.axes[-1].tick_params(labelsize=12, width=0, pad=0.1)
- plt.subplots_adjust(wspace=-0.05)
- p.axes[-1].set_position(p.axes[-1].get_position().translated(0.08, 0))
- elif organization == '2x2':
- # Plot both hemispheres
- fig, ax = plt.subplots(nrows=2, ncols=2, subplot_kw={'projection': '3d'}, figsize=(8, 8), dpi=dpi)
- plot_surf(lh, l_data, threshold=threshold, cmap=cmap, alpha=1, view='lateral',
- colorbar=False, axes=ax[0, 0],
- vmin=vmin, vmax=vmax)
- plot_surf(rh, r_data, threshold=threshold, cmap=cmap, alpha=1, view='medial',
- colorbar=False, axes=ax[0, 1],
- vmin=vmin, vmax=vmax)
- plot_surf(lh, l_data, threshold=threshold, cmap=cmap, alpha=1, view='medial',
- colorbar=False, axes=ax[1, 0],
- vmin=vmin, vmax=vmax)
- p = plot_surf(rh, r_data, threshold=threshold, cmap=cmap, alpha=1, view='lateral',
- colorbar=True, axes=ax[1, 1],
- vmin=vmin, vmax=vmax)
- p.axes[-1].set_ylabel(cbar_label, fontsize=10, labelpad=0.5)
- p.axes[-1].set_yticks([vmin, vmax])
- p.axes[-1].tick_params(labelsize=7, width=0, pad=0.1)
- plt.subplots_adjust(wspace=-0.05, hspace=0.05)
- p.axes[-1].set_position(p.axes[-1].get_position().translated(0.08, 0))
- plt.savefig(base_path+f'/00_derivatives/feature_importances_{clin_pred}/{fig_name}.pdf',
- bbox_inches='tight')
- return p
- # aMRI
- # take the first 100 rows of the fi_anat_mean_std:
- fi_anat_mean_std_cortical = fi_anat_mean_std.iloc[:100]
- fi_anat_mean_std_cortical.index = fi_anat_mean_std_cortical.index.str.replace('anat_lh_', '')
- fi_anat_mean_std_cortical.index = fi_anat_mean_std_cortical.index.str.replace('anat_rh_', '')
- fi_anat_mean_std_cortical.index = fi_anat_mean_std_cortical.index.str.replace('_thickness', '')
- base_path = '/home/Documents/codes/permed'
- atlas_path = base_path+'/multimodal/Schaefer2018_100Parcels_7Networks_order.dlabel.nii'
- # plot the cortical features first for the fi_anat_mean_std_cortical.mean and the fi_anat_mean_std_cortical.std:
- anat_cort_img = plot_nice_surf(fi_anat_mean_std_cortical['mean'], density='32k', dpi=250, template='inflated',
- atlas=atlas_path,
- cbar_label='thickness (mean)', cmap='pink',
- vmin=0, vmax=0.22,
- # vmin=None, vmax=None,
- threshold=None,
- organization='1x4',
- clin_pred=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_anat_cortical'
- )
- plot_nice_surf(fi_anat_mean_std_cortical['std'], density='32k', dpi=250, template='inflated',
- atlas=atlas_path,
- cbar_label='thickness (std)', cmap='pink',
- vmin=0, vmax=0.08,
- # vmin=None, vmax=None,
- threshold=None,
- organization='1x4',
- clin_pred=clinical_prediction, fig_name=f'{clinical_prediction}_fi_std_anat_cortical'
- )
- # fMRI
- fi_func_mean_std_cortical = fi_func_mean_std[fi_func_mean_std.index.str.contains('7Networks')]
- fi_func_mean_std_cortical.index = fi_func_mean_std_cortical.index.str.replace('func-connectivity_mean_', '')
- func_cort_img = plot_nice_surf(fi_func_mean_std_cortical['mean'], density='32k', dpi=250, template='inflated',
- atlas=atlas_path,
- cbar_label='functional correlation (mean)', cmap='pink',
- # vmin=-0.1, vmax=0.1,
- threshold=None,
- organization='1x4',
- clin_pred=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_fmri_cortical'
- )
- plot_nice_surf(fi_func_mean_std_cortical['std'], density='32k', dpi=250, template='inflated',
- atlas=atlas_path,
- cbar_label='functional correlation (std)', cmap='pink',
- # vmin=0, vmax=0.08,
- threshold=None,
- organization='1x4',
- clin_pred=clinical_prediction, fig_name=f'{clinical_prediction}_fi_std_fmri_cortical'
- )
- #
- # PET
- # take the first 100 rows of the fi_pet_mean_std:
- fi_pet_mean_std_cortical = fi_pet_mean_std.iloc[:100]
- fi_pet_mean_std_cortical.index = fi_pet_mean_std_cortical.index.str.replace('pet_', '')
- pet_cort_img = plot_nice_surf(fi_pet_mean_std_cortical['mean'], density='32k', dpi=250, template='inflated',
- atlas=atlas_path,
- cbar_label='SUV (mean)', cmap='pink',
- # vmin=0, vmax=0.22,
- threshold=None,
- organization='1x4',
- clin_pred=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_pet_cortical'
- )
- plot_nice_surf(fi_pet_mean_std_cortical['std'], density='32k', dpi=250, template='inflated',
- atlas=atlas_path,
- cbar_label='SUV (std)', cmap='pink',
- # vmin=0, vmax=0.08,
- threshold=None,
- organization='1x4',
- clin_pred=clinical_prediction, fig_name=f'{clinical_prediction}_fi_std_pet_cortical'
- )
- #%%
- ##############################
- # SUBCORTICAL PLOTS - 4 brains, for supplementary material
- def modify_atlas(atlas, atlas_roi_labels, marker_values, atlas_name=None):
- """
- Modify the values in an atlas image.
- marker_values is a dataframe with the following columns:
- - roi_label: the label of the ROI in the atlas
- - new_value: the new value to assign to the ROI
- """
- # Load the atlas image
- if atlas_name=='Schaefer2018':
- atlas_img = nib.load(atlas.maps)
- elif atlas_name=='HarvardOxfordSubcortical':
- atlas_img = atlas.maps
- # Initialize a matrix with the same shape as the atlas
- combined_matrix = np.zeros(atlas_img.shape)
- if atlas_name=='HarvardOxfordSubcortical':
- print('We have the following labels : ', atlas_roi_labels)
- roi_to_remove = ['Background',
- 'Left Cerebral White Matter',
- 'Left Cerebral Cortex ',
- 'Left Lateral Ventrical',
- 'Right Cerebral White Matter',
- 'Right Cerebral Cortex ',
- 'Right Lateral Ventricle']
- print('Removing the following labels : ', roi_to_remove)
- # From the list roi_labels, remove the elements in roi_to_remove
- atlas_roi_labels = [x for x in atlas_roi_labels if x not in roi_to_remove]
- print('We have the following labels : ', atlas_roi_labels)
- for label in atlas_roi_labels:
- # Check if the label exists in marker_values
- if label in marker_values['roi_label'].values:
- # From the dataframe marker_values, get the new_value which corresponds to the current label
- new_val = marker_values[marker_values['roi_label'] == label]['new_value'].values[0]
- else:
- print(f"Label {label} not found in marker_values")
- # Find the index of the label in the atlas
- if atlas_name=='Schaefer2018':
- roi_idx = np.where(atlas.labels == label.encode('UTF-8'))[0]+1
- elif atlas_name=='HarvardOxfordSubcortical':
- roi_idx = np.where(np.array(atlas.labels) == label)[0]
- print(f'Label {label} has index : {roi_idx} and new value : {new_val}.')
- # Create a binary mask for the current ROI using the atlas image
- from nilearn import image
- idx_map = image.math_img('img == %s' % roi_idx, img=atlas.maps)
- idx_map_data = idx_map.get_fdata()
- # Set the marker value for voxels within the current ROI
- idx_map_data[idx_map_data != 0] = new_val
- print(f'Unique values in idx_map : {np.unique(idx_map_data)}')
- # Add the current ROI mask to the combined matrix
- combined_matrix = np.add(combined_matrix, idx_map_data)
- # Create a new Nifti image with the modified data
- modified_atlas_img = nib.Nifti1Image(combined_matrix, atlas_img.affine, atlas_img.header)
- # or:
- # modified_atlas_img = new_img_like(atlas_img, combined_matrix)
- return modified_atlas_img
- def plot_subcortical_regions(atlas, atlas_roi_labels, marker_values, atlas_name=None,
- clinical_prediction=None, fig_name=None, savefig=False):
- """
- Plot the subcortical regions in an atlas image.
- marker_values is a dataframe with the following columns:
- - roi_label: the label of the ROI in the atlas
- - new_value: the new value to assign to the ROI
- """
- # Modify the atlas using the provided marker values
- modified_atlas_img = modify_atlas(atlas, atlas_roi_labels, marker_values, atlas_name)
- if savefig:
- # Plot the modified atlas
- display = plotting.plot_glass_brain(stat_map_img=modified_atlas_img,
- colorbar=True,
- cmap='twilight',
- alpha=1,
- display_mode="lyrz")
- display.add_contours(modified_atlas_img, filled=True)
- # save the plot
- display.savefig(base_path+f'/00_derivatives/feature_importances_{clinical_prediction}/{fig_name}.pdf')
- return modified_atlas_img
- # aMRI
- print('aMRI')
- # take the first 100 rows of the fi_anat_mean_std:
- fi_anat_mean_std_subcortical = fi_anat_mean_std.iloc[100:]
- fi_anat_mean_std_subcortical.index = fi_anat_mean_std_subcortical.index.str.replace('anat_', '')
- base_path = '/home/Documents/codes/permed'
- # create a dataframe for marker_values
- marker_values_mean = pd.DataFrame({
- 'roi_label': fi_anat_mean_std_subcortical.index,
- 'new_value': fi_anat_mean_std_subcortical['mean']
- })
- marker_values_std = pd.DataFrame({
- 'roi_label': fi_anat_mean_std_subcortical.index,
- 'new_value': fi_anat_mean_std_subcortical['std']
- })
- # rename the marker_values_mean roi_label values to match those of the Harvard-Oxford atlas by putting the first letters of the words in capital
- marker_values_mean['roi_label'] = marker_values_mean['roi_label'].str.title()
- marker_values_std['roi_label'] = marker_values_std['roi_label'].str.title()
- atlas = fetch_atlas_harvard_oxford('sub-maxprob-thr25-1mm')
- # load the atlas
- # atlas = nib.load(atlas_path)
- # plot the subcortical features first for the fi_anat_mean_std_subcortical.mean and the fi_anat_mean_std_subcortical.std:
- anat_img = plot_subcortical_regions(atlas, atlas.labels, marker_values_mean, atlas_name='HarvardOxfordSubcortical',
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_anat_subcortical')
- # do the same for fmri
- print('fMRI')
- fi_func_mean_std_subcortical = fi_func_mean_std.iloc[100:]
- fi_func_mean_std_subcortical.index = fi_func_mean_std_subcortical.index.str.replace('func-connectivity_mean_', '')
- # create a dataframe for marker_values
- marker_values_mean = pd.DataFrame({
- 'roi_label': fi_func_mean_std_subcortical.index,
- 'new_value': fi_func_mean_std_subcortical['mean']
- })
- marker_values_std = pd.DataFrame({
- 'roi_label': fi_func_mean_std_subcortical.index,
- 'new_value': fi_func_mean_std_subcortical['std']
- })
- # rename the marker_values_mean roi_label values to match those of the Harvard-Oxford atlas by putting the first letters of the words in capital
- marker_values_mean['roi_label'] = marker_values_mean['roi_label'].str.title()
- marker_values_std['roi_label'] = marker_values_std['roi_label'].str.title()
- func_img = plot_subcortical_regions(atlas, atlas.labels, marker_values_mean, atlas_name='HarvardOxfordSubcortical',
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_fmri_subcortical')
- # do the same for PET
- print('PET')
- fi_pet_mean_std_subcortical = fi_pet_mean_std.iloc[100:]
- fi_pet_mean_std_subcortical.index = fi_pet_mean_std_subcortical.index.str.replace('pet_', '')
- # create a dataframe for marker_values
- marker_values_mean = pd.DataFrame({
- 'roi_label': fi_pet_mean_std_subcortical.index,
- 'new_value': fi_pet_mean_std_subcortical['mean']
- })
- marker_values_std = pd.DataFrame({
- 'roi_label': fi_pet_mean_std_subcortical.index,
- 'new_value': fi_pet_mean_std_subcortical['std']
- })
- # rename the marker_values_mean roi_label values to match those of the Harvard-Oxford atlas by putting the first letters of the words in capital
- marker_values_mean['roi_label'] = marker_values_mean['roi_label'].str.title()
- marker_values_std['roi_label'] = marker_values_std['roi_label'].str.title()
- pet_img = plot_subcortical_regions(atlas, atlas.labels, marker_values_mean, atlas_name='HarvardOxfordSubcortical',
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_pet_subcortical')
- #%% FINAL FIGURE Supplementary Figure - 3x2 brain plots (cortical and subcortical) mean feature importances of aMRI, fMRI, PET
- clin_pred = clinical_prediction
- # Load the images
- anat_cort_img = convert_from_path(base_path+f'/00_derivatives/feature_importances_{clin_pred}/{clin_pred}_fi_mean_anat_cortical.pdf')[0]
- func_cort_img = convert_from_path(base_path+f'/00_derivatives/feature_importances_{clin_pred}/{clin_pred}_fi_mean_fmri_cortical.pdf')[0]
- pet_cort_img = convert_from_path(base_path+f'/00_derivatives/feature_importances_{clin_pred}/{clin_pred}_fi_mean_pet_cortical.pdf')[0]
- # Convert PIL Images to numpy arrays
- anat_cort_img = np.array(anat_cort_img)
- func_cort_img = np.array(func_cort_img)
- pet_cort_img = np.array(pet_cort_img)
- # Display the images in subplots
- fig, ax = plt.subplots(nrows=3, ncols=2, figsize=(16, 8), dpi=300)
- # Cortical plots
- # aMRI
- ax[0, 0].imshow(anat_cort_img)
- ax[0, 0].axis('off')
- ax[0, 0].set_title('aMRI cortical mean feature importances',
- color='black', bbox={'facecolor': 'white', 'alpha': 0.5, 'pad': 10},
- fontsize=14, y=1.2
- )
- # fMRI
- ax[1, 0].imshow(func_cort_img)
- ax[1, 0].axis('off')
- ax[1, 0].set_title('fMRI cortical mean feature importances',
- color='black', bbox={'facecolor': 'white', 'alpha': 0.5, 'pad': 10},
- fontsize=14, y=1.2
- )
- # PET
- ax[2, 0].imshow(pet_cort_img)
- ax[2, 0].axis('off')
- ax[2, 0].set_title('PET cortical mean feature importances',
- color='black', bbox={'facecolor': 'white', 'alpha': 0.5, 'pad': 10},
- fontsize=14, y=1.2
- )
- # Subcortical plots
- # aMRI
- display = plotting.plot_glass_brain(stat_map_img=anat_img, colorbar=True, cmap='twilight', alpha=1, display_mode="lyrz", axes=ax[0, 1])
- display.add_contours(anat_img, filled=True)
- ax[0, 1].set_title('aMRI subcortical mean feature importances',
- color='black', bbox={'facecolor': 'white', 'alpha': 0.5, 'pad': 10}, fontsize=14)
- # Get the colorbar object
- cbar = display._cbar
- # Change the tick location to right
- cbar.ax.yaxis.set_tick_params(left=False, right=True, labelleft=False, labelright=True)
- # fMRI
- display = plotting.plot_glass_brain(stat_map_img=func_img, colorbar=True, cmap='twilight', alpha=1, display_mode="lyrz", axes=ax[1, 1])
- display.add_contours(func_img, filled=True)
- ax[1, 1].set_title('fMRI subcortical mean feature importances',
- color='black', bbox={'facecolor': 'white', 'alpha': 0.5, 'pad': 10}, fontsize=14)
- cbar = display._cbar
- cbar.ax.yaxis.set_tick_params(left=False, right=True, labelleft=False, labelright=True)
- # PET
- display = plotting.plot_glass_brain(stat_map_img=pet_img, colorbar=True, cmap='twilight', alpha=1, display_mode="lyrz", axes=ax[2, 1])
- display.add_contours(pet_img, filled=True)
- ax[2, 1].set_title('PET subcortical mean feature importances',
- color='black', bbox={'facecolor': 'white', 'alpha': 0.5, 'pad': 10}, fontsize=14)
- cbar = display._cbar
- cbar.ax.yaxis.set_tick_params(left=False, right=True, labelleft=False, labelright=True)
- # save the figure
- plt.savefig(base_path+f'/00_derivatives/feature_importances_groups_diagnosis_6m1y2y-prognosis/{clinical_prediction}_fi_mean_cort-subcort.pdf',
- bbox_inches='tight')
- # Combination of Diagnosis and prognosis with lines how the feature groups ranking changes
- # diagnosis (glass brains, boxplots) -lines- prognosis (boxplots, glass brains)
- # The difference with the code above is that the code above has 4 brains
- # in the plots from all sides and the cortical plot is a different brain design.
- def plot_regions(atlas, atlas_roi_labels, marker_values, atlas_name=None,
- clinical_prediction=None, fig_name=None):
- """
- Plot the regions in an atlas image.
- marker_values is a dataframe with the following columns:
- - roi_label: the label of the ROI in the atlas
- - new_value: the new value to assign to the ROI
- """
- # Modify the atlas using the provided marker values
- modified_atlas_img = modify_atlas(atlas, atlas_roi_labels, marker_values, atlas_name)
- # Plot the modified atlas
- display = plotting.plot_glass_brain(stat_map_img=modified_atlas_img,
- colorbar=True,
- cmap='twilight',
- alpha=0.7,
- display_mode="z")
- display.add_contours(modified_atlas_img, filled=True)
- # save the plot
- display.savefig(base_path+
- f'/00_derivatives/feature_importances_groups_diagnosis_6m1y2y-prognosis/{fig_name}.pdf')
- return modified_atlas_img
- ############################# SUBCORTICAL #####################################
- # aMRI
- print('aMRI')
- # take the first 100 rows of the fi_anat_mean_std:
- fi_anat_mean_std_subcortical = fi_anat_mean_std.iloc[100:]
- fi_anat_mean_std_subcortical.index = fi_anat_mean_std_subcortical.index.str.replace('anat_', '')
- base_path = '/home/Documents/codes/permed'
- # create a dataframe for marker_values
- marker_values_mean = pd.DataFrame({
- 'roi_label': fi_anat_mean_std_subcortical.index,
- 'new_value': fi_anat_mean_std_subcortical['mean']
- })
- marker_values_std = pd.DataFrame({
- 'roi_label': fi_anat_mean_std_subcortical.index,
- 'new_value': fi_anat_mean_std_subcortical['std']
- })
- # rename the marker_values_mean roi_label values to match those of the Harvard-Oxford atlas by putting the first letters of the words in capital
- marker_values_mean['roi_label'] = marker_values_mean['roi_label'].str.title()
- marker_values_std['roi_label'] = marker_values_std['roi_label'].str.title()
- atlas = fetch_atlas_harvard_oxford('sub-maxprob-thr25-1mm')
- # load the atlas
- # atlas = nib.load(atlas_path)
- # plot the subcortical features first for the fi_anat_mean_std_subcortical.mean and the fi_anat_mean_std_subcortical.std:
- modified_atlas_img = plot_regions(atlas, atlas.labels, marker_values_mean, atlas_name='HarvardOxfordSubcortical',
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_anat_subcortical')
- plot_regions(atlas, atlas.labels, marker_values_std, atlas_name='HarvardOxfordSubcortical',
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_std_anat_subcortical')
- # do the same for fmri
- print('fMRI')
- fi_func_mean_std_subcortical = fi_func_mean_std.iloc[100:]
- fi_func_mean_std_subcortical.index = fi_func_mean_std_subcortical.index.str.replace('func-connectivity_mean_', '')
- # create a dataframe for marker_values
- marker_values_mean = pd.DataFrame({
- 'roi_label': fi_func_mean_std_subcortical.index,
- 'new_value': fi_func_mean_std_subcortical['mean']
- })
- marker_values_std = pd.DataFrame({
- 'roi_label': fi_func_mean_std_subcortical.index,
- 'new_value': fi_func_mean_std_subcortical['std']
- })
- # rename the marker_values_mean roi_label values to match those of the Harvard-Oxford atlas by putting the first letters of the words in capital
- marker_values_mean['roi_label'] = marker_values_mean['roi_label'].str.title()
- marker_values_std['roi_label'] = marker_values_std['roi_label'].str.title()
- plot_regions(atlas, atlas.labels, marker_values_mean, atlas_name='HarvardOxfordSubcortical',
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_fmri_subcortical')
- plot_regions(atlas, atlas.labels, marker_values_std, atlas_name='HarvardOxfordSubcortical',
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_std_fmri_subcortical')
- # do the same for PET
- print('PET')
- fi_pet_mean_std_subcortical = fi_pet_mean_std.iloc[100:]
- fi_pet_mean_std_subcortical.index = fi_pet_mean_std_subcortical.index.str.replace('pet_', '')
- # create a dataframe for marker_values
- marker_values_mean = pd.DataFrame({
- 'roi_label': fi_pet_mean_std_subcortical.index,
- 'new_value': fi_pet_mean_std_subcortical['mean']
- })
- marker_values_std = pd.DataFrame({
- 'roi_label': fi_pet_mean_std_subcortical.index,
- 'new_value': fi_pet_mean_std_subcortical['std']
- })
- # rename the marker_values_mean roi_label values to match those of the Harvard-Oxford atlas by putting the first letters of the words in capital
- marker_values_mean['roi_label'] = marker_values_mean['roi_label'].str.title()
- marker_values_std['roi_label'] = marker_values_std['roi_label'].str.title()
- plot_regions(atlas, atlas.labels, marker_values_mean, atlas_name='HarvardOxfordSubcortical',
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_pet_subcortical')
- plot_regions(atlas, atlas.labels, marker_values_std, atlas_name='HarvardOxfordSubcortical',
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_std_pet_subcortical')
- ############################ CORTICAL ##########################################
- atlas_name = 'Schaefer2018'
- atlas = datasets.fetch_atlas_schaefer_2018(
- n_rois=100,
- yeo_networks=7,
- resolution_mm=1)
- roi_labels = atlas.labels
- roi_labels = [row.tobytes().decode('UTF-8') for row in roi_labels]
- # aMRI
- # take the first 100 rows of the fi_anat_mean_std:
- fi_anat_mean_std_cortical = fi_anat_mean_std.iloc[:100]
- fi_anat_mean_std_cortical.index = fi_anat_mean_std_cortical.index.str.replace('anat_lh_', '')
- fi_anat_mean_std_cortical.index = fi_anat_mean_std_cortical.index.str.replace('anat_rh_', '')
- fi_anat_mean_std_cortical.index = fi_anat_mean_std_cortical.index.str.replace('_thickness', '')
- marker_values_mean = pd.DataFrame({
- 'roi_label': fi_anat_mean_std_cortical.index,
- 'new_value': fi_anat_mean_std_cortical['mean']
- })
- marker_values_std = pd.DataFrame({
- 'roi_label': fi_anat_mean_std_cortical.index,
- 'new_value': fi_anat_mean_std_cortical['std']
- })
- # plot the aMRI plot_regions
- plot_regions(atlas, roi_labels, marker_values_mean, atlas_name=atlas_name,
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_anat_cortical')
- plot_regions(atlas, roi_labels, marker_values_std, atlas_name=atlas_name,
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_std_anat_cortical')
- # fMRI
- fi_func_mean_std_cortical = fi_func_mean_std[fi_func_mean_std.index.str.contains('7Networks')]
- fi_func_mean_std_cortical.index = fi_func_mean_std_cortical.index.str.replace('func-connectivity_mean_', '')
- marker_values_mean = pd.DataFrame({
- 'roi_label': fi_func_mean_std_cortical.index,
- 'new_value': fi_func_mean_std_cortical['mean']
- })
- marker_values_std = pd.DataFrame({
- 'roi_label': fi_func_mean_std_cortical.index,
- 'new_value': fi_func_mean_std_cortical['std']
- })
- # plot the fMRI plot_regions
- plot_regions(atlas, roi_labels, marker_values_mean, atlas_name=atlas_name,
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_fmri_cortical')
- plot_regions(atlas, roi_labels, marker_values_std, atlas_name=atlas_name,
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_std_fmri_cortical')
- # PET
- # take the first 100 rows of the fi_pet_mean_std:
- fi_pet_mean_std_cortical = fi_pet_mean_std.iloc[:100]
- fi_pet_mean_std_cortical.index = fi_pet_mean_std_cortical.index.str.replace('pet_', '')
- marker_values_mean = pd.DataFrame({
- 'roi_label': fi_pet_mean_std_cortical.index,
- 'new_value': fi_pet_mean_std_cortical['mean']
- })
- marker_values_std = pd.DataFrame({
- 'roi_label': fi_pet_mean_std_cortical.index,
- 'new_value': fi_pet_mean_std_cortical['std']
- })
- # plot the PET plot_regions
- plot_regions(atlas, roi_labels, marker_values_mean, atlas_name=atlas_name,
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_mean_pet_cortical')
- plot_regions(atlas, roi_labels, marker_values_std, atlas_name=atlas_name,
- clinical_prediction=clinical_prediction, fig_name=f'{clinical_prediction}_fi_std_pet_cortical')
- #%%
- # Correlations between the diagnostic and prognostic feature importances for: fMRI, EEG LG, dMRI
- sns.set_theme()
- sns.set_context("talk")
- sns.set_style("white")
- mean_feat_path = os.path.join(base_path, '00_derivatives/mean_feat_importances_with_feature-groups_splits')
- # diagnosis
- clinical_prediction = 'diagnosis' # '6m1y2y-prognosis' # 'diagnosis'
- # fMRI
- fmri_diag = pd.read_csv(os.path.join(mean_feat_path, f'{clinical_prediction}_mean_feature-groups_func.csv'), index_col=0)
- # dMRI
- dMRI_diag = pd.read_csv(os.path.join(mean_feat_path, f'{clinical_prediction}_mean_feature-groups_dti.csv'), index_col=0)
- # EEG LG
- eeg_lg_diag = pd.read_csv(os.path.join(mean_feat_path, f'{clinical_prediction}_mean_feature-groups_eeg_lg.csv'), index_col=0)
- # prognosis
- clinical_prediction = '6m1y2y-prognosis'
- # fMRI
- fmri_prog = pd.read_csv(os.path.join(mean_feat_path, f'{clinical_prediction}_mean_feature-groups_func.csv'), index_col=0)
- # dMRI
- dMRI_prog = pd.read_csv(os.path.join(mean_feat_path, f'{clinical_prediction}_mean_feature-groups_dti.csv'), index_col=0)
- # EEG LG
- eeg_lg_prog = pd.read_csv(os.path.join(mean_feat_path, f'{clinical_prediction}_mean_feature-groups_eeg_lg.csv'), index_col=0)
- # in fmri_diag and fmri_prog change the values in the column region_groups from Subcortical to Cortical to Sub to Cort
- fmri_diag['region_groups'] = fmri_diag['region_groups'].replace('Subcortical to Cortical', 'Sub to Cort')
- fmri_prog['region_groups'] = fmri_prog['region_groups'].replace('Subcortical to Cortical', 'Sub to Cort') # ??? this was not included
- #
- fig, ax = plt.subplots(3, 1, figsize=(6, 16), dpi=300)
- scatter_fmri = sns.scatterplot(x=fmri_diag['mean'], y=fmri_prog['mean'], hue=fmri_diag['region_groups'],
- palette='deep', alpha=0.85, ax=ax[0])
- scatter_dMRI = sns.scatterplot(x=dMRI_diag['mean'], y=dMRI_prog['mean'], hue=dMRI_diag['region_groups'],
- palette='deep', alpha=0.85, ax=ax[1])
- scatter_eeg_lg = sns.scatterplot(x=eeg_lg_diag['mean'], y=eeg_lg_prog['mean'], hue=eeg_lg_diag['region_groups'],
- palette='deep', alpha=0.85, ax=ax[2])
- ax[0].set_title('fMRI')
- ax[1].set_title('dMRI')
- ax[2].set_title('EEG LG')
- ax[0].set_xlabel('Diagnosis mean FI')
- ax[0].set_ylabel('Prognosis mean FI')
- ax[1].set_xlabel('Diagnosis mean FI')
- ax[1].set_ylabel('Prognosis mean FI')
- ax[2].set_xlabel('Diagnosis mean FI')
- ax[2].set_ylabel('Prognosis mean FI')
- # set the limits of the first subplot to 0 to 0.04 on both x and y
- ax[0].set_xlim(0, 0.04)
- ax[0].set_ylim(0, 0.04)
- ax[1].set_xlim(0, 0.075)
- ax[1].set_ylim(0, 0.075)
- ax[2].set_xlim(0, 0.03)
- ax[2].set_ylim(0, 0.03)
- # On all three plots but the same ticks on the x and y axes, and always put 4 ticks, two at the extremes and one in the middle:
- ax[0].set_xticks([0, 0.02, 0.04])
- ax[0].set_yticks([0, 0.02, 0.04])
- ax[1].set_xticks([0, 0.04, 0.075])
- ax[1].set_yticks([0, 0.04, 0.075])
- ax[2].set_xticks([0, 0.015, 0.03])
- ax[2].set_yticks([0, 0.015, 0.03])
- # Set the tick labels to display 0 without commas
- ax[0].set_xticklabels(['0', '0.02', '0.04'])
- ax[0].set_yticklabels(['0', '0.02', '0.04'])
- ax[1].set_xticklabels(['0', '0.04', '0.075'])
- ax[1].set_yticklabels(['0', '0.04', '0.075'])
- ax[2].set_xticklabels(['0', '0.015', '0.03'])
- ax[2].set_yticklabels(['0', '0.015', '0.03'])
- plt.tight_layout()
- legend_fmri = scatter_fmri.legend(loc='upper right', bbox_to_anchor=(1, 1), fontsize=10)
- for handle in legend_fmri.legendHandles:
- handle._sizes = [35] # adjust as needed
- legend_dmri = scatter_dMRI.legend(loc='upper right', bbox_to_anchor=(1, 1), fontsize=10)
- for handle in legend_dmri.legendHandles:
- handle._sizes = [35] # adjust as needed
- legend_eeg_lg = scatter_eeg_lg.legend(loc='upper right', bbox_to_anchor=(1, 1), fontsize=10)
- for handle in legend_eeg_lg.legendHandles:
- handle._sizes = [35] # adjust as needed
- plt.savefig(os.path.join(base_path, '00_derivatives/Figure_3_feat-imp/correlation_diag-prog_feature-importances.pdf'), bbox_inches='tight')
01_efm_model-results.py at commit 476e8bf, no license · at the source
Overview
and 17 other authors
Francesca Baglio9, Constantin Lapa14, Ansgar Berlis15, Kristina Krüger15, Tina Luther5,6, Vincent Perlbarg16, Gustavo Deco13,17, Yonathan Sanz-Perl1,17, Enzo Tagliazucchi4,18, Louis Puybasset16,19, Benjamin Rohaut1,20, Lionel Naccache1,21, Angela Comanducci9, Anat Arzi1,22,23, Mario Rosanova8, Andreas Bender5,6,24, Jacobo Diego Sitt124 affiliations
- Institut du Cerveau - Paris Brain Institute - ICM, Inserm, CNRS, Sorbonne Université, Paris 75013, France
- Université Paris Cité, Paris 75006, France
- Laboratorio de Inteligencia Artificial Aplicada, Instituto de Ciencias de la Computación, Universidad de Buenos Aires, Buenos Aires C1053, Argentina
- Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET), Ministry of Science, Technology and Innovation, Buenos Aires C1053, Argentina
- Department of Neurology, University Hospital of the Ludwig-Maximilians-Universität München, Munich 82152, Germany
- Therapiezentrum Burgau, Hospital for Neurological Rehabilitation, Burgau 89331, Germany
- Clinical and Biological Psychology, Institute of Psychology and Education, Ulm University, Ulm 89081, Germany
- Department of Biomedical and Clinical Sciences, University of Milano, Milan 20157, Italy
- IRCCS Fondazione Don Carlo Gnocchi ONLUS, Milan 20148, Italy
- Inserm 1266, Institute of Psychiatry and Neurosciences of Paris, Université Paris Cité, Paris F-75014, France
- Medical Intensive Care Unit, HEGP Hôpital, Assistance Publique - Hôpitaux de Paris-Centre (APHP-Centre), Paris 75014, France
- Centre Mémoire de Ressources et de Recherche, Paris Nord/Université Paris-Cité, Paris 75006, France
- Center for Brain and Cognition, Computational Neuroscience Group, Universitat Pompeu Fabra, Barcelona 08005, Spain
- Nuclear Medicine, Faculty of Medicine, University of Augsburg, Augsburg 86156, Germany
- Diagnostic and Interventional Neuroradiology, Faculty of Medicine, University of Augsburg, Augsburg 86156, Germany
- BRAINTALE SAS, Paris 75013, France
- Institució Catalana de la Recerca I Estudis Avançats (ICREA), Barcelona 08010, Spain
- Latin American Brain Health Institute (BrainLat), Universidad Adolfo Ibáñez, Santiago 7941169, Chile
- GRC 29, AP-HP, DMU DREAM, Department of Anaesthesiology and Critical Care Medicine, Pitié-Salpêtrière Hospital, Sorbonne University, Paris 75013, France
- AP-HP, Hôpital de la Pitié Salpêtrière, Neuro ICU, DMU Neurosciences, Paris 75013, France
- AP-HP, Hôpital Pitié - Salpêtrière, Service de Neurophysiologie Clinique, Paris 75013, France
- Department of Medical Neurobiology, Institute for Medical Research Israel-Canada, Faculty of Medicine, The Hebrew University of Jerusalem, Jerusalem 9112102, Israel
- Department of Cognitive and Brain Sciences, The Hebrew University of Jerusalem, Jerusalem 9112102, Israel
- Department of Neurorehabilitation, Medical Faculty, University of Augsburg, Augsburg 86156, Germany
Abstract
Severely brain-injured patients may enter a spectrum of conditions collectively known as disorders of consciousness. This spectrum includes clinical conditions such as unresponsive wakefulness syndrome or minimally conscious state, where the behavioural assessment of consciousness can often be deceptive.
To bridge this dissociation, neuroimaging techniques are employed to identify the residual brain functions. Each neuroimaging modality imperfectly captures distinct aspects of brain preservation—functional,
Our investigation reveals that specific modalities, such as functional assessments, provide comprehensive insights into the currently evaluated state of consciousness, the diagnosis of the patients. Conversely, structural modalities offer valuable information about the patient's evolution within the consciousness spectrum. We validate the proposed analysis with data coming from other centres with different acquisition parameters. Importantly, we demonstrate that model performance improves with an increase in the number of modalities. We observe a higher inter-modality disagreement for minimally conscious state patients and those patients who improve. Lastly, we observe a difference in feature importances between diagnosis and prognosis, with an interaction between modality and anatomical structures: some subcortical markers tend to contribute more to prognosis, while other cortical markers are more informative for diagnosis.
This integrative multimodal and machine learning methodology presents a promising avenue for a more nuanced understanding of disorders of consciousness, contributing to enhanced diagnostic precision, prognostic capabilities and the personalization of rehabilitative strategies in clinical practice.
Reproduced under the paper's license (CC BY-NC), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 4 matches between paragraphs and lines of code.
DraganaMana/multimod_doc
476e8bf792c6258056bba25d82d73535edfc5379, 7 January 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
38 files
- bashing/
fmriprep_local_docker.sh , Shell, 66 lines - bashing/
freesurfer_anat_stats.sh , Shell, 2 lines - bashing/
freesurfer_clinical_scri , Shell, 17 linespted.sh - bashing/
freesurfer_scripted.sh , Shell, 18 lines - bashing/
freesurfer_stats.sh , Shell, 50 lines - bashing/
freesurfer_surf2surf_sch , Shell, 58 linesaefer2018.sh - bashing/
freeview_t1w.sh , Shell, 15 lines - bashing/
open_fprep_html.sh , Shell, 4 lines - bashing/
run_all_freesurfer.sh , Shell, 7 lines - fmri_manip/
01_2_lenient_exclusion_i , Python, 70 linestge.py - fmri_manip/
01_included_func_scans.p , Python, 66 linesy - fmri_manip/
02_confounds_regression. , Python, 231 linespy - fmri_manip/
03_get_func_dims.py , Python, 53 lines - fmri_markers/
01_run_fmri_functions.py , Python, 185 lines - fmri_markers/
01b_save_fc_whole-brain. , Python, 154 linespy - fmri_markers/
fmri_functions.py , Python, 767 lines, 1 match - modeling/
00_run_early_fusion.py , Python, 207 lines - modeling/
01_efm_model-results.py , Python, 1,276 lines, 1 match - modeling/
02_2lvl_decision.py , Python, 290 lines - modeling/
03a_efm_model_outputs_an , Python, 352 linesd_surrogates_plots.py - modeling/
03b_efm_model_outputs_an , Python, 1,152 linesd_surrogates_plots.py - modeling/
03c_efm_model_outputs_an , Python, 339 linesd_surrogates_plots.py - modeling/
04_model_calibration_che , Python, 93 linesck.py - modeling/
05_run_early_fusion_gene , Python, 353 linesralization.py - modeling/
06_efm_model_outputs_and , Python, 407 lines, 1 match_surrogates_plots_genera lization.py - modeling/
07_auc_ci_per_feature.py , Python, 1,300 lines, 1 match - modeling/
08R_unimodal_proba_globa , Python, 600 linesl_effect.py - modeling/
__init__.py , Python, 1 line - modeling/
classifiers.py , Python, 355 lines - neuroimaging_metadata/
json_metadata.py , Python, 43 lines - pet/
01_pet_mi_rois.py , Python, 93 lines - pet/
pet_functions.py , Python, 166 lines - preprocessing/
get_eeg_markers.py , Python, 42 lines - preprocessing/
get_eeg_metadata.py , Python, 14 lines - preprocessing/
go.preprocessing.sh , Shell, 8 lines - universal/
__init__.py , Python, 1 line - universal/
universal.py , Python, 823 lines - README.md, Text, 27 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 37 scripts, each with its path and the digest of its content;
- 4 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability
The data are not publicly available. Codes used in the analyses will be made publicly available upon publication at https://
Reproduced under the paper's license (CC BY-NC), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 37 authors, 5 keywords, 14 MeSH terms, 8 funders, 73 references.
Cite
This paper
Manasova, D., Belloli, L. M. L., Rosenfelder, M. J., Willacker, L., Fló Rama, E., Valota, C., Hermann, B., Kaufmann, B. C., Pirastru, A., Derchi, C. C., Raiser, T., Valente, M., Sangare, A., Türker, B., Pyatigorskaya, N., Béranger, B., Colombo, M., Munoz-Musat, E., Escrichs, A., . . . Sitt, J. D. (2026). Multimodal multicentre investigation of diagnostic and prognostic markers in disorders of consciousness. Brain : a journal of neurology, 149(4), 1381-1395. https://
BibTeX
@article{manasova2026mul
author = {Manasova, Dragana and Belloli, Laouen Mayal Louan and Rosenfelder, Martin Justinus and Willacker, Lina and Fló Rama, Emilia and Valota, Chiara and Hermann, Bertrand and Kaufmann, Brigitte Charlotte and Pirastru, Alice and Derchi, Chiara Camilla and Raiser, Theresa and Valente, Melanie and Sangare, Aude and Türker, Başak and Pyatigorskaya, Nadya and Béranger, Benoît and Colombo, Michele and Munoz-Musat, Esteban and Escrichs, Anira and Atzori, Tiziana and Baglio, Francesca and Lapa, Constantin and Berlis, Ansgar and Krüger, Kristina and Luther, Tina and Perlbarg, Vincent and Deco, Gustavo and Sanz-Perl, Yonathan and Tagliazucchi, Enzo and Puybasset, Louis and Rohaut, Benjamin and Naccache, Lionel and Comanducci, Angela and Arzi, Anat and Rosanova, Mario and Bender, Andreas and Sitt, Jacobo Diego},
title = {{Multimodal multicentre investigation of diagnostic and prognostic markers in disorders of consciousness}},
journal = {Brain : a journal of neurology},
year = {2026},
month = apr,
volume = {149},
number = {4},
pages = {1381--1395},
publisher = {Oxford University Press},
issn = {0006-8950},
doi = {10.1093/
url = {https://
pmid = {41499248},
pmcid = {PMC13058464}
}
RIS
TY - JOUR
AU - Manasova, Dragana
AU - Belloli, Laouen Mayal Louan
AU - Rosenfelder, Martin Justinus
AU - Willacker, Lina
AU - Fló Rama, Emilia
AU - Valota, Chiara
AU - Hermann, Bertrand
AU - Kaufmann, Brigitte Charlotte
AU - Pirastru, Alice
AU - Derchi, Chiara Camilla
AU - Raiser, Theresa
AU - Valente, Melanie
AU - Sangare, Aude
AU - Türker, Başak
AU - Pyatigorskaya, Nadya
AU - Béranger, Benoît
AU - Colombo, Michele
AU - Munoz-Musat, Esteban
AU - Escrichs, Anira
AU - Atzori, Tiziana
AU - Baglio, Francesca
AU - Lapa, Constantin
AU - Berlis, Ansgar
AU - Krüger, Kristina
AU - Luther, Tina
AU - Perlbarg, Vincent
AU - Deco, Gustavo
AU - Sanz-Perl, Yonathan
AU - Tagliazucchi, Enzo
AU - Puybasset, Louis
AU - Rohaut, Benjamin
AU - Naccache, Lionel
AU - Comanducci, Angela
AU - Arzi, Anat
AU - Rosanova, Mario
AU - Bender, Andreas
AU - Sitt, Jacobo Diego
TI - Multimodal multicentre investigation of diagnostic and prognostic markers in disorders of consciousness
T2 - Brain : a journal of neurology
J2 - Brain
PY - 2026
DA - 2026/
VL - 149
IS - 4
SP - 1381
EP - 1395
SN - 0006-8950
PB - Oxford University Press
DO - 10.1093/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1093/
"type": "article-journal",
"title": "Multimodal multicentre investigation of diagnostic and prognostic markers in disorders of consciousness",
"container-title": "Brain : a journal of neurology",
"author": [
{
"family": "Manasova",
"given": "Dragana"
},
{
"family": "Belloli",
"given": "Laouen Mayal Louan"
},
{
"family": "Rosenfelder",
"given": "Martin Justinus"
},
{
"family": "Willacker",
"given": "Lina"
},
{
"family": "Fló Rama",
"given": "Emilia"
},
{
"family": "Valota",
"given": "Chiara"
},
{
"family": "Hermann",
"given": "Bertrand"
},
{
"family": "Kaufmann",
"given": "Brigitte Charlotte"
},
{
"family": "Pirastru",
"given": "Alice"
},
{
"family": "Derchi",
"given": "Chiara Camilla"
},
{
"family": "Raiser",
"given": "Theresa"
},
{
"family": "Valente",
"given": "Melanie"
},
{
"family": "Sangare",
"given": "Aude"
},
{
"family": "Türker",
"given": "Başak"
},
{
"family": "Pyatigorskaya",
"given": "Nadya"
},
{
"family": "Béranger",
"given": "Benoît"
},
{
"family": "Colombo",
"given": "Michele"
},
{
"family": "Munoz-Musat",
"given": "Esteban"
},
{
"family": "Escrichs",
"given": "Anira"
},
{
"family": "Atzori",
"given": "Tiziana"
},
{
"family": "Baglio",
"given": "Francesca"
},
{
"family": "Lapa",
"given": "Constantin"
},
{
"family": "Berlis",
"given": "Ansgar"
},
{
"family": "Krüger",
"given": "Kristina"
},
{
"family": "Luther",
"given": "Tina"
},
{
"family": "Perlbarg",
"given": "Vincent"
},
{
"family": "Deco",
"given": "Gustavo"
},
{
"family": "Sanz-Perl",
"given": "Yonathan"
},
{
"family": "Tagliazucchi",
"given": "Enzo"
},
{
"family": "Puybasset",
"given": "Louis"
},
{
"family": "Rohaut",
"given": "Benjamin"
},
{
"family": "Naccache",
"given": "Lionel"
},
{
"family": "Comanducci",
"given": "Angela"
},
{
"family": "Arzi",
"given": "Anat"
},
{
"family": "Rosanova",
"given": "Mario"
},
{
"family": "Bender",
"given": "Andreas"
},
{
"family": "Sitt",
"given": "Jacobo Diego"
}
],
"container-title-short":
"volume": "149",
"issue": "4",
"page": "1381-1395",
"DOI": "10.1093/
"PMID": "41499248",
"PMCID": "PMC13058464",
"ISSN": "0006-8950",
"publisher": "Oxford University Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
1
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.21203/rs.3.rs-9914920/v1 [code]
- Prediction of cognitive performance by demographics, sleep, and brain morphometry: machine learning findings from ENIGMA-Sleep Working GroupJournal: Research Square (preprint)In common: neuromaps, statannotations, XGBoost, 9 other tools, structural MRI / diffusion
- [2] doi:10.1007/s00234-026-04103-8 [code]
- Enhanced detection of subtle cortical abnormalities in focal epilepsy using 7 T MRI surface-based models and graph neural networks.Journal: NeuroradiologyIn common: PyBIDS, statannotations, FreeSurfer, 8 other tools, EEG, structural MRI / diffusion
- [3] doi:10.1186/s12967-026-08108-y [code]
- An explainable multimodal machine learning model for diagnosing disorders of consciousness: evidence from a large multicenter Chinese cohort.Journal: Journal of translational medicineIn common: MNE-Python, pandas, SciPy, 1 other tool, EEG, other condition, 6 references
- [4] doi:10.64898/2026.08.18.26360725 [code]
- Temporal pole blurring in hippocampal sclerosis reflects seizure-disrupted myelinationJournal: medRxiv (preprint)In common: PyBIDS, statannotations, FreeSurfer, 8 other tools, structural MRI / diffusion
- [5] doi:10.1038/s41398-026-04157-5 [code]
- Association of glymphatic function with 40-Hz neural oscillations, systemic metabolic markers, and cognitive performance in healthy aging adults: An EEG and MRI study.Journal: Translational psychiatryIn common: fMRIPrep, PyBIDS, FreeSurfer, 7 other tools, EEG, structural MRI / diffusion
- [6] doi:10.1093/nc/niag043 [code]
- Demographics-robust spontaneous eye blinking slowing in patients with severe acquired brain injury.Journal: Neuroscience of consciousnessIn common: statannotations, MNE-Python, seaborn, 5 other tools, other condition, 3 references
- [7] doi:10.21203/rs.3.rs-9326213/v1 [code]
- Multi-task fMRI outperforms resting-state fMRI for revealing task-invariant organization of the human brainJournal: Research Square (preprint)In common: neuromaps, statannotations, FreeSurfer, 8 other tools
- [8] doi:10.1162/imag.a.1269 [code]
- From early to contemporary normative modeling: Mapping individual differences in neurophysiological signals.Journal: Imaging neuroscience (Cambridge, Mass.)In common: specparam (formerly FOOOF), FreeSurfer, MNE-Python, 8 other tools, EEG
- [9] doi:10.1162/imag.a.1347 [code]
- Neural and behavioural correlates of theory of mind reasoning in five-year-old children born preterm.Journal: Imaging neuroscience (Cambridge, Mass.)In common: fMRIPrep, PyBIDS, FreeSurfer, 7 other tools, other condition
- [10] doi:10.1038/s41586-026-10631-3 [code]
- A prognostic human brain network for diffuse midline glioma.Journal: NatureIn common: neuromaps, FreeSurfer, Nilearn, 7 other tools, other condition, 1 reference
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 37 scripts, and 4 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:d4ee3dac69047cc8…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
