Mind the brain age: How segmentation and template selection reshape structural connectomes.
The 16 matches · 2 of them tie a paragraph to a whole file without given lines: weak matches, whose lines are not tinted
- [1] § Materials and Methods › Tractography pipeline ↔ src/Preprocess_your_images/pre_processing_pipeline_ADNI.sh, lines 309 to 364 · score 0.90 · dwi2fod, dwi2response, msmt_csd, brain mask, FODs, dhollander · Report a mismatch
- [2] § Results › Pipeline-dependent associations ↔ src/Analyze_your_connectomes/results.ipynb, lines 456 to 579 · score 0.80 · ATR MED ACT, ATR LOW ACT, global efficiency, Assigned streamlines, FAST ACT, WMH ACT · Report a mismatch
- [3] § Results › Pipeline-dependent associations ↔ src/Analyze_your_connectomes/results.ipynb, lines 456 to 579 · score 0.79 · MoCA, global efficiency, assigned streamlines, FAST ACT, WMH ACT, scatter · Report a mismatch
- [4] § Materials and Methods › Image preprocessing › Anatomical MRI preprocessing ↔ src/Preprocess_your_images/pre_processing_pipeline_ADNI.sh, lines 53 to 132 · score 0.79 · antsRegistration, DWI volumes, template space, MI, FSL, rigid · Report a mismatch
- [5] § Materials and Methods › Tractography pipeline ↔ src/Generate_your_connectomes/tractography_analysis_ADNI.sh, lines 91 to 162 · score 0.79 · iFOD2, brain mask, MRtrix, backtracking, tckgen, tcksift2 · Report a mismatch
- [6] § Materials and Methods › Image preprocessing › Diffusion MRI preprocessing ↔ src/Preprocess_your_images/pre_processing_pipeline_ADNI.sh, lines 53 to 132 · score 0.72 · MP PCA, brain mask, MRtrix3, ANTs, FSL, preprocessing · Report a mismatch
- [7] § Results › Global network properties ↔ src/Analyze_your_connectomes/results.ipynb, lines 187 to 257 · score 0.68 · global efficiency, assigned streamlines, FAST ACT, WMH ACT, S2, density · Report a mismatch
- [8] § Materials and Methods › Connectome construction and graph-theoretical analysis ↔ src/Generate_your_connectomes/tractography_analysis_ADNI.sh, lines 1 to 52 · score 0.67 · MRtrix3, Tian, Schaefer, S1, parcellations, subcortical · Report a mismatch
- [9] § Materials and Methods › Statistical analysis ↔ Anima/math-tools/statistical_tests/animaFDRCorrection.h, the whole file · a weak match · score 0.67 · Benjamini Hochberg, discovery rate, FDR, thresholds · Report a mismatch
- [10] § Materials and Methods › Data › MRI procedure ↔ Anima/quantitative-mri/mr-simulation/stimulated_spin_echo_simulator/animaStimulatedSpinEchoImageFilter.h, lines 10 to 76 · score 0.64 · spin echo, flip angle, MRI · Report a mismatch
- [11] § Materials and Methods › Connectome construction and graph-theoretical analysis ↔ src/Preprocess_your_images/pre_processing_pipeline_ADNI.sh, lines 1 to 50 · score 0.63 · MRtrix3, Tian, S1, parcellations, subcortical, T1w · Report a mismatch
- [12] § Materials and Methods › Experimental conditions ↔ src/Generate_your_connectomes/tractography_analysis_ADNI.sh, lines 91 to 162 · score 0.62 · TT image, template space, FSL, CSF, tractography, T1w · Report a mismatch
- [13] § Materials and Methods › Statistical analysis ↔ src/Analyze_your_connectomes/extract_connectome_metrics.py, lines 109 to 132 · score 0.62 · Pearson correlation coefficients, connectome metrics, global · Report a mismatch
- [14] § Results › Template effect on nodal network properties ↔ src/Analyze_your_connectomes/results.ipynb, lines 1249 to 1293 · score 0.62 · local efficiency, FAST ACT, WMH ACT, nodal, subcortical, clustering · Report a mismatch
- [15] § Materials and Methods › Statistical analysis ↔ src/Analyze_your_connectomes/results.ipynb, lines 604 to 670 · score 0.57 · connectome metrics, Pearson, sex, MMSE, MoCA, Age · Report a mismatch
- [16] § Materials and Methods › Statistical analysis ↔ Anima/math-tools/statistical_tests/animaFDRCorrection.h, the whole file · a weak match · score 0.51 · Benjamini Hochberg FDR · Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Jupyter notebook · 1,572 lines · 51 KB · MIT · 5 matches
- # %%
- path_to_metrics= #path to the metrics csv file
- save_directory= #path to the directory where you want to save the results
- path_to_clin= #path to the clinical data excel file
- path_to_parcellation= #path to the parcellation txt/csv file
- base_dir = #path to the base directory where the rconnectivity matrices are stored
- # %%
- import os
- import re
- import glob
- import numpy as np
- import pandas as pd
- input_csv = os.path.join(path_to_metrics, "connectome_no_density_metrics_global.csv")
- output_csv = os.path.join(path_to_metrics, "connectome_no_density_metrics_global_with_assigned_streamlines_new.csv")
- technique_mapping = {
- "20": "ATR-LOW-ACT",
- "35": "ATR-MED-ACT",
- "50": "ATR-HIGH-ACT",
- "act": "FAST-ACT",
- "no_act": "NOACT",
- "noact": "NOACT",
- "freesurfer": "WMH-ACT",
- }
- template_mapping = {
- "MNI152NLin2009cAsym": "MNI",
- "MNI": "MNI",
- "MIITRA-MIITRA": "MIITRA",
- "MIITRA": "MIITRA",
- }
- def normalize_excelid(x):
- if pd.isna(x):
- return np.nan
- x = str(x).strip().upper()
- x = x.replace("sub-", "").replace("SUB-", "")
- x = x.replace("_", "").replace("-", "").replace("S", "_S_")
- x = re.sub(r"\.0$", "", x)
- return x
- def normalize_template(x):
- if pd.isna(x):
- return np.nan
- x = str(x).strip()
- return template_mapping.get(x, x)
- def normalize_technique(x):
- if pd.isna(x):
- return np.nan
- x = str(x).strip()
- return technique_mapping.get(x, x)
- def parse_connectome_filename(fname):
- base = os.path.basename(fname)
- m = re.match(
- r"^connectome_10M_(?P<raw_pipeline_id>.+?)_(?P<raw_template>MNI152NLin2009cAsym|MNI|MIITRA)_unassigned\.txt$",
- base
- )
- if m is None:
- return None
- raw_pipeline_id = m.group("raw_pipeline_id")
- raw_template = m.group("raw_template")
- if raw_template in ["MNI152NLin2009cAsym", "MNI"]:
- template = "MNI"
- else:
- template = "MIITRA"
- return {
- "raw_pipeline_id": raw_pipeline_id,
- "technique": normalize_technique(raw_pipeline_id),
- "raw_template": raw_template,
- "template": template,
- }
- def compute_assigned_streamlines(txt_file):
- M = np.loadtxt(txt_file)
- if M.ndim == 1:
- M = np.atleast_2d(M)
- return float(M[1:, 1:].sum())
- df_metrics = pd.read_csv(input_csv).copy()
- if "sparsity" not in df_metrics.columns:
- raise KeyError("La colonna 'sparsity' non è presente nel CSV.")
- df_metrics["sparsity"] = pd.to_numeric(df_metrics["sparsity"], errors="coerce") * 100
- if "assigned_streamlines" in df_metrics.columns:
- df_metrics = df_metrics.drop(columns=["assigned_streamlines"])
- required_cols = ["excel_id", "template", "technique"]
- missing_cols = [c for c in required_cols if c not in df_metrics.columns]
- if missing_cols:
- raise KeyError(f"Mancano queste colonne nel CSV: {missing_cols}")
- df_metrics["excelid_merge"] = df_metrics["excel_id"].map(normalize_excelid)
- df_metrics["template_merge"] = df_metrics["template"].map(normalize_template)
- df_metrics["technique_merge"] = df_metrics["technique"].map(normalize_technique)
- txt_files = glob.glob(os.path.join(base_dir, "sub-*", "dwi", "connectome_10M_*unassigned.txt"))
- rows = []
- for f in sorted(txt_files):
- subject_id = os.path.basename(os.path.dirname(os.path.dirname(f)))
- meta = parse_connectome_filename(f)
- if meta is None:
- continue
- rows.append({
- "excelid_merge": normalize_excelid(subject_id),
- "template_merge": meta["template"],
- "technique_merge": meta["technique"],
- "assigned_streamlines": compute_assigned_streamlines(f) / 100000,
- })
- df_assigned = pd.DataFrame(rows)
- df_assigned = df_assigned.drop_duplicates(
- subset=["excelid_merge", "template_merge", "technique_merge"]
- )
- df_metrics = df_metrics.merge(
- df_assigned,
- on=["excelid_merge", "template_merge", "technique_merge"],
- how="left"
- )
- df_metrics = df_metrics.drop(columns=["excelid_merge", "template_merge", "technique_merge"])
- df_metrics.to_csv(output_csv, index=False)
- display_cols = [
- c for c in [
- "excel_id", "folder_id", "template", "technique",
- "assigned_streamlines", "sparsity"
- ] if c in df_metrics.columns
- ]
- print(df_metrics[display_cols].head())
- print(f"Saved: {output_csv}")
- # %%
- import pandas as pd
- import seaborn as sns
- import matplotlib.pyplot as plt
- import matplotlib.font_manager as fm
- import numpy as np
- from scipy.stats import ttest_ind,ttest_rel,shapiro,wilcoxon
- available_fonts = [f.name for f in fm.fontManager.ttflist]
- print("Font available:")
- for font in sorted([f for f in available_fonts if "Comic" in f or "Impact" in f or "Courier" in f]):
- print(f"- {font}")
- sns.set(style="whitegrid", font_scale=1.1)
- plt.rcParams['font.family'] = 'sans-serif'
- plt.rcParams['font.sans-serif'] = ['Arial', 'Comic Sans MS', 'Impact', 'Courier New']
- plt.rcParams['font.size'] = 12
- plt.rcParams['axes.titlesize'] = 30
- plt.rcParams['axes.labelsize'] = 10
- sns.set(font='Arial')
- plt.figure(figsize=(6, 2))
- plt.text(0.5, 0.5, "Test Font - ABCDEFG 123",
- ha='center', va='center', fontsize=14)
- plt.axis('off')
- plt.tight_layout()
- plt.show()
- # %%
- # ===== BOXPLOT with FDR correction + paired lines =====
- #Figure 3 and S2
- from statsmodels.stats.multitest import fdrcorrection
- import matplotlib as mpl
- import matplotlib.pyplot as plt
- import os
- import pandas as pd
- import seaborn as sns
- import numpy as np
- from scipy.stats import ttest_rel, wilcoxon, shapiro
- mpl.rcParams["font.family"] = "Arial"
- plt.style.use("seaborn-v0_8-whitegrid")
- font_to_use = "Arial"
- df = pd.read_csv(os.path.join(path_to_metrics, "connectome_no_density_metrics_global_with_assigned_streamlines_new.csv")).copy()
- all_results = []
- output_dir = os.path.join(save_directory, "boxplots")
- os.makedirs(output_dir, exist_ok=True)
- metrics = [
- "sparsity",
- "mean_connectivity",
- "assortativity",
- "avg_clustering",
- "global_efficiency",
- "avg_shortest_path",
- "transitivity",
- "assigned_streamlines",
- ]
- technique_mapping = {
- "20": "ATR-LOW-ACT",
- "35": "ATR-MED-ACT",
- "50": "ATR-HIGH-ACT",
- "act": "FAST-ACT",
- "freesurfer": "WMH-ACT",
- "no_act": "NOACT",
- "noact": "NOACT"
- }
- template_mapping = {
- "MNI152NLin2009cAsym": "MNI",
- "MNI": "MNI",
- "MIITRA-MIITRA": "MIITRA",
- "MIITRA": "MIITRA"
- }
- technique_order = [
- "FAST-ACT",
- "ATR-LOW-ACT",
- "ATR-MED-ACT",
- "ATR-HIGH-ACT",
- "WMH-ACT",
- "NOACT"
- ]
- template_order = ["MIITRA", "MNI"]
- df["technique"] = df["technique"].astype(str).map(technique_mapping).fillna(df["technique"].astype(str))
- df["template"] = df["template"].astype(str).map(template_mapping).fillna(df["template"].astype(str))
- df = df[df["technique"].isin(technique_order)].copy()
- df = df[df["template"].isin(template_order)].copy()
- df["technique"] = pd.Categorical(df["technique"], categories=technique_order, ordered=True)
- df["template"] = pd.Categorical(df["template"], categories=template_order, ordered=True)
- techniques = [t for t in technique_order if t in df["technique"].dropna().unique()]
- templates = template_order
- # ===== raw p-values =====
- for metric in metrics:
- for i, tech in enumerate(techniques):
- group = df[df["technique"] == tech]
- template_data = {}
- subjects = []
- for template in templates:
- template_group = group[group["template"] == template]
- template_data[template] = template_group.set_index("excel_id")[metric]
- subjects.append(set(template_group["excel_id"]))
- if len(subjects) < 2:
- continue
- common_subjects = list(subjects[0].intersection(subjects[1]))
- if len(common_subjects) > 1:
- data1 = pd.to_numeric(template_data[templates[0]].loc[common_subjects], errors="coerce").values
- data2 = pd.to_numeric(template_data[templates[1]].loc[common_subjects], errors="coerce").values
- valid = np.isfinite(data1) & np.isfinite(data2)
- data1 = data1[valid]
- data2 = data2[valid]
- if len(data1) > 1:
- diff = data1 - data2
- _, norm_p = shapiro(diff)
- if norm_p > 0.05:
- _, p_val = ttest_rel(data1, data2)
- test_type = "paired t-test"
- else:
- try:
- _, p_val = wilcoxon(data1, data2)
- except ValueError:
- p_val = np.nan
- test_type = "Wilcoxon test"
- print(f"Using {test_type} for {tech} on {metric} with p_raw={p_val:.4f}")
- all_results.append((metric, tech, p_val, i, test_type))
- # ===== Global FDR correction =====
- valid_results = [(m, t, p, pos, test_type) for (m, t, p, pos, test_type) in all_results if pd.notna(p)]
- raw_pvals = [p for (_, _, p, _, _) in valid_results]
- reject, pvals_corrected = fdrcorrection(raw_pvals, alpha=0.05, method='indep')
- corrected_dict = {}
- for (m, t, p_raw, pos, test_type), p_corr, rej in zip(valid_results, pvals_corrected, reject):
- corrected_dict[(m, t)] = (p_raw, p_corr, rej, pos, test_type)
- df_pvalues = pd.DataFrame([
- (m, t, test_type, p_raw, p_corr, rej, pos)
- for (m, t, p_raw, pos, test_type), p_corr, rej in zip(valid_results, pvals_corrected, reject)
- ], columns=["metric", "technique", "test_type", "p_raw", "p_corr", "significant", "pos"])
- df_pvalues.to_csv(os.path.join(output_dir, "pvalues_corrected_global.csv"), index=False)
- # ===== Plotting =====
- for metric in metrics:
- plt.figure(figsize=(10, 6))
- ax = sns.boxplot(
- data=df,
- x="technique",
- y=metric,
- hue="template",
- order=technique_order,
- hue_order=template_order,
- palette="rocket",
- showfliers=False,
- boxprops=dict(facecolor="None", linewidth=1.2),
- whiskerprops=dict(linewidth=1.2),
- capprops=dict(linewidth=1.2),
- medianprops=dict(linewidth=1.4),
- )
- sns.stripplot(
- data=df,
- x="technique",
- y=metric,
- hue="template",
- order=technique_order,
- hue_order=template_order,
- dodge=True,
- jitter=0.12,
- size=3.2,
- alpha=0.65,
- palette="rocket",
- edgecolor="none",
- linewidth=0,
- ax=ax,
- zorder=2
- )
- # paired lines
- box_width = 0.8
- n_hue = len(template_order)
- offsets = np.linspace(-box_width/4, box_width/4, n_hue)
- for i, tech in enumerate(techniques):
- group = df[df["technique"] == tech].copy()
- wide = group.pivot_table(
- index="excel_id",
- columns="template",
- values=metric,
- aggfunc="first"
- )
- if all(t in wide.columns for t in template_order):
- wide = wide.dropna(subset=template_order)
- x1 = i + offsets[0]
- x2 = i + offsets[1]
- for _, row in wide.iterrows():
- ax.plot(
- [x1, x2],
- [row[template_order[0]], row[template_order[1]]],
- color="gray",
- alpha=0.20,
- linewidth=0.7,
- zorder=1
- )
- # remove duplicated legend due to stripplot overlay
- handles, labels = ax.get_legend_handles_labels()
- if len(handles) >= 2:
- ax.legend_.remove()
- y_min, y_max = ax.get_ylim()
- max_box_height = float('-inf')
- for i, tech in enumerate(techniques):
- group = df[df["technique"] == tech]
- for template in templates:
- data = group[group["template"] == template][metric].dropna()
- if len(data) > 1:
- q1, q3 = np.percentile(data, [25, 75])
- iqr = q3 - q1
- upper_whisker = min(data.max(), q3 + 1.5 * iqr)
- max_box_height = max(max_box_height, upper_whisker)
- if not np.isfinite(max_box_height):
- max_box_height = y_max
- spacing = (y_max - y_min) * 0.02
- bar_height = min(max_box_height + spacing, y_max)
- text_height = bar_height + spacing
- for i, tech in enumerate(techniques):
- key = (metric, tech)
- if key in corrected_dict:
- p_raw, p_corr, rej, pos, test_type = corrected_dict[key]
- if rej:
- ax.plot([pos-0.2, pos+0.2], [bar_height, bar_height], 'k-', linewidth=1.5)
- if p_corr < 0.001:
- significance = "§"
- elif p_corr < 0.01:
- significance = "‡"
- else:
- significance = "†"
- ax.text(
- pos, text_height, significance,
- ha="center", va="bottom",
- fontsize=14, fontname=font_to_use
- )
- ax.set_ylim(y_min, max_box_height + (y_max - y_min) * 0.1)
- plt.xlabel("Pipeline", fontsize=14, fontname=font_to_use)
- plt.ylabel(metric.replace("_", " ").capitalize(), fontsize=14, fontname=font_to_use)
- plt.xticks(rotation=25, ha='right', fontsize=9, fontname=font_to_use)
- labels = ax.get_xticklabels()
- plt.setp(labels, ha="center", rotation_mode="anchor", position=(0, -0.05))
- # single legend
- if metric == "sparsity":
- legend_handles = handles[:2]
- legend_labels = labels[:2]
- lg = ax.legend(legend_handles, legend_labels, title="Template")
- plt.setp(lg.get_title(), fontname=font_to_use)
- plt.setp(lg.get_texts(), fontname=font_to_use)
- else:
- lg = ax.get_legend()
- if lg is not None:
- lg.remove()
- plt.tight_layout()
- outpath = os.path.join(output_dir, f"{metric}_boxplot.png")
- plt.savefig(outpath, dpi=300, bbox_inches="tight")
- plt.close()
- # %%
- # ===== SCATTERPLOTS =====
- # Figure 4a and Figures S3a-S6a
- import os, re
- from scipy.stats import pearsonr
- import numpy as np
- import matplotlib as mpl
- import matplotlib.pyplot as plt
- import seaborn as sns
- import pandas as pd
- mpl.rcParams["font.family"] = "Arial"
- plt.style.use("seaborn-v0_8-whitegrid")
- df_conn = #data frame containing the connectome metrics
- df_clin = #data frame containing the clinical data
- # Merge su excel_id / Subject
- df = pd.merge(df_conn, df_clin, left_on="excel_id", right_on="Subject")
- technique_mapping = {
- "20": "ATR-LOW-ACT",
- "35": "ATR-MED-ACT",
- "50": "ATR-HIGH-ACT",
- "act": "FAST-ACT",
- "freesurfer": "WMH-ACT",
- "no_act": "NOACT",
- "noact": "NOACT"
- }
- template_mapping = {
- "MNI152NLin2009cAsym": "MNI",
- "MNI": "MNI",
- "MIITRA-MIITRA": "MIITRA",
- "MIITRA": "MIITRA"
- }
- technique_order = [
- "FAST-ACT",
- "ATR-LOW-ACT",
- "ATR-MED-ACT",
- "ATR-HIGH-ACT",
- "WMH-ACT",
- "NOACT"
- ]
- template_order = ["MIITRA", "MNI"]
- df["technique"] = df["technique"].astype(str).map(technique_mapping).fillna(df["technique"].astype(str))
- df["template"] = df["template"].astype(str).map(template_mapping).fillna(df["template"].astype(str))
- df = df[df["technique"].isin(technique_order)].copy()
- df = df[df["template"].isin(template_order)].copy()
- df["technique"] = pd.Categorical(df["technique"], categories=technique_order, ordered=True)
- df["template"] = pd.Categorical(df["template"], categories=template_order, ordered=True)
- metrics = [
- "sparsity", "mean_connectivity", "assortativity", "avg_clustering",
- "global_efficiency", "avg_shortest_path", "transitivity","assigned_streamlines",
- ]
- clinical_vars = ["WMH_WM", "PET_CENTILOID", "MMSE", "MOCA"]
- clinical_vars_mapping = {
- "WMH_WM": "WMHB (%)",
- "PET_CENTILOID": "Amyloid PET Centiloid",
- "MMSE": "MMSE Score",
- "MOCA": "MoCA Score"
- }
- palette = dict(zip(technique_order, sns.color_palette("tab10", n_colors=len(technique_order))))
- output_dir = os.path.join(save_directory, "scatterplots")
- os.makedirs(output_dir, exist_ok=True)
- for metric in metrics:
- for clinical_var in clinical_vars:
- display_clin = clinical_vars_mapping.get(clinical_var, clinical_var)
- safe_display = re.sub(r"[^A-Za-z0-9_-]+", "_", display_clin).strip("_")
- for template in template_order:
- subset_template = df[df["template"] == template].copy()
- if subset_template.empty:
- continue
- plt.figure(figsize=(10, 6))
- plt.title(f"{template}", fontsize=20)
- plt.xlabel(display_clin, fontsize=16)
- plt.ylabel(metric.replace("_", " ").capitalize(), fontsize=16)
- handles, labels = [], []
- for tech in technique_order:
- subset = subset_template[subset_template["technique"] == tech]
- if subset.empty:
- continue
- x = pd.to_numeric(subset[clinical_var], errors="coerce")
- y = pd.to_numeric(subset[metric], errors="coerce")
- valid = x.notna() & y.notna()
- x, y = x[valid], y[valid]
- if len(x) == 0:
- continue
- plt.scatter(x, y, color=palette[tech], alpha=0.6)
- if len(x) > 1 and x.nunique() > 1 and y.nunique() > 1:
- m, b = np.polyfit(x, y, 1)
- x_sorted = np.array(sorted(x), dtype=np.float64)
- line = plt.plot(x_sorted, m * x_sorted + b, color=palette[tech], linestyle="--")
- r, p = pearsonr(x, y)
- labels.append(f"{tech} (R²={r**2:.2f})")
- handles.append(line[0])
- if handles:
- plt.legend(handles=handles, labels=labels, title="Pipeline")
- plt.tight_layout()
- filename = f"{metric}_vs_{safe_display}_{template}.png"
- filepath = os.path.join(output_dir, filename)
- plt.savefig(filepath, dpi=300)
- plt.close()
- # %%
- # ============================================
- # LMM for slopes + q-values + Pearson r
- # ============================================
- # Figure 4b, Figures S3b-S6b
- import os, numpy as np, pandas as pd, itertools
- import matplotlib.pyplot as plt
- import seaborn as sns
- from scipy.stats import chi2, norm, pearsonr
- import statsmodels.formula.api as smf
- from statsmodels.stats.multitest import multipletests
- import matplotlib as mpl
- mpl.rcParams["font.family"] = "Arial"
- plt.style.use("default")
- TITLE_FONTSIZE = 18
- AXIS_LABEL_FONTSIZE = 18
- TICK_FONTSIZE = 22
- ANNOT_FONTSIZE = 20
- CBAR_LABEL_FONTSIZE = 18
- CBAR_TICK_FONTSIZE = 18
- # ============== CONFIG ==============
- output_dir = os.path.join(save_directory, "PIPELINE_LMM")
- os.makedirs(output_dir, exist_ok=True)
- os.makedirs(os.path.join(output_dir, "heatmaps"), exist_ok=True)
- os.makedirs(os.path.join(output_dir, "slopes"), exist_ok=True)
- os.makedirs(os.path.join(output_dir, "pearson"), exist_ok=True)
- df_conn = # data frame containing the connectome metrics
- df_clin = # data frame containing the clinical data
- df = pd.merge(df_conn, df_clin, left_on="excel_id", right_on="Subject")
- metrics = [
- "sparsity", "mean_connectivity", "assortativity", "avg_clustering",
- "global_efficiency", "avg_shortest_path", "transitivity", "assigned_streamlines"
- ]
- technique_mapping = {
- "20": "ATR-LOW-ACT",
- "35": "ATR-MED-ACT",
- "50": "ATR-HIGH-ACT",
- "act": "FAST-ACT",
- "freesurfer": "WMH-ACT",
- "no_act": "NOACT",
- "noact": "NOACT"
- }
- templates_mapping = {
- "MNI152NLin2009cAsym": "MNI",
- "MNI": "MNI",
- "MIITRA-MIITRA": "MIITRA",
- "MIITRA": "MIITRA"
- }
- technique_order = [
- "FAST-ACT",
- "ATR-LOW-ACT",
- "ATR-MED-ACT",
- "ATR-HIGH-ACT",
- "WMH-ACT",
- "NOACT"
- ]
- template_order = ["MIITRA", "MNI"]
- pipeline_order = [
- f"{template}-{technique}"
- for template in template_order
- for technique in technique_order
- ]
- df["template"] = df["template"].astype(str).map(templates_mapping).fillna(df["template"].astype(str))
- df["technique"] = df["technique"].astype(str).map(technique_mapping).fillna(df["technique"].astype(str))
- df = df[df["template"].isin(template_order)].copy()
- df = df[df["technique"].isin(technique_order)].copy()
- clinical_vars = [
- "WMH_WM",
- "PET_CENTILOID",
- "MMSE",
- "MOCA"
- ]
- covariates = ["Age", "Sex", "CEREBRUM_TCV"]
- rename_map = {}
- FALLBACK_OLS = True
- # ============== PREP DATA ==============
- if rename_map:
- df = df.rename(columns=rename_map)
- needed_base = ["Subject", "template", "technique"] + covariates
- missing = [c for c in needed_base if c not in df.columns]
- if missing:
- raise KeyError(f"Missing required columns: {missing}")
- df["template"] = pd.Categorical(df["template"], categories=template_order, ordered=True)
- df["technique"] = pd.Categorical(df["technique"], categories=technique_order, ordered=True)
- df["pipeline"] = df["template"].astype(str) + "-" + df["technique"].astype(str)
- df["pipeline"] = pd.Categorical(df["pipeline"], categories=pipeline_order, ordered=True)
- df["Sex"] = df["Sex"].astype("category")
- # ============== HELPER ==============
- def linear_combo(fe_params, cov, terms, sign=None):
- names = fe_params.index.tolist()
- L = np.zeros(len(names))
- if sign is None:
- sign = [1.0] * len(terms)
- for t, s in zip(terms, sign):
- if t in names:
- L[names.index(t)] += s
- est = float(L @ fe_params.values)
- var = float(L @ cov.values @ L)
- se = np.sqrt(max(var, 0.0))
- z = est / se if se > 0 else np.nan
- p = 2 * (1 - norm.cdf(abs(z))) if np.isfinite(z) else np.nan
- zcrit = norm.ppf(0.975)
- low, high = est - zcrit * se, est + zcrit * se
- return est, se, z, p, low, high
- def slope_terms_for_pipeline(clinical, level, baseline_level):
- if level == baseline_level:
- return [clinical]
- return [clinical, f"{clinical}:C(pipeline)[T.{level}]"]
- def build_pairwise_q_matrix(fe_params, cov, clinical, pipe_levels):
- baseline = pipe_levels[0]
- pairs, pvals = [], []
- for i, j in itertools.combinations(pipe_levels, 2):
- terms_i = slope_terms_for_pipeline(clinical, i, baseline)
- terms_j = slope_terms_for_pipeline(clinical, j, baseline)
- terms = terms_i + terms_j
- signs = [1.0] * len(terms_i) + [-1.0] * len(terms_j)
- est, se, z, p, low, high = linear_combo(fe_params, cov, terms, signs)
- pairs.append((i, j))
- pvals.append(p)
- pvals = np.array(pvals, dtype=float)
- ok = np.isfinite(pvals)
- qvals = np.full_like(pvals, np.nan)
- if ok.sum() > 0:
- _, q_ok, _, _ = multipletests(pvals[ok], method="fdr_bh")
- qvals[ok] = q_ok
- qmat = pd.DataFrame(np.nan, index=pipe_levels, columns=pipe_levels)
- for (i, j), q in zip(pairs, qvals):
- qmat.loc[i, j] = q
- qmat.loc[j, i] = q
- np.fill_diagonal(qmat.values, np.nan)
- return qmat
- def omnibus_chisq_for_interaction(fe_params, cov, clinical, pipe_levels):
- names = fe_params.index.tolist()
- baseline = pipe_levels[0]
- inter_names = [f"{clinical}:C(pipeline)[T.{lvl}]" for lvl in pipe_levels if lvl != baseline]
- idx = [names.index(nm) for nm in inter_names if nm in names]
- if len(idx) == 0:
- return np.nan, np.nan, 0
- b = fe_params.values[idx]
- S = cov.values[np.ix_(idx, idx)]
- try:
- stat = float(b.T @ np.linalg.inv(S) @ b)
- df_omni = len(idx)
- p = 1 - chi2.cdf(stat, df_omni)
- return stat, p, df_omni
- except np.linalg.LinAlgError:
- return np.nan, np.nan, len(idx)
- def q_to_star(q):
- if q < 0.001:
- return "§"
- elif q < 0.01:
- return "‡"
- elif q < 0.05:
- return "†"
- return ""
- # ============== MAIN LOOP ==============
- for metric in metrics:
- if metric not in df.columns:
- print(f"⚠️ Missing metric, skipping: {metric}")
- continue
- for clinical in clinical_vars:
- if clinical not in df.columns:
- print(f"⚠️ Missing clinical variable, skipping: {clinical}")
- continue
- needed = [metric, clinical, "Subject", "pipeline"] + covariates
- dat = df.dropna(subset=[c for c in needed if c in df.columns]).copy()
- if dat.empty:
- print(f"⚠️ Missing data for {metric} ~ {clinical}.")
- continue
- counts = dat.groupby("Subject").size()
- dat = dat[dat["Subject"].isin(counts[counts >= 2].index)].copy()
- if dat["Subject"].nunique() < 2:
- print(f"⚠️ Too few subjects with ≥2 observations for {metric} ~ {clinical}.")
- continue
- dat["pipeline"] = pd.Categorical(dat["pipeline"], categories=pipeline_order, ordered=True)
- dat["pipeline"] = dat["pipeline"].cat.remove_unused_categories()
- dat["Sex"] = dat["Sex"].astype("category")
- pipe_levels = dat["pipeline"].cat.categories.tolist()
- if len(pipe_levels) < 2:
- print(f"⚠️ Less than 2 pipelines present in the data for {metric} ~ {clinical}.")
- continue
- formula = f"{metric} ~ {clinical} * C(pipeline) + Age + C(Sex) + CEREBRUM_TCV"
- fit_obj = None
- model_used = None
- try:
- md = smf.mixedlm(formula, data=dat, groups=dat["Subject"])
- fit_obj = md.fit(reml=True, method="lbfgs", maxiter=2000)
- model_used = "MixedLM"
- except Exception as e:
- if FALLBACK_OLS:
- try:
- ols = smf.ols(formula, data=dat).fit(
- cov_type="cluster",
- cov_kwds={"groups": dat["Subject"]}
- )
- fit_obj = ols
- model_used = "OLS_cluster"
- print(f"ℹ️ Fallback OLS cluster for {metric} ~ {clinical}: {e}")
- except Exception as e2:
- print(f"❌ Fit failed also for OLS ({metric} ~ {clinical}): {e2}")
- continue
- else:
- print(f"❌ Fit MixedLM failed for {metric} ~ {clinical}: {e}")
- continue
- fe = fit_obj.params
- cov = fit_obj.cov_params()
- stat, p_omni, df_omni = omnibus_chisq_for_interaction(fe, cov, clinical, pipe_levels)
- baseline = pipe_levels[0]
- rows = []
- for lvl in pipe_levels:
- terms = slope_terms_for_pipeline(clinical, lvl, baseline)
- est, se, z, p, low, high = linear_combo(fe, cov, terms)
- rows.append({
- "metric": metric,
- "clinical_var": clinical,
- "pipeline": lvl,
- "slope": est,
- "se": se,
- "z": z,
- "p": p,
- "ci_low": low,
- "ci_high": high,
- "model": model_used,
- "omnibus_chi2": stat,
- "omnibus_df": df_omni,
- "omnibus_p": p_omni,
- "n_rows": dat.shape[0],
- "n_subjects": dat["Subject"].nunique()
- })
- slopes_df = pd.DataFrame(rows)
- slopes_path = os.path.join(
- output_dir,
- "slopes",
- f"SLOPES__{metric}__{clinical}.csv".replace(" ", "_")
- )
- slopes_df.to_csv(slopes_path, index=False)
- qmat = build_pairwise_q_matrix(fe, cov, clinical, pipe_levels)
- qcsv = os.path.join(
- output_dir,
- "heatmaps",
- f"PAIRWISE_Q__{metric}__{clinical}.csv".replace(" ", "_")
- )
- qmat.to_csv(qcsv)
- annot_mat = qmat.copy().astype(str)
- for i in range(qmat.shape[0]):
- for j in range(qmat.shape[1]):
- val = qmat.iloc[i, j]
- annot_mat.iloc[i, j] = q_to_star(val) if np.isfinite(val) else ""
- mask = np.triu(np.ones_like(qmat, dtype=bool), k=1)
- fig, ax = plt.subplots(figsize=(1.2 * len(pipe_levels), 1.0 * len(pipe_levels)))
- hm = sns.heatmap(
- qmat.astype(float),
- annot=annot_mat,
- fmt="",
- cmap="viridis_r",
- vmin=0,
- vmax=0.25,
- mask=mask,
- square=True,
- cbar_kws={"label": "q (BH)", "shrink": 0.9, "pad": 0.02},
- annot_kws={"fontsize": ANNOT_FONTSIZE, "fontweight": "bold"}
- )
- ax.tick_params(axis="x", labelsize=TICK_FONTSIZE, rotation=90)
- ax.tick_params(axis="y", labelsize=TICK_FONTSIZE, rotation=0)
- cbar = hm.collections[0].colorbar
- cbar.ax.tick_params(labelsize=CBAR_TICK_FONTSIZE)
- cbar.set_label("q (BH)", fontsize=CBAR_LABEL_FONTSIZE)
- plt.tight_layout()
- qpng = os.path.join(
- output_dir,
- "heatmaps",
- f"PAIRWISE_Q__{metric}__{clinical}.png".replace(" ", "_")
- )
- plt.savefig(qpng, dpi=200)
- plt.close()
- corr_rows = []
- for lvl in pipe_levels:
- sub = dat[dat["pipeline"] == lvl]
- x = pd.to_numeric(sub[clinical], errors="coerce")
- y = pd.to_numeric(sub[metric], errors="coerce")
- mask_xy = x.notna() & y.notna()
- x, y = x[mask_xy], y[mask_xy]
- if len(x) >= 3:
- r, p_r = pearsonr(x, y)
- corr_rows.append({
- "metric": metric,
- "clinical_var": clinical,
- "pipeline": lvl,
- "r": r,
- "r2": r**2,
- "n": len(x),
- "p_r": p_r
- })
- else:
- corr_rows.append({
- "metric": metric,
- "clinical_var": clinical,
- "pipeline": lvl,
- "r": np.nan,
- "r2": np.nan,
- "n": len(x),
- "p_r": np.nan
- })
- corr_df = pd.DataFrame(corr_rows)
- corr_path = os.path.join(
- output_dir,
- "pearson",
- f"PEARSON__{metric}__{clinical}.csv".replace(" ", "_")
- )
- corr_df.to_csv(corr_path, index=False)
- print(
- f"✅ {metric} ~ {clinical} | model={model_used} | omnibus p={p_omni:.3g} | "
- f"slopes→ {os.path.basename(slopes_path)} | heatmap→ {os.path.basename(qpng)}"
- )
- # %%
- # ============================================
- # OMNIBUS SUMMARY
- # ============================================
- # Table S2 and figure 5
- import os, re, glob
- import numpy as np
- import pandas as pd
- import matplotlib.pyplot as plt
- import seaborn as sns
- from statsmodels.stats.multitest import multipletests
- mpl.rcParams["font.family"] = "Arial"
- plt.style.use("default")
- # ========== CONFIG ==========
- base_dir = os.path.join(save_directory,"PIPELINE_LMM")
- slopes_dir = os.path.join(base_dir, "slopes")
- heatm_dir = os.path.join(base_dir, "heatmaps")
- out_dir = os.path.join(base_dir, "summary")
- os.makedirs(out_dir, exist_ok=True)
- ALPHA_FDR = 0.05 # q-values threshold
- # ========== 1) LOAD SLOPES__*.csv AND BUILD OMNIBUS TABLE ==========
- rows = []
- files = sorted(glob.glob(os.path.join(slopes_dir, "SLOPES__*.csv")))
- if not files:
- raise FileNotFoundError(f"No SLOPES__*.csv files found in {slopes_dir}")
- for f in files:
- df = pd.read_csv(f)
- if df.empty:
- continue
- head = df.iloc[0]
- metric = head["metric"]
- clin = head["clinical_var"]
- chi2 = head.get("omnibus_chi2", np.nan)
- df_ = head.get("omnibus_df", np.nan)
- p_omni = head.get("omnibus_p", np.nan)
- model = head.get("model", "")
- n_rows = head.get("n_rows", df.shape[0])
- n_subj = head.get("n_subjects", np.nan)
- n_pipe = df["pipeline"].nunique() if "pipeline" in df.columns else np.nan
- rows.append({
- "metric": metric,
- "clinical_var": clin,
- "omnibus_chi2": chi2,
- "omnibus_df": df_,
- "omnibus_p": p_omni,
- "model": model,
- "n_rows": n_rows,
- "n_subjects": n_subj,
- "n_pipeline": n_pipe,
- "slopes_path": os.path.basename(f)
- })
- omni = pd.DataFrame(rows).sort_values(["metric","clinical_var"]).reset_index(drop=True)
- # FDR BH on omnibus p values
- omni["q_bh_omnibus"] = np.nan
- p = omni["omnibus_p"].to_numpy(dtype=float)
- ok = np.isfinite(p)
- if ok.sum() > 0:
- _, q, _, _ = multipletests(p[ok], method="fdr_bh")
- omni.loc[ok, "q_bh_omnibus"] = q
- # save full omnibus table
- omni_csv = os.path.join(out_dir, "omnibus_summary.csv")
- omni.to_csv(omni_csv, index=False)
- print(f"✅ Salvato: {omni_csv}")
- pivot = omni.pivot_table(index="metric", columns="clinical_var", values="q_bh_omnibus", aggfunc="first")
- pivot_csv = os.path.join(out_dir, "omnibus_q_matrix.csv")
- pivot.to_csv(pivot_csv)
- print(f"✅ Saved: {pivot_csv}")
- # %%
- # ============================
- # MERGE SLOPES + PEARSON (r, r2, p_r)
- # ============================
- #Table S3-S6
- import os, re, glob
- import numpy as np
- import pandas as pd
- from statsmodels.stats.multitest import multipletests
- # --- CONFIG ---
- base_dir = os.path.join(save_directory, "PIPELINE_LMM")
- slopes_dir = os.path.join(base_dir, "slopes")
- pearson_dir = os.path.join(base_dir, "pearson")
- out_dir = os.path.join(base_dir, "summary")
- os.makedirs(out_dir, exist_ok=True)
- def add_fdr(group, pcol, qcol):
- p = pd.to_numeric(group[pcol], errors="coerce").to_numpy()
- ok = np.isfinite(p)
- q = np.full_like(p, np.nan, dtype=float)
- if ok.sum() > 0:
- _, q_vals, _, _ = multipletests(p[ok], method="fdr_bh")
- q[ok] = q_vals
- group[qcol] = q
- return group
- # --- Utility ---
- pat = re.compile(r"__(?P<metric>.+?)__(?P<clin>.+?)\.csv$", flags=re.IGNORECASE)
- def parse_metric_clin(path_or_name: str):
- m = pat.search(os.path.basename(path_or_name).replace(" ", "_"))
- if m:
- return m.group("metric").replace("_", " "), m.group("clin").replace("_", " ")
- return None, None
- # ========== 1) Upload SLOPES ==========
- s_files = sorted(glob.glob(os.path.join(slopes_dir, "SLOPES__*.csv")))
- if not s_files:
- raise FileNotFoundError(f"NO file SLOPES__*.csv in {slopes_dir}")
- slopes_rows = []
- for f in s_files:
- df = pd.read_csv(f)
- if df.empty:
- continue
- if not {"metric","clinical_var"} <= set(df.columns):
- met, clin = parse_metric_clin(f)
- if "metric" not in df.columns: df["metric"] = met
- if "clinical_var" not in df.columns: df["clinical_var"] = clin
- if "pipeline" in df.columns:
- df["pipeline"] = df["pipeline"].astype(str).str.strip()
- if "p" in df.columns:
- df = df.rename(columns={"p": "p_slope"})
- rename_map = {
- "ci_low":"slope_ci_low","ci_lower":"slope_ci_low",
- "ci_high":"slope_ci_high","ci_upper":"slope_ci_high"
- }
- df = df.rename(columns={k:v for k,v in rename_map.items() if k in df.columns})
- keep_cols = [c for c in [
- "metric","clinical_var","pipeline",
- "slope","slope_ci_low","slope_ci_high","p_slope",
- "model","n_rows","n_subjects"
- ] if c in df.columns]
- slopes_rows.append(df[keep_cols])
- slopes_all = pd.concat(slopes_rows, ignore_index=True)
- if "p_slope" in slopes_all.columns:
- slopes_all = slopes_all.groupby(["metric","clinical_var"], as_index=False)\
- .apply(add_fdr, pcol="p_slope", qcol="q_slope_bh")\
- .reset_index(drop=True)
- # ========== 2) Upload PEARSON (metric, clinical_var, pipeline, r, r2, n, p_r) ==========
- p_files = sorted(glob.glob(os.path.join(pearson_dir, "PEARSON__*.csv")))
- pearson_rows = []
- for f in p_files:
- df = pd.read_csv(f)
- if df.empty:
- continue
- if not {"metric","clinical_var"} <= set(df.columns):
- met, clin = parse_metric_clin(f)
- if "metric" not in df.columns: df["metric"] = met
- if "clinical_var" not in df.columns: df["clinical_var"] = clin
- if "pipeline" in df.columns:
- df["pipeline"] = df["pipeline"].astype(str).str.strip()
- # p_r -> p_pearson ; r -> r_pearson ; r2 e n
- rename_map = {"r":"r_pearson", "p_r":"p_pearson"}
- df = df.rename(columns=rename_map)
- keep_cols = [c for c in [
- "metric","clinical_var","pipeline",
- "r_pearson","r2","n","p_pearson"
- ] if c in df.columns]
- pearson_rows.append(df[keep_cols])
- pearson_all = pd.DataFrame()
- if pearson_rows:
- pearson_all = pd.concat(pearson_rows, ignore_index=True)
- if "p_pearson" in pearson_all.columns:
- pearson_all = pearson_all.groupby(["metric","clinical_var"], as_index=False)\
- .apply(add_fdr, pcol="p_pearson", qcol="q_pearson_bh")\
- .reset_index(drop=True)
- # ========== 3) Merge(metric, clinical_var, pipeline) ==========
- if pearson_all.empty:
- merged = slopes_all.copy()
- else:
- merged = pd.merge(
- slopes_all, pearson_all,
- on=["metric","clinical_var","pipeline"],
- how="outer",
- validate="m:m"
- )
- # Saving
- sort_cols = [c for c in ["metric","clinical_var","pipeline"] if c in merged.columns]
- merged = merged.sort_values(sort_cols).reset_index(drop=True)
- out_csv = os.path.join(out_dir, "SLOPES_PEARSON__merged_long.csv")
- merged.to_csv(out_csv, index=False)
- print(f"✅ Saved: {out_csv}")
- # %%
- # ============================================
- # csv file for brain regions
- # ============================================
- import pandas as pd
- txt_path = # txt file containing the brain region labels
- with open(txt_path, "r") as f:
- lines = [line.strip() for line in f if line.strip()]
- records = []
- for i in range(0, len(lines), 2):
- label = lines[i]
- parts = lines[i+1].split()
- idx = int(parts[0]) - 1 # 🔑 shift da 1-based → 0-based
- r,g,b,a = map(int, parts[1:])
- records.append((idx, label, r,g,b,a))
- df = pd.DataFrame(records, columns=["node","label","R","G","B","A"])
- def parse_network(label, node):
- if node < 16: # primi 16 nodi = Subcortical
- return "Subcortical"
- if "Vis" in label: return "Vis"
- if "SomMot" in label: return "SomMot"
- if "DorsAttn" in label: return "DorsAttn"
- if "SalVentAttn" in label: return "SalVentAttn"
- if "Limbic" in label: return "Limbic"
- if "Cont" in label: return "Cont"
- if "Default" in label: return "Default"
- return "Unknown"
- df["network7"] = [parse_network(lab, n) for lab,n in zip(df["label"], df["node"])]
- # Saving CSV
- csv_path = os.path.join(path_to_parcellation, "Schaefer/Cortex-Subcortex/Schaefer2018_400Parcels_7Networks_withSubcortical.csv")
- df.to_csv(csv_path, index=False)
- print("Saved:", csv_path)
- print("Noded min:", df["node"].min(), "max:", df["node"].max(), "count:", df["node"].nunique())
- # %%
- # ============================================
- # Template effect on nodal metrics
- # ============================================
- # Figure 6 and Figure S7
- import os, itertools, numpy as np, pandas as pd
- import matplotlib as mpl
- import matplotlib.pyplot as plt
- import seaborn as sns
- import statsmodels.formula.api as smf
- from statsmodels.stats.multitest import multipletests
- from scipy.stats import norm
- import matplotlib.patches as mpatches
- import matplotlib.ticker as mtick
- # ---------- FONT & STYLE ----------
- FONT_FAMILY = "Arial"
- BASE_FONT_SZ = 10
- TITLE_SIZE = 22
- LABEL_SIZE = 22
- TICK_SIZE = 22
- LEGEND_SIZE = 20
- XTICK_ROT = 90
- mpl.rcParams.update({
- "font.family": FONT_FAMILY,
- "font.size": BASE_FONT_SZ,
- "axes.titlesize": TITLE_SIZE,
- "axes.labelsize": LABEL_SIZE,
- "xtick.labelsize": TICK_SIZE,
- "ytick.labelsize": TICK_SIZE,
- "legend.fontsize": LEGEND_SIZE,
- })
- plt.style.use("default")
- # ---------- PATHS ----------
- base_out = os.path.join(save_directory, "NODAL_TEMPLATE_EFFECT")
- dirs = {
- "root": base_out,
- "estimates": os.path.join(base_out, "estimates"),
- "pairwise_node": os.path.join(base_out, "pairwise_node"),
- "heatmaps": os.path.join(base_out, "heatmaps"),
- "summaries": os.path.join(base_out, "summaries"),
- }
- for d in dirs.values():
- os.makedirs(d, exist_ok=True)
- node_csv = os.path.join(path_to_metrics, "connectome_no_density_metrics_local.csv")
- # Yeo-7 mapping
- yeo7_csv = os.path.join(
- path_to_parcellation,
- "Schaefer/Cortex-Subcortex/Schaefer2018_400Parcels_7Networks_withSubcortical.csv"
- )
- # ---------- PARAMS ----------
- FALLBACK_OLS = True
- ALPHA = 0.001
- NODES_TO_RUN = None
- NET_STRIPE_WIDTH = 0.18
- # Nodal metrics
- metrics = ["degree", "strength", "clustering", "betweenness", "closeness", "local_efficiency"]
- # Covariates
- covariates = ["Age", "Sex", "CEREBRUM_TCV"]
- # Mapping
- technique_mapping = {
- "20": "ATR-LOW-ACT",
- "35": "ATR-MED-ACT",
- "50": "ATR-HIGH-ACT",
- "act": "FAST-ACT",
- "freesurfer": "WMH-ACT",
- "no_act": "NOACT",
- "noact": "NOACT"
- }
- templates_mapping = {
- "MNI152NLin2009cAsym": "MNI",
- "MNI": "MNI",
- "MIITRA-MIITRA": "MIITRA",
- "MIITRA": "MIITRA"
- }
- technique_order = [
- "FAST-ACT",
- "ATR-LOW-ACT",
- "ATR-MED-ACT",
- "ATR-HIGH-ACT",
- "WMH-ACT",
- "NOACT"
- ]
- template_order = ["MNI", "MIITRA"]
- # ---------- COLOR LUT PER NETWORK ----------
- net_order = ["Subcortical", "Vis", "SomMot", "DorsAttn",
- "SalVentAttn", "Limbic", "Cont", "Default", "Unknown"]
- lut = {
- "Subcortical": (0.894, 0.102, 0.110),
- "Vis": (0.216, 0.494, 0.722),
- "SomMot": (0.302, 0.686, 0.290),
- "DorsAttn": (0.596, 0.306, 0.639),
- "SalVentAttn": (1.000, 0.498, 0.0),
- "Limbic": (1.000, 1.000, 0.200),
- "Cont": (0.651, 0.337, 0.157),
- "Default": (0.969, 0.506, 0.749),
- "Unknown": (0.70, 0.70, 0.70),
- }
- # ---------- LOAD ----------
- df_node = # data frame containing the nodal metrics
- df_clin = # data frame containing the clinical data
- # Merge
- merge_keys_node = [c for c in ["excel_id", "Subject", "subject", "SUBJECT_ID"] if c in df_node.columns]
- merge_keys_clin = [c for c in ["Subject", "excel_id", "subject", "SUBJECT_ID"] if c in df_clin.columns]
- if not merge_keys_node or not merge_keys_clin:
- raise KeyError("Non trovo una chiave comune per il merge (es. 'excel_id' o 'Subject').")
- left_key, right_key = merge_keys_node[0], merge_keys_clin[0]
- df = pd.merge(df_node, df_clin, left_on=left_key, right_on=right_key, how="inner")
- # Mapping/casting
- df["template"] = df["template"].astype(str).map(templates_mapping).fillna(df["template"].astype(str))
- df["technique"] = df["technique"].astype(str).map(technique_mapping).fillna(df["technique"].astype(str))
- df = df[df["template"].isin(template_order)].copy()
- df = df[df["technique"].isin(technique_order)].copy()
- df["template"] = pd.Categorical(df["template"], categories=template_order, ordered=True)
- df["technique"] = pd.Categorical(df["technique"], categories=technique_order, ordered=True)
- df["Sex"] = df["Sex"].astype("category")
- n_nodes = int(df["node"].nunique())
- node_list = sorted(df["node"].unique()) if NODES_TO_RUN is None else list(NODES_TO_RUN)
- # ---------- YEO-7 ANNOTATIONS (con auto-detect 0/1-based) ----------
- node_ann = pd.read_csv(yeo7_csv)
- node_ann_sub = node_ann[["node", "network7"]].copy()
- node_ann_sub["node"] = node_ann_sub["node"].astype(int)
- node_ann_sub = node_ann_sub.drop_duplicates(subset=["node"], keep="first")
- eff_nodes_all = pd.Index(df["node"].unique()).astype(int)
- ann_nodes_all = pd.Index(node_ann_sub["node"].unique()).astype(int)
- if set(eff_nodes_all).issubset(set((ann_nodes_all - 1).tolist())) and 0 in eff_nodes_all:
- node_ann_sub["node"] = node_ann_sub["node"] - 1
- node_ann_sub["network7"] = node_ann_sub["network7"].replace({"SUBCORTICAL": "Subcortical"})
- node_ann_sub["network7"] = node_ann_sub["network7"].fillna("Unknown")
- # ---------- HELPERS ----------
- def linear_combo(fe_params, cov, terms, signs=None):
- names = fe_params.index.tolist()
- L = np.zeros(len(names))
- if signs is None:
- signs = [1.0] * len(terms)
- for t, s in zip(terms, signs):
- if t in names:
- L[names.index(t)] += s
- est = float(L @ fe_params.values)
- var = float(L @ cov.values @ L)
- se = np.sqrt(max(var, 0.0))
- z = est / se if se > 0 else np.nan
- p = 2 * (1 - norm.cdf(abs(z))) if np.isfinite(z) else np.nan
- zcrit = norm.ppf(0.975)
- return est, se, z, p, est - zcrit * se, est + zcrit * se
- def template_effect_terms_for_tech(level, baseline_tech):
- terms = ["C(template)[T.MIITRA]"]
- if level != baseline_tech:
- terms.append(f"C(template)[T.MIITRA]:C(technique)[T.{level}]")
- return terms
- # ---------- MAIN ----------
- for metric in metrics:
- if metric not in df.columns:
- print(f"⚠️ Metrica assente: {metric}")
- continue
- est_rows = []
- pairwise_tests = []
- needed = ["Subject", "node", "template", "technique", "Age", "Sex", "CEREBRUM_TCV", metric]
- dat_all = df.dropna(subset=[c for c in needed if c in df.columns]).copy()
- if dat_all.empty:
- print(f"⚠️ No data {metric}")
- continue
- for node in node_list:
- dat = dat_all[dat_all["node"] == node].copy()
- if dat.empty or dat["Subject"].nunique() < 2:
- continue
- dat["Sex"] = dat["Sex"].astype("category")
- dat["template"] = pd.Categorical(dat["template"], categories=template_order, ordered=True)
- tech_levels_node = [t for t in technique_order if t in dat["technique"].astype(str).unique()]
- if len(tech_levels_node) < 2:
- continue
- dat["technique"] = pd.Categorical(dat["technique"], categories=tech_levels_node, ordered=True)
- formula = f"{metric} ~ C(template)*C(technique) + Age + C(Sex) + CEREBRUM_TCV"
- try:
- md = smf.mixedlm(formula, data=dat, groups=dat["Subject"])
- fit_obj = md.fit(reml=True, method="lbfgs", maxiter=2000)
- except Exception:
- if FALLBACK_OLS:
- try:
- fit_obj = smf.ols(formula, data=dat).fit(
- cov_type="cluster",
- cov_kwds={"groups": dat["Subject"]}
- )
- except Exception:
- continue
- else:
- continue
- fe, cov = fit_obj.params, fit_obj.cov_params()
- baseline_tech = tech_levels_node[0]
- # Template effect per pipeline
- for lvl in tech_levels_node:
- terms = template_effect_terms_for_tech(lvl, baseline_tech)
- est, se, z, p, lo, hi = linear_combo(fe, cov, terms)
- est_rows.append({
- "metric": metric,
- "node": node,
- "technique": lvl,
- "template_effect": est,
- "p": p
- })
- # Pairwise template effect per node
- for i, j in itertools.combinations(tech_levels_node, 2):
- terms_i = template_effect_terms_for_tech(i, baseline_tech)
- terms_j = template_effect_terms_for_tech(j, baseline_tech)
- terms = terms_i + terms_j
- signs = [1.0] * len(terms_i) + [-1.0] * len(terms_j)
- est, se, z, p, lo, hi = linear_combo(fe, cov, terms, signs)
- pairwise_tests.append({
- "metric": metric,
- "node": node,
- "tech_i": i,
- "tech_j": j,
- "p": p
- })
- # ---- EFFECTS: saving ----
- est_df = pd.DataFrame(est_rows)
- if est_df.empty:
- print(f"⚠️ No fit for {metric}")
- continue
- est_df["technique"] = pd.Categorical(est_df["technique"], categories=technique_order, ordered=True)
- est_df = est_df.sort_values(["node", "technique"]).reset_index(drop=True)
- est_path = os.path.join(dirs["estimates"], f"TEMPLATE_EFFECT__{metric}.csv")
- est_df.to_csv(est_path, index=False)
- # FDR
- p_mat = est_df.pivot_table(index="node", columns="technique", values="p", aggfunc="first")
- eff_mat = est_df.pivot_table(index="node", columns="technique", values="template_effect", aggfunc="first")
- p_mat = p_mat.reindex(columns=[t for t in technique_order if t in p_mat.columns])
- eff_mat = eff_mat.reindex(columns=[t for t in technique_order if t in eff_mat.columns])
- pvals_flat = p_mat.values.flatten()
- mask = np.isfinite(pvals_flat)
- q_flat = np.full_like(pvals_flat, np.nan, dtype=float)
- if mask.sum() > 0:
- _, q_ok, _, _ = multipletests(pvals_flat[mask], method="fdr_bh")
- q_flat[mask] = q_ok
- q_mat = pd.DataFrame(q_flat.reshape(p_mat.shape), index=p_mat.index, columns=p_mat.columns)
- # --- HEATMAP (masked) ---
- eff_masked = eff_mat.copy()
- eff_masked[q_mat >= ALPHA] = 0
- eff_masked_withnet = (
- eff_masked.reset_index()
- .rename(columns={"index": "node"})
- .merge(node_ann_sub, on="node", how="left")
- )
- eff_masked_withnet["network7"] = eff_masked_withnet["network7"].replace({"SUBCORTICAL": "Subcortical"})
- eff_masked_withnet["network7"] = eff_masked_withnet["network7"].fillna("Unknown")
- mat = eff_masked_withnet.set_index("node").drop(columns="network7")
- row_net = eff_masked_withnet.set_index("node").loc[mat.index, "network7"]
- row_colors = row_net.map(lambda k: lut.get(k, lut["Unknown"])).tolist()
- vmax = np.nanpercentile(np.abs(eff_mat.values), 95)
- vmax = vmax if np.isfinite(vmax) and vmax > 0 else 1.0
- vmin = -vmax
- fig, ax = plt.subplots(figsize=(12, 8))
- ax = sns.heatmap(
- mat,
- cmap="RdBu_r",
- center=0,
- vmin=vmin,
- vmax=vmax,
- cbar_kws={
- "label": "Template effect (MIITRA − MNI)",
- "format": mtick.FormatStrFormatter('%.1e')
- },
- yticklabels=False
- )
- ncols = mat.shape[1]
- for y, color in enumerate(row_colors):
- ax.add_patch(plt.Rectangle((ncols, y), NET_STRIPE_WIDTH, 1, color=color, lw=0, clip_on=False))
- ax.set_title(f"{metric}")
- ax.set_xlabel("Pipeline")
- ax.set_ylabel("Node")
- plt.setp(ax.get_xticklabels(), rotation=XTICK_ROT, ha="right")
- handles = [
- mpatches.Patch(color=lut[n], label=n)
- for n in net_order if n in row_net.unique()
- ]
- ax.legend(
- handles=handles,
- bbox_to_anchor=(0.5, -0.35),
- loc="upper center",
- title="Yeo7 Networks + Subcortical",
- ncol=8,
- frameon=False
- )
- plt.tight_layout()
- heat_path = os.path.join(dirs["heatmaps"], f"HEATMAP_TEMPLATE_EFFECT_MASKED__{metric}_netColor.png")
- plt.savefig(heat_path, dpi=220, bbox_inches="tight")
- plt.close(fig)
- # ---- NETWORK SUMMARY (CSV + barplot) ----
- tmp = est_df.merge(node_ann_sub, on="node", how="left")
- q_long = q_mat.stack().reset_index().rename(columns={0: "q", "level_0": "node", "level_1": "technique"})
- tmp = tmp.merge(q_long, on=["node", "technique"], how="left")
- tmp = tmp.dropna(subset=["network7", "template_effect"])
- net_sum = (
- tmp.groupby(["network7", "technique"], as_index=False)
- .agg(
- mean_effect=("template_effect", "mean"),
- med_effect=("template_effect", "median"),
- n_nodes=("node", "nunique"),
- pct_sig=("q", lambda x: 100 * np.mean(np.array(x) < ALPHA) if x.notna().sum() > 0 else np.nan)
- )
- )
- net_sum["technique"] = pd.Categorical(net_sum["technique"], categories=technique_order, ordered=True)
- net_sum = net_sum.sort_values(["technique", "network7"]).reset_index(drop=True)
- net_csv = os.path.join(dirs["summaries"], f"NETWORK_SUMMARY__{metric}.csv")
- net_sum.to_csv(net_csv, index=False)
- plt.figure(figsize=(12, 6))
- ax = sns.barplot(data=net_sum, x="technique", y="pct_sig", hue="network7", palette=lut)
- ax.set_xlabel("Pipeline")
- ax.set_ylabel(f"% nodes with q<{ALPHA}")
- ax.set_title(f"{metric}")
- plt.setp(ax.get_xticklabels(), rotation=XTICK_ROT, ha="right")
- ax.legend(title="Yeo7 Networks + Subcortical", frameon=False, ncol=3)
- plt.tight_layout()
- net_fig = os.path.join(dirs["summaries"], f"NETWORK_PCTSIG__{metric}.png")
- plt.savefig(net_fig, dpi=200)
- plt.close()
- print(f"✅ {metric} → effects: {os.path.basename(est_path)} | heatmap: {os.path.basename(heat_path)}")
results.ipynb at commit 7fed980, under MIT · at the source
Overview
- Univ Rennes, CNRS, Inria, Inserm, IRISA UMR 6074, EMPENN — ERL U 1228, Rennes, France
- IMT Atlantique, Lab-STICC UMR CNRS 6285, Brest, France
- Neurology Department, Rennes University Hospital, Rennes, France
Abstract
Diffusion-weighted MRI samples the directional diffusion of water in vivo, and tractography uses this information to reconstruct brain fiber pathways. Mapping streamlines to an anatomical parcellation yields structural connectomes. However, in older adults, where white matter alterations and atrophy are common, the choice of reference template and tissue segmentation could be particularly consequential for obtaining accurate, interpretable structural connectomes. Using a conventional pipeline, we evaluated how these two factors, the normalization template and the segmentation used to constrain anatomically guided tractography, affect connectome estimates in cognitively healthy elderly participants. These methodological choices produced systematic and significant differences in network topology and their relationships with clinically relevant variables across standard connectome measures, particularly in patients with white matter hyperintensities. Age-appropriate normalization and lesion-aware anatomically constrained tractography yielded networks with more plausible anatomy and more consistent relationships with cognition and imaging measures, whereas unconstrained tracking inflated density without improving interpretability. These findings demonstrate that structural connectome outcomes are contingent upon template and segmentation selection. We, therefore, advocate for explicit reporting of these methodological parameters and recommend the use of age-appropriate templates combined with white matter lesion-aware segmentation incorporating anatomically informed constraints.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 16 matches between paragraphs and lines of code.
Inria-Empenn/Anima-Public
d9fb323d4d15b228318e42b42df16c7ebbf8f6df, 4 March 2026Availability: 1 check, the latest on 3 October 2026: the link answers
- 3 October 2026: the link answers
271 files
- Anima/
cmake/ , Shell, 29 linesdocumentation/ scriptUpdateDoxygen.sh - Anima/
diffusion/ , C/C++, 122 linesdti/ background_noise_varianc e_estimator/ animaBackgroundNoiseVari anceEstimationImageFilte r.h - Anima/
diffusion/ , C/C++, 112 linesdti/ dti_estimator/ animaDTIEstimationImageF ilter.h - Anima/
diffusion/ , C/C++, 68 linesdti/ dti_non_central_chi_esti mator/ animaDTINonCentralChiCos tFunction.h - Anima/
diffusion/ , C/C++, 142 linesdti/ dti_non_central_chi_esti mator/ animaDTINonCentralChiEst imationImageFilter.h - Anima/
diffusion/ , C/C++, 94 linesdti/ dti_scalar_maps/ animaDTIScalarMapsImageF ilter.h - Anima/
diffusion/ , C/C++, 91 linesdti/ dwi_simulator_from_dti/ animaDWISimulatorFromDTI ImageFilter.h - Anima/
diffusion/ , C/C++, 64 linesdti/ flip_tensors/ animaFlipTensorImageFilt er.h - Anima/
diffusion/ , C/C++, 84 linesmcm/ animaDDICompartment.h - Anima/
diffusion/ , C/C++, 36 linesmcm/ animaFreeWaterCompartmen t.h - Anima/
diffusion/ , C/C++, 65 linesmcm/ animaGaussianMCMCost.h - Anima/
diffusion/ , C/C++, 93 linesmcm/ animaGaussianMCMVariable ProjectionCost.h - Anima/
diffusion/ , C/C++, 60 linesmcm/ animaGaussianMCMVariable ProjectionMultipleValued CostFunction.h - Anima/
diffusion/ , C/C++, 59 linesmcm/ animaGaussianMCMVariable ProjectionSingleValuedCo stFunction.h - Anima/
diffusion/ , C/C++, 39 linesmcm/ animaIsotropicRestricted WaterCompartment.h - Anima/
diffusion/ , C/C++, 101 linesmcm/ animaMultiCompartmentMod elCreator.h - Anima/
diffusion/ , C/C++, 135 linesmcm/ animaNODDICompartment.h - Anima/
diffusion/ , C/C++, 53 linesmcm/ animaNonCentralChiMCMCos t.h - Anima/
diffusion/ , C/C++, 98 linesmcm/ animaStaniszCompartment. h - Anima/
diffusion/ , C/C++, 43 linesmcm/ animaStationaryWaterComp artment.h - Anima/
diffusion/ , C/C++, 77 linesmcm/ animaStickCompartment.h - Anima/
diffusion/ , C/C++, 142 linesmcm/ animaTensorCompartment.h - Anima/
diffusion/ , C/C++, 80 linesmcm/ animaZeppelinCompartment .h - Anima/
diffusion/ , C/C++, 392 linesmcm_estimator/ animaMCMEstimatorImageFi lter.h - Anima/
diffusion/ , C/C++, 180 linesmcm_estimator/ low_memory/ animaLowMemMCMEstimatorB ridge.h - Anima/
diffusion/ , C/C++, 71 linesmcm_model_averaging/ animaMCMImageSimplifier. h - Anima/
diffusion/ , C/C++, 122 linesmcm_model_averaging/ animaMCMModelAveragingIm ageFilter.h - Anima/
diffusion/ , C/C++, 85 linesmcm_tools/ mcm_average_images/ animaMCMAverageImagesIma geFilter.h - Anima/
diffusion/ , C/C++, 87 linesmcm_tools/ mcm_orientation_priors/ animaMCMOrientationPrior sImageFilter.h - Anima/
diffusion/ , C/C++, 84 linesmcm_tools/ mcm_scalar_maps/ animaMCMScalarMapsImageF ilter.h - Anima/
diffusion/ , C/C++, 62 linesmcm_tools/ test_averaging/ ddi_test_averaging_on_re al_value/ animaDDITestAveragingOnR ealValueImageFilter.h - Anima/
diffusion/ , C/C++, 67 linesodf/ generalized_fa/ animaGeneralizedFAImageF ilter.h - Anima/
diffusion/ , C/C++, 80 linesodf/ odf_average/ animaODFAverageImageFilt er.h - Anima/
diffusion/ , C/C++, 144 linesodf/ odf_estimator/ animaODFEstimatorImageFi lter.h - Anima/
diffusion/ , C/C++, 112 linesodf/ tod_estimator/ animaTODEstimatorImageFi lter.h - Anima/
diffusion/ , C/C++, 324 linestractography/ animaBaseProbabilisticTr actographyImageFilter.h - Anima/
diffusion/ , C/C++, 146 linestractography/ animaBaseTractographyIma geFilter.h - Anima/
diffusion/ , C/C++, 83 linestractography/ animaDTIProbabilisticTra ctographyImageFilter.h - Anima/
diffusion/ , C/C++, 72 linestractography/ animaDTITractographyImag eFilter.h - Anima/
diffusion/ , C/C++, 90 linestractography/ animaMCMProbabilisticTra ctographyImageFilter.h - Anima/
diffusion/ , C/C++, 70 linestractography/ animaMCMTractographyImag eFilter.h - Anima/
diffusion/ , C/C++, 90 linestractography/ animaODFProbabilisticTra ctographyImageFilter.h - Anima/
filtering/ , C/C++, 62 linesclustering/ animaKMeansFilter.h - Anima/
filtering/ , C/C++, 58 linesclustering/ animaModularityClusterin gFilter.h - Anima/
filtering/ , C/C++, 63 linesclustering/ animaSPANClusteringFilte r.h - Anima/
filtering/ , C/C++, 96 linesdenoising/ non_local_means_image_fi lter/ animaMeanAndVarianceImag esFilter.h - Anima/
filtering/ , C/C++, 106 linesdenoising/ non_local_means_image_fi lter/ animaNonLocalMeansImageF ilter.h - Anima/
filtering/ , C/C++, 49 linesdenoising/ non_local_means_image_fi lter/ animaNonLocalMeansPatchS earcher.h - Anima/
filtering/ , C/C++, 88 linesdenoising/ non_local_means_temporal _image_filter/ animaNonLocalMeansTempor alImageFilter.h - Anima/
filtering/ , C/C++, 53 linesdenoising/ pseudo_residuals_noise_e stimation/ animaPseudoResidualsNois eImageFilter.h - Anima/
filtering/ , C/C++, 86 linesdti_tools/ exp_tensors/ animaExpTensorImageFilte r.h - Anima/
filtering/ , C/C++, 86 linesdti_tools/ log_tensors/ animaLogTensorImageFilte r.h - Anima/
filtering/ , C/C++, 102 linesjacobian/ animaJacobianMatrixImage Filter.h - Anima/
filtering/ , C/C++, 78 linesnoise_generator/ animaNoiseGeneratorImage Filter.h - Anima/
filtering/ , C/C++, 262 linesregularization/ animaInhomogeneousAOSLin eDiffusionImageFilter.h - Anima/
filtering/ , C/C++, 101 linesregularization/ animaInhomogeneousDiffus ionImageFilter.h - Anima/
filtering/ , C/C++, 281 linesregularization/ animaRecursiveLineYvvGau ssianImageFilter.h - Anima/
filtering/ , C/C++, 130 linesregularization/ animaSmoothingRecursiveY vvGaussianImageFilter.h - Anima/
math-tools/ , C/C++, 87 linesclustering/ animaFuzzyCMeansFilter.h - Anima/
math-tools/ , C/C++, 91 linesclustering/ animaSpectralClusteringF ilter.h - Anima/
math-tools/ , C/C++, 69 linescommon/ animaImageDataSplitter.h - Anima/
math-tools/ , C/C++, 61 linescommon/ animaMaskedImageToImageF ilter.h - Anima/
math-tools/ , C/C++, 102 linescommon/ animaNumberedThreadImage ToImageFilter.h - Anima/
math-tools/ , C/C++, 163 linescommon/ animaReadWriteFunctions. h - Anima/
math-tools/ , C/C++, 134 linescommon/ animaRetrieveImageTypeMa cros.h - Anima/
math-tools/ , C/C++, 88 linesdata_io/ animaGradientFileReader. h - Anima/
math-tools/ , C/C++, 39 linesdata_io/ animaShapesReader.h - Anima/
math-tools/ , C/C++, 51 linesdata_io/ animaShapesWriter.h - Anima/
math-tools/ , C/C++, 33 linesdata_io/ animaTRKHeaderStructure. h - Anima/
math-tools/ , C/C++, 30 linesdata_io/ animaTRKReader.h - Anima/
math-tools/ , C/C++, 53 linesdata_io/ animaTRKWriter.h - Anima/
math-tools/ , C/C++, 119 linesintegration/ animaGaussLaguerreQuadra ture.h - Anima/
math-tools/ , C/C++, 96 linesintegration/ animaGaussLegendreQuadra ture.h - Anima/
math-tools/ , C/C++, 14 linesinterpolator/ animaCubicInterpolation. h - Anima/
math-tools/ , C/C++, 50 linesinterpolator/ animaDDIAveragingTools.h - Anima/
math-tools/ , C/C++, 128 linesinterpolator/ animaMCMLinearInterpolat eImageFunction.h - Anima/
math-tools/ , C/C++, 122 linesinterpolator/ animaVectorModelLinearIn terpolateImageFunction.h - Anima/
math-tools/ , C/C++, 97 linesmatrix_operations/ animaBaseTensorTools.h - Anima/
math-tools/ , C/C++, 99 linesmatrix_operations/ animaMatrixLogExp.h - Anima/
math-tools/ , C/C++, 23 linesmatrix_operations/ animaMatrixOperations.h - Anima/
math-tools/ , C/C++, 38 linesmatrix_operations/ animaQRDecomposition.h - Anima/
math-tools/ , C/C++, 134 linesmatrix_operations/ animaVectorOperations.h - Anima/
math-tools/ , C/C++, 193 linesmulti_compartment_base/ animaBaseCompartment.h - Anima/
math-tools/ , C/C++, 75 linesmulti_compartment_base/ animaBaseIsotropicCompar tment.h - Anima/
math-tools/ , C/C++, 102 linesmulti_compartment_base/ animaBaseMCMCost.h - Anima/
math-tools/ , C/C++, 83 linesmulti_compartment_base/ animaMCMConstants.h - Anima/
math-tools/ , C/C++, 45 linesmulti_compartment_base/ animaMCMFileReader.h - Anima/
math-tools/ , C/C++, 36 linesmulti_compartment_base/ animaMCMFileWriter.h - Anima/
math-tools/ , C/C++, 40 linesmulti_compartment_base/ animaMCMImage.h - Anima/
math-tools/ , C/C++, 75 linesmulti_compartment_base/ animaMCML2DistanceComput er.h - Anima/
math-tools/ , C/C++, 59 linesmulti_compartment_base/ animaMCMMultipleValuedCo stFunction.h - Anima/
math-tools/ , C/C++, 57 linesmulti_compartment_base/ animaMCMSingleValuedCost Function.h - Anima/
math-tools/ , C/C++, 113 linesmulti_compartment_base/ animaMCMWeightedAverager .h - Anima/
math-tools/ , C/C++, 144 linesmulti_compartment_base/ animaMultiCompartmentMod el.h - Anima/
math-tools/ , C/C++, 68 linesnon_local_base/ animaNonLocalPatchBaseSe archer.h - Anima/
math-tools/ , C/C++, 92 linesoptimizers/ animaBLMLambdaCostFuncti on.h - Anima/
math-tools/ , C/C++, 71 linesoptimizers/ animaBVLSOptimizer.h - Anima/
math-tools/ , C/C++, 104 linesoptimizers/ animaBaseRootFindingAlgo rithm.h - Anima/
math-tools/ , C/C++, 17 linesoptimizers/ animaBisectionRootFindin gAlgorithm.h - Anima/
math-tools/ , C/C++, 17 linesoptimizers/ animaBoostBisectionRootF indingAlgorithm.h - Anima/
math-tools/ , C/C++, 101 linesoptimizers/ animaBoundedLevenbergMar quardtOptimizer.h - Anima/
math-tools/ , C/C++, 17 linesoptimizers/ animaBracketAndSolveRoot FindingAlgorithm.h - Anima/
math-tools/ , C/C++, 17 linesoptimizers/ animaBrentRootFindingAlg orithm.h - Anima/
math-tools/ , C/C++, 81 linesoptimizers/ animaCholeskyDecompositi on.h - Anima/
math-tools/ , C/C++, 17 linesoptimizers/ animaDekkerRootFindingAl gorithm.h - Anima/
math-tools/ , C/C++, 79 linesoptimizers/ animaNNLSOptimizer.h - Anima/
math-tools/ , C/C++, 17 linesoptimizers/ animaTOMS748RootFindingA lgorithm.h - Anima/
math-tools/ , C/C++, 90 linesoptimizers/ animaVoxelExhaustiveOpti mizer.h - Anima/
math-tools/ , C/C++, 363 linesoptimizers/ nlopt_optimizers/ animaNLOPTOptimizers.h - Anima/
math-tools/ , C/C++, 54 linesoptimizers/ nlopt_optimizers/ animaNLOPTParametersCons traintFunction.h - Anima/
math-tools/ , C/C++, 38 linesspecial_functions/ animaBesselFunctions.h - Anima/
math-tools/ , C/C++, 35 linesspecial_functions/ animaErrorFunctions.h - Anima/
math-tools/ , C/C++, 17 linesspecial_functions/ animaGammaFunctions.h - Anima/
math-tools/ , C/C++, 17 linesspecial_functions/ animaHyperbolicFunctions .h - Anima/
math-tools/ , C/C++, 61 linesspecial_functions/ animaKummerFunctions.h - Anima/
math-tools/ , C/C++, 13 linesspecial_functions/ animaLegendreDerivatives .h - Anima/
math-tools/ , C/C++, 10 linesspecial_functions/ animaLogarithmFunctions. h - Anima/
math-tools/ , C/C++, 12 linesspecial_functions/ animaTrigonometricFuncti ons.h - Anima/
math-tools/ , C/C++, 45 linessphere_operations/ animaLogExpMapsUnitSpher e.h - Anima/
math-tools/ , C/C++, 21 linessphere_operations/ animaSphereOperations.h - Anima/
math-tools/ , C/C++, 20 linesspherical_harmonics/ animaODFFunctions.h - Anima/
math-tools/ , C/C++, 61 linesspherical_harmonics/ animaODFMaximaCostFuncti on.h - Anima/
math-tools/ , C/C++, 51 linesspherical_harmonics/ animaODFSphericalHarmoni cBasis.h - Anima/
math-tools/ , C/C++, 39 linesspherical_harmonics/ animaSphericalHarmonic.h - Anima/
math-tools/ , C/C++, 38 linesstatistical_distribution s/ animaBaseDistribution.h - Anima/
math-tools/ , C/C++, 32 linesstatistical_distribution s/ animaDDIDistribution.h - Anima/
math-tools/ , C/C++, 47 linesstatistical_distribution s/ animaDirichletDistributi on.h - Anima/
math-tools/ , C/C++, 39 linesstatistical_distribution s/ animaGammaDistribution.h - Anima/
math-tools/ , C/C++, 49 linesstatistical_distribution s/ animaMultivariateNormalD istribution.h - Anima/
math-tools/ , C/C++, 39 linesstatistical_distribution s/ animaRealUniformDistribu tion.h - Anima/
math-tools/ , C/C++, 27 linesstatistical_distribution s/ animaSphericalUniformDis tribution.h - Anima/
math-tools/ , C/C++, 57 linesstatistical_distribution s/ animaVonMisesFisherDistr ibution.h - Anima/
math-tools/ , C/C++, 54 linesstatistical_distribution s/ animaWatsonDistribution. h - Anima/
math-tools/ , C/C++, 55 linesstatistical_distribution s/ sample_image_from_distri bution/ animaSampleImageFromDist ributionImageFilter.h - Anima/
math-tools/ , C/C++, 112 linesstatistical_tests/ animaCramersTestImageFil ter.h - Anima/
math-tools/ , C/C++, 30 lines, 2 matchesstatistical_tests/ animaFDRCorrection.h - Anima/
math-tools/ , C/C++, 63 linesstatistical_tests/ fdr_correct_pvalues/ animaFDRCorrectImageFilt er.h - Anima/
math-tools/ , C/C++, 51 linesstatistical_tests/ low_memory_tools/ cramers_test/ animaLowMemCramersTestBr idge.h - Anima/
math-tools/ , C/C++, 88 linesstatistical_tests/ low_memory_tools/ nlmeans_patient_to_group _comparison/ animaLowMemNLMeansPatien tToGroupComparisonBridge .h - Anima/
math-tools/ , C/C++, 64 linesstatistical_tests/ low_memory_tools/ patient_to_group_compari son/ animaLowMemPatientToGrou pComparisonBridge.h - Anima/
math-tools/ , C/C++, 68 linesstatistical_tests/ low_memory_tools/ patient_to_group_odf_com parison/ animaLowMemPatientToGrou pODFComparisonBridge.h - Anima/
math-tools/ , C/C++, 128 linesstatistical_tests/ nlmeans_patient_to_group _comparison/ animaNLMeansPatientToGro upComparisonImageFilter. h - Anima/
math-tools/ , C/C++, 69 linesstatistical_tests/ nlmeans_patient_to_group _comparison/ animaNLMeansVectorPatchS earcher.h - Anima/
math-tools/ , C/C++, 113 linesstatistical_tests/ patient_to_group_compari son/ animaPatientToGroupCompa risonImageFilter.h - Anima/
math-tools/ , C/C++, 59 linesstatistical_tests/ patient_to_group_odf_com parison/ animaPatientToGroupODFCo mparisonImageFilter.h - Anima/
math-tools/ , C/C++, 57 linesstatistics/ animaBootstrap4DVolumeIm ageFilter.h - Anima/
math-tools/ , C/C++, 72 linesstatistics/ animaLocalPatchCovarianc eDistanceImageFilter.h - Anima/
math-tools/ , C/C++, 72 linesstatistics/ animaLocalPatchMeanDista nceImageFilter.h - Anima/
math-tools/ , C/C++, 29 linesstatistics/ animaVectorImagePatchSta tistics.h - Anima/
math-tools/ , C/C++, 56 linesstatistics/ low_memory_tools/ local_patch_covariance_d istance/ animaLowMemLocalPatchCov arianceDistanceBridge.h - Anima/
math-tools/ , C/C++, 56 linesstatistics/ low_memory_tools/ local_patch_mean_distanc e/ animaLowMemLocalPatchMea nDistanceBridge.h - Anima/
math-tools/ , C/C++, 85 linestransformations/ animaAxisRotationTransfo rm.h - Anima/
math-tools/ , C/C++, 210 linestransformations/ animaDirectionScaleSkewT ransform.h - Anima/
math-tools/ , C/C++, 69 linestransformations/ animaLinearTransformEsti mationTools.h - Anima/
math-tools/ , C/C++, 98 linestransformations/ animaLogRigid3DTransform .h - Anima/
math-tools/ , C/C++, 182 linestransformations/ animaReorientation.h - Anima/
math-tools/ , C/C++, 87 linestransformations/ animaSplitAffine3DTransf orm.h - Anima/
math-tools/ , C/C++, 92 linestransformations/ animaSymmetryPlaneTransf orm.h - Anima/
math-tools/ , C/C++, 58 linestransformations/ animaTransformSeriesRead er.h - Anima/
quantitative-mri/ , C/C++, 40 linesestimation/ animaB1GMMDistributionIn tegrand.h - Anima/
quantitative-mri/ , C/C++, 126 linesestimation/ animaB1GMMRelaxometryCos tFunction.h - Anima/
quantitative-mri/ , C/C++, 34 linesestimation/ animaB1GammaDerivativeDi stributionIntegrand.h - Anima/
quantitative-mri/ , C/C++, 40 linesestimation/ animaB1GammaDistribution Integrand.h - Anima/
quantitative-mri/ , C/C++, 141 linesestimation/ animaB1GammaMixtureT2Rel axometryCostFunction.h - Anima/
quantitative-mri/ , C/C++, 102 linesestimation/ animaCombinedRelaxometry CostFunction.h - Anima/
quantitative-mri/ , C/C++, 156 linesestimation/ animaEPGProfileIntegrand s.h - Anima/
quantitative-mri/ , C/C++, 106 linesestimation/ animaMultiT2EPGRelaxomet ryCostFunction.h - Anima/
quantitative-mri/ , C/C++, 90 linesestimation/ animaMultiT2Regularizati onCostFunction.h - Anima/
quantitative-mri/ , C/C++, 87 linesestimation/ animaT1RelaxometryEstima tionImageFilter.h - Anima/
quantitative-mri/ , C/C++, 53 linesestimation/ animaT1SERelaxometryCost Function.h - Anima/
quantitative-mri/ , C/C++, 88 linesestimation/ animaT1SERelaxometryEsti mationImageFilter.h - Anima/
quantitative-mri/ , C/C++, 96 linesestimation/ animaT2EPGRelaxometryCos tFunction.h - Anima/
quantitative-mri/ , C/C++, 130 linesestimation/ animaT2EPGRelaxometryEst imationImageFilter.h - Anima/
quantitative-mri/ , C/C++, 73 linesestimation/ animaT2RelaxometryCostFu nction.h - Anima/
quantitative-mri/ , C/C++, 91 linesestimation/ animaT2RelaxometryEstima tionImageFilter.h - Anima/
quantitative-mri/ , C/C++, 156 linesestimation/ combined_relaxometry_est imation/ animaCombinedRelaxometry EstimationImageFilter.h - Anima/
quantitative-mri/ , C/C++, 159 linesestimation/ gamma_mixture_t2_estimat ion/ animaGammaMixtureT2Relax ometryEstimationImageFil ter.h - Anima/
quantitative-mri/ , C/C++, 144 linesestimation/ gmm_t2_estimation/ animaGMMT2RelaxometryEst imationImageFilter.h - Anima/
quantitative-mri/ , C/C++, 239 linesestimation/ multi_t2_estimation/ animaMultiT2RelaxometryE stimationImageFilter.h - Anima/
quantitative-mri/ , C/C++, 48 linesestimation/ multi_t2_estimation/ animaNonLocalT2Distribut ionPatchSearcher.h - Anima/
quantitative-mri/ , C/C++, 50 linesmr-simulation/ signal_simulation/ animaEPGSignalSimulator. h - Anima/
quantitative-mri/ , C/C++, 62 linesmr-simulation/ simu_bloch_coherent_gre/ animaSimuBlochCoherentGR E.h - Anima/
quantitative-mri/ , C/C++, 55 linesmr-simulation/ simu_bloch_gre/ animaSimuBlochGRE.h - Anima/
quantitative-mri/ , C/C++, 59 linesmr-simulation/ simu_bloch_ir_gre/ animaSimuBlochIR-GRE.h - Anima/
quantitative-mri/ , C/C++, 59 linesmr-simulation/ simu_bloch_ir_se/ animaSimuBlochIR-SE.h - Anima/
quantitative-mri/ , C/C++, 55 linesmr-simulation/ simu_bloch_se/ animaSimuBlochSE.h - Anima/
quantitative-mri/ , C/C++, 61 linesmr-simulation/ simu_bloch_sp_gre/ animaSimuBlochSP-GRE.h - Anima/
quantitative-mri/ , C/C++, 80 lines, 1 matchmr-simulation/ stimulated_spin_echo_sim ulator/ animaStimulatedSpinEchoI mageFilter.h - Anima/
registration/ , C/C++, 46 linesalgorithms/ animaAnatomicalBlockMatc her.h - Anima/
registration/ , C/C++, 40 linesalgorithms/ animaAsymmetricBMRegistr ationMethod.h - Anima/
registration/ , C/C++, 59 linesalgorithms/ animaBaseAffineBlockMatc her.h - Anima/
registration/ , C/C++, 196 linesalgorithms/ animaBaseBMRegistrationM ethod.h - Anima/
registration/ , C/C++, 160 linesalgorithms/ animaBaseBlockMatcher.h - Anima/
registration/ , C/C++, 64 linesalgorithms/ animaDistortionCorrectio nBMRegistrationMethod.h - Anima/
registration/ , C/C++, 79 linesalgorithms/ animaDistortionCorrectio nBlockMatcher.h - Anima/
registration/ , C/C++, 87 linesalgorithms/ animaKissingSymmetricBMR egistrationMethod.h - Anima/
registration/ , C/C++, 76 linesalgorithms/ animaMCMBlockMatcher.h - Anima/
registration/ , C/C++, 49 linesalgorithms/ animaSymmetricBMRegistra tionMethod.h - Anima/
registration/ , C/C++, 55 linesalgorithms/ animaTensorBlockMatcher. h - Anima/
registration/ , C/C++, 195 linesanatomical-commands/ bm_distortion_correction / animaPyramidalDistortion CorrectionBlockMatchingB ridge.h - Anima/
registration/ , C/C++, 310 linesanatomical-commands/ dense_svf_bm_registratio n/ animaPyramidalDenseSVFMa tchingBridge.h - Anima/
registration/ , C/C++, 65 linesanatomical-commands/ distortion_correction/ animaDistortionCorrectio nImageFilter.h - Anima/
registration/ , C/C++, 330 linesanatomical-commands/ pyramidal_bm_registratio n/ animaPyramidalBlockMatch ingBridge.h - Anima/
registration/ , C/C++, 176 linescommon/ animaBlockMatchInitializ er.h - Anima/
registration/ , C/C++, 61 linescommon/ animaMCMBlockMatchInitia lizer.h - Anima/
registration/ , C/C++, 94 linescommon/ animaPyramidImageFilter. h - Anima/
registration/ , C/C++, 322 linesdiffusion-commands/ dense-mcm-svf-bm-registr ation/ animaPyramidalDenseMCMSV FMatchingBridge.h - Anima/
registration/ , C/C++, 307 linesdiffusion-commands/ dense_tensor_svf_bm_regi stration/ animaPyramidalDenseTenso rSVFMatchingBridge.h - Anima/
registration/ , C/C++, 68 linesresamplers/ animaMCMResampleImageFil ter.h - Anima/
registration/ , C/C++, 58 linesresamplers/ animaODFResampleImageFil ter.h - Anima/
registration/ , C/C++, 189 linesresamplers/ animaOrientedModelBaseRe sampleImageFilter.h - Anima/
registration/ , C/C++, 227 linesresamplers/ animaResampleImageFilter .h - Anima/
registration/ , C/C++, 65 linesresamplers/ animaTensorResampleImage Filter.h - Anima/
registration/ , C/C++, 90 linessimilarity-measures/ animaApproximateMCMSmoot hingCostFunction.h - Anima/
registration/ , C/C++, 189 linessimilarity-measures/ animaBaseOrientedModelIm ageToImageMetric.h - Anima/
registration/ , C/C++, 82 linessimilarity-measures/ animaFastCorrelationImag eToImageMetric.h - Anima/
registration/ , C/C++, 78 linessimilarity-measures/ animaFastMeanSquaresImag eToImageMetric.h - Anima/
registration/ , C/C++, 116 linessimilarity-measures/ animaMCMCorrelationImage ToImageMetric.h - Anima/
registration/ , C/C++, 103 linessimilarity-measures/ animaMCMMeanSquaresImage ToImageMetric.h - Anima/
registration/ , C/C++, 100 linessimilarity-measures/ animaMCMPairingMeanSquar esImageToImageMetric.h - Anima/
registration/ , C/C++, 105 linessimilarity-measures/ animaMTPairingCorrelatio nImageToImageMetric.h - Anima/
registration/ , C/C++, 87 linessimilarity-measures/ animaMultiTensorSmoothin gCostFunction.h - Anima/
registration/ , C/C++, 85 linessimilarity-measures/ animaTensorCorrelationIm ageToImageMetric.h - Anima/
registration/ , C/C++, 93 linessimilarity-measures/ animaTensorGeneralizedCo rrelationImageToImageMet ric.h - Anima/
registration/ , C/C++, 63 linessimilarity-measures/ animaTensorMeanSquaresIm ageToImageMetric.h - Anima/
registration/ , C/C++, 84 linessvf-operations/ animaSVFExponentialImage Filter.h - Anima/
registration/ , C/C++, 73 linessvf-operations/ animaSVFLieBracketImageF ilter.h - Anima/
registration/ , C/C++, 35 linessvf-operations/ animaVelocityUtils.h - Anima/
registration/ , C/C++, 141 linessymmetry/ symmetry_constrained_reg istration/ animaPyramidalSymmetryCo nstrainedRegistrationBri dge.h - Anima/
registration/ , C/C++, 187 linessymmetry/ symmetry_plane/ animaPyramidalSymmetryBr idge.h - Anima/
registration/ , C/C++, 68 linestransformation-agregator s/ animaBalooExternalExtrap olateImageFilter.h - Anima/
registration/ , C/C++, 88 linestransformation-agregator s/ animaBalooSVFTransformAg regator.h - Anima/
registration/ , C/C++, 123 linestransformation-agregator s/ animaBaseTransformAgrega tor.h - Anima/
registration/ , C/C++, 80 linestransformation-agregator s/ animaDenseSVFTransformAg regator.h - Anima/
registration/ , C/C++, 38 linestransformation-agregator s/ animaLSWTransformAgregat or.h - Anima/
registration/ , C/C++, 49 linestransformation-agregator s/ animaLTSWTransformAgrega tor.h - Anima/
registration/ , C/C++, 43 linestransformation-agregator s/ animaMEstTransformAgrega tor.h - Anima/
registration/ , C/C++, 90 linestransformation-agregator s/ animaMEstimateSVFImageFi lter.h - Anima/
segmentation/ , C/C++, 42 linesbasic_tools/ majority_voting/ animaMajorityLabelVoting ImageFilter.h - Anima/
segmentation/ , C/C++, 404 linescommands/ connected_components_met rics/ animaConnectedComponents MetricsFilter.h - Anima/
segmentation/ , C/C++, 129 linescommands/ connected_components_met rics/ animaConnectedComponents VolumeFilter.h - Anima/
segmentation/ , C/C++, 100 linesgraph_cut/ animaAtlasInitializer.h - Anima/
segmentation/ , C/C++, 269 linesgraph_cut/ animaBlock.h - Anima/
segmentation/ , C/C++, 136 linesgraph_cut/ animaCheckStructureNeigh borFilter.h - Anima/
segmentation/ , C/C++, 134 linesgraph_cut/ animaClassificationStrat egy.h - Anima/
segmentation/ , C/C++, 197 linesgraph_cut/ animaComputeMahalanobisI magesFilter.h - Anima/
segmentation/ , C/C++, 233 linesgraph_cut/ animaComputeSolution.h - Anima/
segmentation/ , C/C++, 155 linesgraph_cut/ animaGaussianEMEstimator .h - Anima/
segmentation/ , C/C++, 109 linesgraph_cut/ animaGaussianREMEstimato r.h - Anima/
segmentation/ , C/C++, 1,271 linesgraph_cut/ animaGraph.h - Anima/
segmentation/ , C/C++, 211 linesgraph_cut/ animaGraph3DFilter.h - Anima/
segmentation/ , C/C++, 193 linesgraph_cut/ animaGraphCutFilter.h - Anima/
segmentation/ , C/C++, 221 linesgraph_cut/ animaHierarchicalInitial izer.h - Anima/
segmentation/ , C/C++, 127 linesgraph_cut/ animaImageClassifierFilt er.h - Anima/
segmentation/ , C/C++, 63 linesgraph_cut/ animaModelInitializer.h - Anima/
segmentation/ , C/C++, 206 linesgraph_cut/ animaNLinksFilter.h - Anima/
segmentation/ , C/C++, 80 linesgraph_cut/ animaRandomInitializer.h - Anima/
segmentation/ , C/C++, 159 linesgraph_cut/ animaRemoveTouchingBorde rFilter.h - Anima/
segmentation/ , C/C++, 167 linesgraph_cut/ animaTLinksFilter.h - Anima/
segmentation/ , C/C++, 662 linesgraph_cut/ gc_strem_ms_lesions_segm entation/ animaGcStremMsLesionsSeg mentationFilter.h - Anima/
segmentation/ , C/C++, 62 lineslesion-simulation/ animaPickLesionSeedImage Filter.h - Anima/
segmentation/ , C/C++, 108 lineslesion-simulation/ qmri_lesion_sample_creat or/ animaQMRISampleCreationI mageFilter.h - Anima/
segmentation/ , C/C++, 246 linesstaple/ animaMultiThreadedSTAPLE ImageFilter.h - Anima/
segmentation/ , C/C++, 139 linestissues_em_classificatio n/ animaTissuesEMClassifica tionImageFilter.h - Anima/
segmentation/ , C/C++, 92 linesvalidation_tools/ segmentation_performance _analyzer/ animaSegPerfApp.h - Anima/
segmentation/ , C/C++, 120 linesvalidation_tools/ segmentation_performance _analyzer/ animaSegPerfCAnalyzer.h - Anima/
segmentation/ , C/C++, 210 linesvalidation_tools/ segmentation_performance _analyzer/ animaSegPerfResults.h - Anima/
segmentation/ , C/C++, 163 linesvalidation_tools/ segmentation_performance _analyzer/ animaSegmentationMeasure sImageFilter.h - docs/
source/ , Python, 56 linesconf.py - License.txt, License, 20 lines
- README.md, Text, 10 lines
CarloFerritto/Structural_connectomes_in_Aging
7fed9808782e3e200a2ba87ba793179a8306930b, 23 June 2026Availability: 1 check, the latest on 3 October 2026: the link answers
- 3 October 2026: the link answers
12 files
- src/
Analyze_your_connectomes , Python, 206 lines, 1 match/ extract_connectome_metri cs.py - src/
Analyze_your_connectomes , Jupyter, 1,572 lines, 5 matches/ results.ipynb - src/
Building_your_dataset/ , Python, 98 linesExcel_manager.py - src/
Building_your_dataset/ , Python, 29 lineschange_files_name.py - src/
Building_your_dataset/ , Python, 38 linesheuristic.py - src/
Building_your_dataset/ , Python, 91 linespatients_selection.py - src/
Generate_your_connectome , Shell, 331 lines, 3 matchess/ tractography_analysis_AD NI.sh - src/
Preprocess_your_images/ , Python, 12 linesflip_bvec.py - src/
Preprocess_your_images/ , Python, 47 linesmetadata_handler_dwi.py - src/
Preprocess_your_images/ , Shell, 364 lines, 4 matchespre_processing_pipeline_ ADNI.sh - LICENSE, License, 21 lines
- README.md, Text, 112 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:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 279 scripts, each with its path and the digest of its content;
- 16 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 and Code Availability
The dataset used in this study is available at https://
Reproduced under the paper's license (CC BY), 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, 3 October 2026: the first record
Recorded: type, language, journal, volume, pages, dates, 4 authors, 3 keywords, 13 MeSH terms, 57 references.
Cite
This paper
Ferritto, C., Lioi, G., Jonin, P.-Y., & Coloigner, J. (2026). Mind the brain age: How segmentation and template selection reshape structural connectomes. Imaging neuroscience (Cambridge, Mass.), 4, IMAG.a.1384. https://
BibTeX
@article{ferritto2026min
author = {Ferritto, Carlo and Lioi, Giulia and Jonin, Pierre-Yves and Coloigner, Julie},
title = {{Mind the brain age: How segmentation and template selection reshape structural connectomes}},
journal = {Imaging neuroscience (Cambridge, Mass.)},
year = {2026},
month = sep,
volume = {4},
pages = {IMAG.a.1384},
publisher = {MIT Press},
issn = {2837-6056},
doi = {10.1162/
url = {https://
pmid = {42824529},
pmcid = {PMC13628500}
}
RIS
TY - JOUR
AU - Ferritto, Carlo
AU - Lioi, Giulia
AU - Jonin, Pierre-Yves
AU - Coloigner, Julie
TI - Mind the brain age: How segmentation and template selection reshape structural connectomes
T2 - Imaging neuroscience (Cambridge, Mass.)
J2 - Imaging Neurosci (Camb)
PY - 2026
DA - 2026/
VL - 4
SP - IMAG.a.1384
SN - 2837-6056
PB - MIT Press
DO - 10.1162/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1162/
"type": "article-journal",
"title": "Mind the brain age: How segmentation and template selection reshape structural connectomes",
"container-title": "Imaging neuroscience (Cambridge, Mass.)",
"author": [
{
"family": "Ferritto",
"given": "Carlo"
},
{
"family": "Lioi",
"given": "Giulia"
},
{
"family": "Jonin",
"given": "Pierre-Yves"
},
{
"family": "Coloigner",
"given": "Julie"
}
],
"container-title-short":
"volume": "4",
"page": "IMAG.a.1384",
"DOI": "10.1162/
"PMID": "42824529",
"PMCID": "PMC13628500",
"ISSN": "2837-6056",
"publisher": "MIT Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
30
]
]
}
}
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.1162/netn_a_00330 [code]
- The human brain connectome weighted by the myelin content and total intra-axonal cross-sectional area of white matter tracts.Journal: Network neuroscience (Cambridge, Mass.)In common: MRtrix3, ANTs, FSL, 4 other tools, structural MRI / diffusion, 19 references
- [2] doi:10.1002/hbm.26239 [code]
- Integrated diffusion image operator (iDIO): A pipeline for automated configuration and processing of diffusion MRI data.Journal: Human brain mappingIn common: MRtrix3, ANTs, FSL, 4 other tools, methods / tools, structural MRI / diffusion, 14 references
- [3] doi:10.1162/imag.a.49 [code]
- Mapping the aggregate g-ratio of white matter tracts using multi-modal MRI.Journal: Imaging neuroscience (Cambridge, Mass.)In common: MRtrix3, ANTs, FSL, 5 other tools, structural MRI / diffusion, 11 references
- [4] doi:10.1162/imag.a.1325 [code]
- Decoding everyday levels of musical training from subcortical white-matter architecture.Journal: Imaging neuroscience (Cambridge, Mass.)In common: MRtrix3, FSL, statsmodels, 5 other tools, structural MRI / diffusion, 11 references
- [5] doi:10.3389/fnins.2024.1385847 [code]
- A practical guide for combining functional regions of interest and white matter bundles.Journal: Frontiers in neuroscienceIn common: ANTs, FSL, pandas, 3 other tools, methods / tools, structural MRI / diffusion, 11 references
- [6] doi:10.1038/s41467-024-46023-2 [code]
- Genetic architecture of the structural connectome.Journal: Nature communicationsIn common: MRtrix3, ANTs, FSL, 4 other tools, structural MRI / diffusion, 11 references
- [7] doi:10.1016/j.nicl.2025.103817 [code]
- Structural connectome manifold changes related to body mass index and their associations with eating psychopathology.Journal: NeuroImage. ClinicalIn common: MRtrix3, ANTs, NetworkX, 7 other tools, structural MRI / diffusion, 8 references
- [8] doi:10.1002/hbm.26578 [code]
- Fibre orientation atlas guided rapid segmentation of white matter tracts.Journal: Human brain mappingIn common: MRtrix3, ANTs, FSL, 4 other tools, methods / tools, structural MRI / diffusion, 9 references
- [9] doi:10.1162/netn_a_00382 [code]
- Comparison of different group-level templates in gradient-based multimodal connectivity analysis.Journal: Network neuroscience (Cambridge, Mass.)In common: NetworkX, statsmodels, seaborn, 4 other tools, 13 references
- [10] doi:10.1162/netn_a_00368 [code]
- Modeling the impact of MRI acquisition bias on structural connectomes: Harmonizing structural connectomes.Journal: Network neuroscience (Cambridge, Mass.)In common: MRtrix3, ANTs, NetworkX, 7 other tools, methods / tools, structural MRI / diffusion, 6 references
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: 2 repositories of the authors' code, each at its verified commit and with its license, 279 scripts, and 16 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:1bbfe2637083f649…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1162/imag.a.1384)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1162/imag.a.1384.svg
:target: https://openscicode.org/badge/doi/10.1162/imag.a.1384
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1162/imag.a.1384"><img src="https://openscicode.org/badge/doi/10.1162/imag.a.1384.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
- Inria-Empenn/Anima-Public: README.md on GitHub
- CarloFerritto/Structural_connectomes_in_Aging: README.md on GitHub
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
