OSCR

Top-down selection of visual working memory contents is supported by alpha-band phase-synchronized oscillatory networks

Code ↔ Paper

5 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 5 matches
  1. [1] § Methods › Classification analysis of trials of single features ↔ Figure_6_computation_synchrony.py, lines 145–223 · score 0.74 · random forest classifier, Classification accuracy, binary mask, trained, matrices, baseline
  2. [2] § Methods › Classification analysis of trials of single features ↔ Figure_6_computation_amplitude.py, lines 63–142 · score 0.64 · random forest classifier, Classification accuracy, trained, amplitudes, matrices, baseline
  3. [3] § Methods › Classification analysis of trials of single features ↔ Figure_6_computation_synchrony.py, lines 145–223 · score 0.60 · random forest classification, binary mask, matrices, baseline, synchronization
  4. [4] § Results › The memorized visual feature can be decoded from α-band synchronization patterns ↔ Figure_6_computation_amplitude.py, lines 63–142 · score 0.55 · random forest classifier, Classification accuracy, trained, baseline, Figure 6
  5. [5] § Results › α-band network synchronization predicts individual behavioral performance ↔ Figure_5_visualization.py, lines 127–167 · score 0.54 · Hit Rates, graph strength, iPLV, Pearson, HR, behavioral

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 · 223 lines · 8.8 KB · no license · 2 matches

  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Sat Sep 9 11:55:43 2023
  4. @author: hhaque
  5. """
  6. import numpy as np
  7. import os
  8. import pandas as pd
  9. from sklearn.ensemble import RandomForestClassifier
  10. from sklearn.model_selection import LeaveOneOut
  11. def get_complex(a, b):
  12. c = complex(a,b)
  13. return c
  14. vcomplex = np.vectorize(get_complex)
  15. def bin_to_npy(subject, condition, condition_set_name, frequency):
  16. fpath = '{}\\__trial_connectomes_csv\\{}\\{} {} Hz\\'.format(subject, condition_set_name, condition, frequency)
  17. nb_of_trials = int(len(os.listdir(fpath)) / 2)
  18. for trial in range(nb_of_trials):
  19. filename_re = '{} {} {} Hz trial_{} re.bin'.format(condition_set_name, condition, frequency, trial)
  20. filename_im = '{} {} {} Hz trial_{} im.bin'.format(condition_set_name, condition, frequency, trial)
  21. fpath_re = fpath + filename_re
  22. fpath_im = fpath + filename_im
  23. IM_real = np.fromfile(fpath_re, dtype='>f')
  24. IM_imag = np.fromfile(fpath_im, dtype='>f')
  25. trial_IM = vcomplex(IM_real, IM_imag)
  26. baseline_IM = trial_IM[0:79800]
  27. firstTW = trial_IM[79800:159600]
  28. secondTW = trial_IM[159600:]
  29. if trial == 0:
  30. all_IM = np.stack([baseline_IM, firstTW, secondTW])
  31. all_IM = np.expand_dims(all_IM, axis = 0)
  32. if trial != 0:
  33. IM = np.stack([baseline_IM, firstTW, secondTW])
  34. IM = np.expand_dims(IM, axis = 0)
  35. all_IM = np.vstack([all_IM, IM])
  36. return all_IM
  37. def get_iPLV_matrix(all_matrices, TW):
  38. IMs = all_matrices[:, TW, :] #extracting single TW from 3D (results in 2D)
  39. average = np.mean(IMs, axis = 0) #averages across all trials (results in 1D)
  40. iPLV_matrix = abs(average.imag) #taking iPLV of each element
  41. return iPLV_matrix
  42. def get_binary_mask(all_matrices, TW, tie = 1000):
  43. baseline_iPLV = get_iPLV_matrix(all_matrices, 0) #getting 1D matrix of average iPLV values for baseline
  44. retention_iPLV = get_iPLV_matrix(all_matrices, TW) #getting 1D matrix of average iPLV values for a retention window
  45. difference_iPLV = np.subtract(retention_iPLV, baseline_iPLV) #difference between the two
  46. max_indices = np.argsort(difference_iPLV)[::-1]
  47. binary_mask = np.zeros(np.shape(difference_iPLV))
  48. for i in range(tie):
  49. binary_mask[max_indices[i]] = 1
  50. return binary_mask
  51. def get_1D_sync_vector(input_matrix, binary_mask):
  52. input_matrix = input_matrix.imag
  53. input_matrix = np.where(input_matrix == 0, 1e-12, input_matrix)
  54. input_matrix = input_matrix * binary_mask #taking imag ONLY and then masking it
  55. output_matrix = input_matrix[input_matrix != 0] #removing elements with 0 and vector gets shorter
  56. return output_matrix
  57. def get_feature_matrix(npy_file, TW, binary_mask):
  58. nb_trials = np.shape(npy_file)[0]
  59. for i in range(nb_trials):
  60. trial_matrix = npy_file[i, TW, :]
  61. trial_vector = get_1D_sync_vector(trial_matrix, binary_mask)
  62. if i == 0:
  63. feature_matrix = trial_vector
  64. else:
  65. feature_matrix = np.vstack((feature_matrix, trial_vector))
  66. return feature_matrix
  67. '''Import trial IM and create feature array'''
  68. subject_list = ['S{:03d}'.format(i) for i in range(1, 21)]
  69. condition_set_name = '3x2_Feature_x_Obj'
  70. load = '2'
  71. conditions = ['Shape{}_HIT'.format(load), 'Color{}_HIT'.format(load), 'Spatial{}_HIT'.format(load)]
  72. frequencies = ['3.00', '3.28', '3.68', '4.02', '4.29', '4.52', '5.05',
  73. '5.63', '6.00', '6.56', '7.40', '8.05', '8.57', '9.03',
  74. '10.09', '11.25', '12.00', '13.06', '14.89', '16.00',
  75. '17.14', '18.00', '20.10', '22.50', '24.00', '25.95',
  76. '30.00', '34.29', '36.00', '40.00', '45.00', '51.43',
  77. '60.00', '72.00', '80.00', '90.00', '102.86', '120.00']
  78. for frequency in frequencies:
  79. frequency = frequency.replace('.', '-')
  80. print(frequency)
  81. all_matrices = []
  82. for subject in subject_list:
  83. for idx, condition in enumerate(conditions):
  84. npy_matrix = bin_to_npy(subject, condition, condition_set_name, frequency)
  85. if idx == 0:
  86. subject_matrices = npy_matrix
  87. if idx > 0:
  88. subject_matrices = np.vstack((subject_matrices, npy_matrix))
  89. all_matrices.append(subject_matrices)
  90. print('{} added to all_matrices for {}'.format(subject, frequency))
  91. for TW in [1, 2]:
  92. binary_mask = get_binary_mask(all_matrices, TW)
  93. for id_s, subject in enumerate(subject_list):
  94. subject_IMs_allTW = all_matrices[id_s]
  95. subject_IMs = subject_IMs_allTW[:, TW, :]
  96. subject_IMs_baseline = subject_IMs_allTW[:, 0, :]
  97. trial_nbs = int(subject_IMs.shape[0] / len(conditions))
  98. output_fpath = '\\Single_trial_matrices\\{}\\{}'.format(subject, condition_set_name)
  99. if not os.path.exists(output_fpath):
  100. os.makedirs(output_fpath)
  101. for id_c, condition in enumerate(conditions):
  102. if id_c == 0:
  103. condition_IM = subject_IMs[0:trial_nbs, :]
  104. condition_IM_baseline = subject_IMs_baseline[0:trial_nbs, :]
  105. if id_c == 1:
  106. condition_IM = subject_IMs[trial_nbs:(trial_nbs*2), :]
  107. condition_IM_baseline = subject_IMs_baseline[trial_nbs:(trial_nbs*2), :]
  108. if id_c == 2:
  109. condition_IM = subject_IMs[(trial_nbs*2):, :]
  110. condition_IM_baseline = subject_IMs_baseline[(trial_nbs*2):, :]
  111. feature_matrix = get_feature_matrix(condition_IM, binary_mask)
  112. feature_matrix_baseline = get_feature_matrix(condition_IM_baseline, binary_mask)
  113. feature_matrix_baseline = np.mean(feature_matrix_baseline, axis = 0)
  114. feature_matrix = feature_matrix - feature_matrix_baseline
  115. feature_matrix_output = '{}\\{}_TW{}_{}_feature_array.npy'.format(output_fpath, condition, TW, frequency)
  116. np.save(feature_matrix_output, feature_matrix)
  117. '''Perform random forest classification'''
  118. fpath = '\\Single_trial_matrices'
  119. conditions = ['Shape4_HIT', 'Color4_HIT', 'Spatial4_HIT']
  120. for subject in subject_list:
  121. print(subject)
  122. output_name = 'Synchrony_three_features_load4_{}'.format(subject)
  123. list_of_accuracies = []
  124. for TW in [1, 2]:
  125. classification_accuracy = []
  126. for frequency in frequencies:
  127. frequency = frequency.replace('.', '-')
  128. fpath = 'Single_trial_matrices\\{}\\{}'.format(subject, condition_set_name)
  129. for idx, condition in enumerate(conditions):
  130. npy_file = '{}\\{}_TW{}_{}_feature_array.npy'.format(fpath, condition, TW, frequency)
  131. npy_matrix = np.load(npy_file)
  132. y_condition = [idx] * np.shape(npy_matrix)[0]
  133. if idx == 0:
  134. X = npy_matrix
  135. y = y_condition
  136. if idx > 0:
  137. X = np.concatenate([X, npy_matrix])
  138. y.extend(y_condition)
  139. y = np.array(y)
  140. corr_predict = 0
  141. wrong_predict = 0
  142. loo = LeaveOneOut()
  143. for train_index, test_index in loo.split(X):
  144. X_train, X_test = X[train_index], X[test_index]
  145. y_train, y_test = y[train_index], y[test_index]
  146. clf = RandomForestClassifier(random_state=0)
  147. clf.fit(X_train, y_train)
  148. X_predicted = clf.predict(X_test)
  149. if np.array_equal(X_predicted, y_test) == True:
  150. corr_predict += 1
  151. else:
  152. wrong_predict += 1
  153. if (corr_predict + wrong_predict) == np.shape(X)[0]:
  154. print('{} is done'.format(frequency))
  155. else:
  156. print('Hmm, sth went wrong')
  157. classification_accuracy.append(corr_predict / np.shape(X)[0])
  158. list_of_accuracies.append(classification_accuracy)
  159. df = pd.DataFrame(list_of_accuracies)
  160. df = df.transpose()
  161. df.columns = ['Early', 'Late']
  162. df['Frequency'] = frequencies
  163. df = df[['Frequency', 'Early', 'Late']]
  164. output_fpath = 'Classification_output\\'
  165. output_fpath = output_fpath + output_name + '.csv'
  166. df.to_csv(output_fpath, index = False, sep = ',')

Figure_6_computation_synchrony.py at commit 0ebb16f, no license · at the source

Overview

  1. Neuroscience Center, HiLIFE-Helsinki Institute of Life Science, University of Helsinki, Helsinki, Finland
  2. BioMag Laboratory, HUS Medical Imaging Centre, Helsinki University Central Hospital, Helsinki, Finland
  3. Department of Neuroscience and Biomedical Engineering (NBE), Aalto University, Espoo, Finland
  4. Centre for Cognitive Neuroimaging (CCNi), School of Psychology and Neuroscience, University of Glasgow, Glasgow, United Kingdom
Journal: n/a, volume 3, article IMAG.a.1034
Dates: received 15 November 2024; accepted 30 October 2025; published online 23 December 2025
Type: Research article · Language: English
License: none stated
Identifiers: DOI 10.1162/imag.a.1034 · PMCID PMC12723408 · OpenAlex W4416707876
Open access: diamond, a free copy (OpenAlex)
Status: code verified
Categories: MEG (modality), cognitive (subfield)
Methods: Connectivity, Statistics, Smoothing, state filtering, decompositions, Machine learning, Preprocessing, Spectral & time-frequency, Graphs, fMRI & imaging, Physiology & signal measures
Keywords: MEG, oscillation, working memory, machine learning, synchronization
Topic: Neural dynamics and brain function (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Academy of Finland (SA 253130, SA 325404); Sigrid-Juselius-Foundation
Citations: not cited yet (Europe PMC); 104 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (none stated) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repositories

Its files are read in the Code ↔ Paper reader above, with 5 matches between paragraphs and lines of code.

palvalab/vwm_synchronization

License: none: the authors keep all their rights
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: 0ebb16fda87a10118f2fea3dd6cadb707dc77064, 21 December 2023
Languages: Python (15)
Size: 17 files, 15 scripts
Software Heritage: archived
Found in: “Data and Code Availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: pandas (13 files), NumPy (12 files), Matplotlib (9 files), seaborn (8 files), SciPy (7 files), scikit-learn (2 files)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
15 files

doi:10.5061/dryad.np5hqc00n

License: none: the authors keep all their rights
State: the link answers, verified on 26 September 2026
Evidence: the link answers
Software Heritage: not checked
Found in: “Data and Code Availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 26 September 2026: the link answers (HTTP 200)
  • 26 September 2026: the link answers (HTTP 200)

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;
  • 15 scripts, each with its path and the digest of its content;
  • 5 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

Datasets cited

Code and data availability statement

The paper has a code and data availability statement. Its license (none stated) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1162/imag.a.1034.

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, 27 September 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 6 authors, 5 keywords, 2 funders, 104 references.

Cite

This paper

Haque, H., Wang, S. H., Siebenhühner, F., Robertson, E. M., Palva, J. M., & Palva, S. (2025). Top-down selection of visual working memory contents is supported by alpha-band phase-synchronized oscillatory networks. Imaging Neuroscience, 3, IMAG.a.1034. https://doi.org/10.1162/imag.a.1034

BibTeX

@article{haque2025top,
author = {Haque, Hamed and Wang, Sheng H and Siebenhühner, Felix and Robertson, Edwin M and Palva, J Matias and Palva, Satu},
title = {{Top-down selection of visual working memory contents is supported by alpha-band phase-synchronized oscillatory networks}},
journal = {Imaging Neuroscience},
year = {2025},
volume = {3},
pages = {IMAG.a.1034},
publisher = {MIT Press},
issn = {2837-6056},
doi = {10.1162/imag.a.1034},
url = {https://doi.org/10.1162/imag.a.1034},
pmcid = {PMC12723408}
}

RIS

TY - JOUR
AU - Haque, Hamed
AU - Wang, Sheng H
AU - Siebenhühner, Felix
AU - Robertson, Edwin M
AU - Palva, J Matias
AU - Palva, Satu
TI - Top-down selection of visual working memory contents is supported by alpha-band phase-synchronized oscillatory networks
T2 - Imaging Neuroscience
J2 - Imaging Neurosci (Camb)
PY - 2025
DA - 2025
VL - 3
SP - IMAG.a.1034
SN - 2837-6056
PB - MIT Press
DO - 10.1162/imag.a.1034
UR - https://doi.org/10.1162/imag.a.1034
LA - en
ER -

CSL-JSON

{
"id": "10.1162/imag.a.1034",
"type": "article-journal",
"title": "Top-down selection of visual working memory contents is supported by alpha-band phase-synchronized oscillatory networks",
"container-title": "Imaging Neuroscience",
"author": [
{
"family": "Haque",
"given": "Hamed"
},
{
"family": "Wang",
"given": "Sheng H"
},
{
"family": "Siebenhühner",
"given": "Felix"
},
{
"family": "Robertson",
"given": "Edwin M"
},
{
"family": "Palva",
"given": "J Matias"
},
{
"family": "Palva",
"given": "Satu"
}
],
"container-title-short": "Imaging Neurosci (Camb)",
"volume": "3",
"page": "IMAG.a.1034",
"DOI": "10.1162/imag.a.1034",
"PMCID": "PMC12723408",
"ISSN": "2837-6056",
"publisher": "MIT Press",
"URL": "https://doi.org/10.1162/imag.a.1034",
"language": "en",
"issued": {
"date-parts": [
[
2025
]
]
}
}

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.1038/s42003-026-10071-9 [code]
Alpha phase coding supports feature binding during working memory maintenance.
Journal: Communications biology
In common: scikit-learn, SciPy, Matplotlib, 1 other tool, MEG, cognitive, 11 references
[2] doi:10.1038/s41467-026-73818-2 [code]
Prefrontal parvalbumin neurons mediate working memory in a task demand-dependent manner.
Journal: Nature communications
In common: scikit-learn, pandas, SciPy, 2 other tools, cognitive, 6 references
[3] doi:10.7554/elife.108017 [code]
Visual working memory guides attention rhythmically in humans.
Journal: eLife
In common: cognitive, 8 references
[4] doi:10.1162/imag.a.1335 [code]
Functionally distinct alpha components are differentially modulated by attention and affect behavior.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: MEG, cognitive, 7 references
[5] doi:10.1016/j.isci.2026.117377 [code]
Resting-state neural oscillations predict individual differences in verbal learning and encoding strategy use.
Journal: iScience
In common: scikit-learn, SciPy, Matplotlib, 1 other tool, MEG, cognitive, 4 references
[6] doi:10.1038/s41467-026-75959-w [code]
Charting higher-order models of brain function beyond pairwise interactions.
Journal: Nature communications
In common: seaborn, scikit-learn, pandas, 3 other tools, 5 references
[7] doi:10.1093/nc/niag029 [code]
A data-driven approach to identifying and evaluating connectivity-based neural correlates of conscious visual perception.
Journal: Neuroscience of consciousness
In common: seaborn, scikit-learn, pandas, 3 other tools, MEG, cognitive, 3 references
[8] doi:10.7554/elife.108408 [code]
Frequency and laminar profile of feature-specific visual activity revealed by interleaved EEG-fMRI.
Journal: eLife
In common: seaborn, pandas, SciPy, 2 other tools, 4 references
[9] doi:10.1038/s41467-026-75705-2 [code]
Redundant prefrontal hemispheres adapt storage strategy to working memory demands.
Journal: Nature communications
In common: seaborn, scikit-learn, pandas, 3 other tools, cognitive, 3 references
[10] doi:10.1038/s41593-026-02285-1 [code]
Fixation duration on natural scenes is explained by memory encoding not processing demand.
Journal: Nature neuroscience
In common: seaborn, scikit-learn, pandas, 3 other tools, MEG, cognitive, 2 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.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.