Anatomical-connectivity-guided functional connectivity reveals task-relevant pathways during proactive task-switching via recurrent graph neural networks.
The 3 matches
- [1] § Methods › Dataset description › Stimuli and procedure ↔ DataProcessing/source_est_obj.py, lines 38–75 · score 0.71 · blue circle, blue square, red circle, red square, switch
- [2] § Methods › Behavioral analysis and data preparation › Source reconstruction ↔ DataProcessing/source_est_obj.py, lines 77–154 · score 0.62 · dSPM, covariance, depth, BEM, inverse, noise
- [3] § Methods › Behavioral analysis and data preparation › EEG data preprocessing ↔ DataProcessing/preprocessing_obj.py, lines 108–154 · score 0.61 · ICA components, 1–50 Hz, blinks, preprocessing, EEG, raw
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 · 238 lines · 12 KB · no license · 2 matches
- import dill
- import os, mne, sys
- import numpy as np
- from pathlib import Path
- from mne.datasets import sample
- sys.path.append('../Study/Model/')
- from utils import SampleModule
- class EEGProcessor:
- def __init__(self, raw_folder_path, scratch=False, candidate_events=['repeat', 'switch']):
- self.raw_folder_path = raw_folder_path
- self.subjects_dir = str(sample.data_path())+'/subjects'
- self.src_path = os.path.join(self.subjects_dir, 'fsaverage' , 'bem' , 'fsaverage-ico-5-src.fif')
- self.bem_path = os.path.join(self.subjects_dir, 'fsaverage' , 'bem' , 'fsaverage-5120-5120-5120-bem-sol.fif')
- self.subj_data_dict = {}
- self.events_id = {'left_key': 1, 'right_key': 2, 'red_circle': 5,
- 'blue_circle': 6, 'red_square': 7, 'blue_square': 8,
- 'color_fail': 9, 'shape_fail': 10, 'init_color': 11,
- 'init_shape': 12, 'repeat': 64, 'switch': 128,}
- self.candidate_events = candidate_events
- # 读取映射模板数据
- all_labels = mne.read_labels_from_annot('fsaverage', 'aparc', subjects_dir=self.subjects_dir) # 加载Desikan-Killiany区域的标签
- self.labels = [label for label in all_labels if label.name not in ['unknown-lh', 'unknown-rh']] # 移除'unknown-lh'和'unknown-rh'标签
- if scratch:
- # 创建MNI源空间
- self.src = mne.setup_source_space(subject='fsaverage', subjects_dir=self.subjects_dir, spacing='oct6', add_dist=False)
- # 计算传导模型
- model = mne.make_bem_model(subject='fsaverage', ico=5, subjects_dir=self.subjects_dir)
- self.bem = mne.make_bem_solution(model)
- else:
- # 创建MNI源空间
- self.src = mne.read_source_spaces(self.src_path)
- # 计算传导模型
- self.bem = mne.read_bem_solution(self.bem_path)
- def valid_events(self, all_events, success=False):
- if success:
- # 创建一个新的事件列表,只包含有效的 repeat 和 switch 事件
- valid_events = []
- # 定义目标事件和失败事件
- target_events = [self.events_id['red_circle'], self.events_id['blue_circle'],
- self.events_id['red_square'], self.events_id['blue_square']]
- fail_events = [self.events_id['shape_fail'], self.events_id['color_fail']]
- # 遍历所有的 repeat 和 switch 事件
- for event in all_events:
- if event[2] in [self.events_id['repeat'], self.events_id['switch']]:
- # 查找事件之后的所有事件
- next_events = all_events[np.where(all_events[:, 0] > event[0])[0]]
- # 筛选出后续事件中是目标事件的前三个
- target_occurrences = next_events[np.isin(next_events[:, 2], target_events)][:3]
- # 检查这些目标事件后的下一个事件是否为失败事件
- is_valid = True
- for target_event in target_occurrences:
- # 找到目标事件之后的第一个事件
- following_events = next_events[np.where(next_events[:, 0] > target_event[0])[0]]
- if following_events.shape[0] > 1:
- if following_events[1, 2] in fail_events:
- is_valid = False
- break
- # 如果没有发现任何不满足条件的情况,则当前事件有效
- if is_valid:
- valid_events.append(event)
- return np.array(valid_events)
- else:
- return all_events
- def rough_source_recon(self, raw_clean, success=False):
- '''
- 用于粗略的源重建
- method: 'dSPM' 'MNE' 'sLORETA'
- '''
- snr=3.0
- method='dSPM'
- lambda2 = 1.0 / snr ** 2
- # 读取事件
- events = mne.find_events(raw_clean)
- events = self.valid_events(events, success=success)
- event_info_dict = {}
- # 挑选EEG通道
- picks = mne.pick_types(raw_clean.info, eeg=True)
- # 挑选事件
- new_events_dict = {key:self.events_id[key] for key in self.candidate_events}
- # 遍历event_id字典的键值对
- for key, value in new_events_dict.items():
- # 获取每个event_id的epochs
- epochs_temp = mne.Epochs(raw_clean, events, {key: value},
- tmin=-0.2, tmax=1.2,
- picks=picks,
- baseline=(None, 0),
- preload=True)
- # 计算噪声协方差矩阵
- noise_cov_temp = mne.compute_covariance(epochs_temp,
- tmin=None, tmax=0,
- method='shrunk')
- # 计算前向模型
- fwd_temp = mne.make_forward_solution(epochs_temp.info,
- trans=None, src=self.src, bem=self.bem,
- eeg=True, meg=False)
- # 计算逆向模型(源估计)
- inverse_operator = mne.minimum_norm.make_inverse_operator(epochs_temp.info,
- fwd_temp,
- noise_cov_temp,
- loose=0.2, depth=0.8)
- # 计算源估计
- stc_average = mne.minimum_norm.apply_inverse(epochs_temp.average(),
- inverse_operator,
- lambda2,
- method) #'dSPM' 'MNE' 'sLORETA'
- # 计算源活动的时间序列
- stcs_individual = mne.minimum_norm.apply_inverse_epochs(epochs_temp,
- inverse_operator,
- lambda2,
- method)
- # 投影源估计到Desikan-Killiany区域
- label_time_courses = mne.extract_label_time_course(stcs_individual,
- self.labels,
- inverse_operator['src'],
- mode='mean_flip',
- return_generator=False)
- # 计算repeat和switch事件在源数据中的发生时点
- time_samp_list = self.relative_time(epochs_temp.times, raw_clean.first_samp, events, value)
- # 将事件ID、epochs和噪声协方差矩阵添加到字典中
- event_info_dict[key] = {'event_id': value,
- 'epochs': epochs_temp,
- 'stc_average': stc_average,
- 'inverse_operator': inverse_operator,
- 'label_time_courses': label_time_courses,
- 'time_samp_list': time_samp_list}
- return event_info_dict
- def recon_base(self, suffix='sep1', prefix='sep1', success=False, subj=None):
- base_path = Path(self.raw_folder_path)
- subjects = [folder for folder in base_path.iterdir() if folder.is_dir() and folder.name.startswith("subject")]
- for subject_folder in subjects:
- if subj is not None:
- if subject_folder.name not in subj:
- continue
- src_recon_folder = subject_folder / 'src_recon'
- src_recon_folder.mkdir(exist_ok=True)
- fif_file = next(subject_folder.glob(f"*{prefix}.fif"))
- raw_clean = mne.io.read_raw_fif(fif_file)
- print(f"Processing {fif_file.name}...")
- event_info_dict = self.rough_source_recon(raw_clean, success=success)
- with open(src_recon_folder / f"{subject_folder.name}_event_{suffix}.pkl", "wb") as output_file:
- dill.dump(event_info_dict, output_file)
- def deep_learning_data(self, suffix='sep1', dim_type='region', time_range=None, sample_fraction=1):
- subj_data_dict = {}
- for i in range(1, 21):
- event_info_path = os.path.join(self.raw_folder_path,
- f'subject{i:03d}',
- f'src_recon/subject{i:03d}_event_{suffix}.pkl')
- with open(event_info_path, 'rb') as file:
- event_info_dict = dill.load(file)
- for key, value in event_info_dict.items():
- # Filter by time range
- if time_range is not None:
- start_time, end_time = time_range
- time_mask = (value['epochs'].times >= start_time) & (value['epochs'].times <= end_time)
- else:
- time_mask = np.ones(len(value['epochs'].times), dtype=bool)
- # Filter by sample fraction
- sample_indices = np.arange(0, len(value['epochs'].times), sample_fraction)
- sample_mask = np.zeros(len(value['epochs'].times), dtype=bool)
- sample_mask[sample_indices] = True
- # Apply the masks
- mask = time_mask & sample_mask
- if dim_type == 'region':
- filtered_label_time_courses = [ltc[:, mask] for ltc in value['label_time_courses']]
- elif dim_type == 'channel':
- filtered_label_time_courses = [ltc[:, mask] for ltc in value['epochs'].get_data()]
- if f'subject{i:03d}' not in subj_data_dict.keys():
- subj_data_dict[f'subject{i:03d}'] = [(one_sample, key) for one_sample in filtered_label_time_courses]
- else:
- subj_data_dict[f'subject{i:03d}'].extend([(one_sample, key) for one_sample in filtered_label_time_courses])
- print(f'subject{i:03d} finished!')
- # Serialize the subj_data_dict
- output_folder = os.path.join(self.raw_folder_path, 'group', 'model')
- os.makedirs(output_folder, exist_ok=True) # Ensure the directory exists
- with open(os.path.join(output_folder, f'subj_data_{suffix}_{dim_type}_dict.pkl'), 'rb') as file:
- _, sampling_points, sampling_freq = dill.load(file)
- with open(os.path.join(output_folder, f'subj_data_{suffix}_{dim_type}_dict.pkl'), 'wb') as f:
- dill.dump((subj_data_dict, sampling_points, sampling_freq), f)
- @staticmethod
- def relative_time(raw_times, first_samp, events, value):
- time_samp_list = []
- for event in events:
- if event[-1] == value:
- event_samp = event[0]
- start = int(round(event_samp + raw_times[0] * 1024))-first_samp
- stop = start + len(raw_times)
- imin, imax = 0, int(np.where(raw_times<= 0)[0][-1])+1
- time_samp_list.append((start, stop, imin, imax))
- return time_samp_list
source_est_obj.py, no license · at the source
Overview
- Graduate School of Informatics, Kyoto University,36-1 Yoshida-Honmachi, Sakyo-ku, Kyoto, 606-8501 Japan
- Panasonic Holdings Corporation,Osaka, Japan
- Kyoto Women’s University,Kyoto, Japan
Abstract
In an increasingly complex society, cognitive flexibility is essential for effective multitasking. We developed a novel approach—Anatomical-Conn
Supplementary Information: The online version contains supplementary material available at 10.1186/
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.
OSF p2vka
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
- 30 September 2026: the link answers (HTTP 200)
3 files
- DataProcessing/
Preprocessing.ipynb , Jupyter, 50 lines - DataProcessing/
preprocessing_obj.py , Python, 320 lines, 1 match - DataProcessing/
source_est_obj.py , Python, 238 lines, 2 matches
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;
- 3 scripts, each with its path and the digest of its content;
- 3 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 datasets generated and analyzed in this study, together with the optimal models and experimental analysis code, are available in the Open Science Framework repository (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, 30 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 8 keywords, 142 references.
Cite
This paper
Wang, S., Miyata, A., Okuya, T., Yanagawa, H., Sakaki, A., Ichinose, N., & Kumada, T. (2026). Anatomical-connectivity-
BibTeX
@article{wang2026anatomi
author = {Wang, Siyu and Miyata, Atsushi and Okuya, Teruhisa and Yanagawa, Hiroto and Sakaki, Ayaka and Ichinose, Natsuhiro and Kumada, Takatsune},
title = {{Anatomical-connectivit
journal = {Brain informatics},
year = {2026},
month = apr,
volume = {13},
number = {1},
pages = {20},
publisher = {Springer},
issn = {2198-4018},
doi = {10.1186/
url = {https://
pmid = {42035367},
pmcid = {PMC13237348}
}
RIS
TY - JOUR
AU - Wang, Siyu
AU - Miyata, Atsushi
AU - Okuya, Teruhisa
AU - Yanagawa, Hiroto
AU - Sakaki, Ayaka
AU - Ichinose, Natsuhiro
AU - Kumada, Takatsune
TI - Anatomical-connectivity-
T2 - Brain informatics
J2 - Brain Inform
PY - 2026
DA - 2026/
VL - 13
IS - 1
SP - 20
SN - 2198-4018
PB - Springer
DO - 10.1186/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1186/
"type": "article-journal",
"title": "Anatomical-connectivity
"container-title": "Brain informatics",
"author": [
{
"family": "Wang",
"given": "Siyu"
},
{
"family": "Miyata",
"given": "Atsushi"
},
{
"family": "Okuya",
"given": "Teruhisa"
},
{
"family": "Yanagawa",
"given": "Hiroto"
},
{
"family": "Sakaki",
"given": "Ayaka"
},
{
"family": "Ichinose",
"given": "Natsuhiro"
},
{
"family": "Kumada",
"given": "Takatsune"
}
],
"container-title-short":
"volume": "13",
"issue": "1",
"page": "20",
"DOI": "10.1186/
"PMID": "42035367",
"PMCID": "PMC13237348",
"ISSN": "2198-4018",
"publisher": "Springer",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
26
]
]
}
}
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.3758/s13415-026-01436-y
- Neural correlates of asymmetric switch costs during affective task switching.Journal: Cognitive, affective & behavioral neuroscienceIn common: EEG, cognitive, 8 references
- [2] doi:10.3758/s13415-026-01420-6
- Are neural and behavioural measures of cognitive control associated with adaptive and maladaptive risk-taking in adolescence and young adulthood?Journal: Cognitive, affective & behavioral neuroscienceIn common: EEG, cognitive, 8 references
- [3] doi:10.1371/journal.pone.0351872 [code]
- Decoding visual object recognition from EEG signals.Journal: PloS oneIn common: MNE-Python, Matplotlib, NumPy, EEG, 4 references
- [4] doi:10.3390/s26134019 [code]
- NeuroStat: An Open-Source EEG Connectivity Platform for Randomised Controlled Trials.Journal: Sensors (Basel, Switzerland)In common: MNE-Python, Matplotlib, NumPy, EEG, 4 references
- [5] doi:10.1162/imag.a.1245 [code]
- Towards precision EEG connectomics: Evaluating the benefits of dense sampling.Journal: Imaging neuroscience (Cambridge, Mass.)In common: MNE-Python, Matplotlib, NumPy, EEG, 4 references
- [6] doi:10.1016/j.isci.2026.117068 [code]
- Directed graph neural networks with partial directed coherence for seizure prediction and epileptogenic network characterization.Journal: iScienceIn common: NumPy, 4 references
- [7] doi:10.7554/elife.108673 [code]
- Adaptive behavior is guided by integrated representations of controlled and non-controlled information.Journal: eLifeIn common: MNE-Python, Matplotlib, NumPy, EEG, 3 references
- [8] doi:10.1162/imag.a.1034 [code]
- Top-down selection of visual working memory contents is supported by alpha-band phase-synchronized oscillatory networksJournal: n/aIn common: Matplotlib, NumPy, cognitive, 4 references
- [9] doi:10.1093/cercor/bhag075 [code]
- Cortical dynamics of icon perception: effects of concreteness and attractiveness.Journal: Cerebral cortex (New York, N.Y. : 1991)In common: MNE-Python, Matplotlib, NumPy, cognitive, 3 references
- [10] doi: [code]
- Neural Correlates of Inhibitory Control in Impulsivity Traits in Non-Ecological Human–Computer Tasks: An ALE Meta-AnalysisJournal: Brain sciencesIn common: cognitive, 5 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: 1 repository of the authors' code, each at its verified commit and with its license, 3 scripts, and 3 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:78a516435c3a614a…
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
[.
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.
