Dynamic, state-dependent characteristics of cognitive fluctuations in Lewy body dementia: a magnetoencephalography study.
The 7 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
- [1] § Materials and methods › MEG data acquisition and preprocessing ↔ 1_osl_ephys/1_preprocessing.py, lines 18–90 · score 0.91 · notch filtered, Bad segments, Bad channels, MNE, osl ephys, 125 Hz
- [2] § Materials and methods › Hidden Markov models › Implementation ↔ 2_osl_dynamics/1_prepare_data.py, lines 57–58 · score 0.64 · TFRecord, sequence length, OSL Dynamics, training, HMM
- [3] § Materials and methods › Hidden Markov models › Implementation ↔ 2_osl_dynamics/2_train_hmm_revision.py, lines 14–54 · score 0.59 · sequence length, OSL Dynamics, TFRecord, fitting, training, batch
- [4] § Materials and methods › Data analysis ↔ 2_osl_dynamics/5_calc_post_hoc.py, lines 78–93 · score 0.58 · Power spectral densities, multitaper, tapered, weighted
- [5] § Materials and methods › Hidden Markov models › Implementation ↔ 2_osl_dynamics/2_train_hmm_revision.py, lines 14–54 · score 0.57 · free energy, epoch, probabilities, training, batches, covariances
- [6] § Materials and methods › MEG data acquisition and preprocessing ↔ 1_osl_ephys/3_source_reconstruction.py, lines 47–96 · score 0.50 · symmetric, beamforming, orthogonalization, rank, reconstruct, space
- [7] § Materials and methods › MEG data acquisition and preprocessing ↔ 1_osl_ephys/3_source_reconstruction_revise.py, the whole file · a weak match · score 0.50 · symmetric, beamforming, orthogonalization, rank, reconstruct, space
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 · 54 lines · 1.4 KB · no license · 2 matches
- from sys import argv
- if len(argv) != 3:
- print("Please pass the number of states and run id, e.g. python 2_train_hmm.py 8 1")
- exit()
- n_states = int(argv[1])
- run = int(argv[2])
- output_dir = f"/HMM/resultsCC/models/{n_states:02d}_states/run{run:02d}"
- print("Importing packages")
- import pickle
- from osl_dynamics.data import load_tfrecord_dataset
- from osl_dynamics.models.hmm import Config, Model
- # Settings
- config = Config(
- n_states=n_states,
- n_channels=120,
- sequence_length=400,
- learn_means=False,
- learn_covariances=True,
- learn_trans_prob=True,
- batch_size=32,
- learning_rate=0.001,
- n_epochs=10,
- )
- # Load training data
- dataset = load_tfrecord_dataset(
- "/HMM/cc60_training_dataset",
- config.batch_size,
- buffer_size=5000,
- )
- # Build model
- model = Model(config)
- model.summary()
- # Initialization
- model.random_state_time_course_initialization(
- dataset,
- n_init=3,
- n_epochs=1,
- )
- # Full training
- print("Training model")
- history = model.fit(dataset)
- # Save the trained model
- model.save(output_dir)
- # Get free energy
- free_energy = model.free_energy(dataset)
- history["free_energy"] = free_energy
- # Save training history
- with open(f"{output_dir}/history.pkl", "wb") as file:
- pickle.dump(history, file)
- with open(f"{output_dir}/loss.dat", "w") as file:
- file.write(f"ll_loss = {history['loss'][-1]}\n")
- file.write(f"free_energy = {free_energy}\n")
2_train_hmm_revision.py at commit f3cb5a0, no license · at the source
Overview
- Department of Neurology, University of Florida, Gainesville, FL 32611, USA
- The Norman Fixel Institute of Neurological Diseases, University of Florida Health, Gainesville, FL 32608, USA
- Department of Industrial and Systems Engineering, University of Florida, Gainesville, FL 32611, USA
Abstract
Cognitive fluctuations are a hallmark clinical feature of Lewy body dementia (LBD), yet their underlying neural mechanisms remain poorly understood. This study aimed to identify dynamic, state-dependent neural signatures of cognitive fluctuations in LBD using magnetoencephalography and dynamic functional connectivity based on hidden Markov modelling. Resting-state magnetoencephalography data were acquired from individuals with LBD, Parkinson’s disease without dementia and cognitively normal controls. Hidden Markov modelling was used to identify transient brain states followed by spectral analyses across regions and states. Additionally, associations between regional spectral power and cognitive fluctuations severity, measured by the Clinician Assessment of Fluctuation, were assessed. Patients with LBD exhibited a distinct pattern of brain dynamics, particularly in two states (States 2 and 6), characterized by increased fractional occupancy of State 2 and markedly reduced occupancy of State 6, contrasting with the more distributed state engagement observed in Parkinson’s disease and normal controls. Spectral analyses revealed widespread slowing in LBD, with elevated theta/
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 7 matches between paragraphs and lines of code.
sadeqi60/MEG_HMM_LBD
f3cb5a03419aea21585549eabd3492360e210030, 1 August 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
23 files
- 1_osl_ephys/
1_preprocessing.py , Python, 90 lines, 1 match - 1_osl_ephys/
2_coregistration.py , Python, 122 lines - 1_osl_ephys/
2_coregistration_revise. , Python, 46 linespy - 1_osl_ephys/
3_source_reconstruction. , Python, 97 lines, 1 matchpy - 1_osl_ephys/
3_source_reconstruction_ , Python, 42 lines, 1 matchrevise.py - 1_osl_ephys/
4_sign.py , Python, 44 lines - 2_osl_dynamics/
1_prepare_data.py , Python, 61 lines, 1 match - 2_osl_dynamics/
2_train_hmm.py , Python, 71 lines - 2_osl_dynamics/
2_train_hmm_revision.py , Python, 54 lines, 2 matches - 2_osl_dynamics/
3_print_free_energy.py , Python, 34 lines - 2_osl_dynamics/
4_get_inf_params.py , Python, 44 lines - 2_osl_dynamics/
5_calc_post_hoc.py , Python, 113 lines, 1 match - 3_ggseg_visualizations/
0_R_Packages_Installatio , R, 73 linesn.R - 3_ggseg_visualizations/
1_Loading_Libraries_and_ , R, 180 linesData.R - 3_ggseg_visualizations/
2_Fractional_Occupancy_A , R, 176 linesnalysis.R - 3_ggseg_visualizations/
3_Power_Spectoral_Densit , R, 71 linesies_Analysis.R - 3_ggseg_visualizations/
3_TBR_Analysis.R , R, 129 lines - 3_ggseg_visualizations/
4_LBD_NC_TBR_Difference_ , R, 138 linesAnalysis.R - 3_ggseg_visualizations/
5_LBD_NC_Power_Differenc , R, 158 linese_Analysis.R - 3_ggseg_visualizations/
6_PD_NC_Power_Difference , R, 139 lines_Analysis.R - 3_ggseg_visualizations/
7_LBD_CAF_Correlation_An , R, 160 linesalysis.R - 3_ggseg_visualizations/
libraries/ , R, 63 lineslibraries.R - README.md, Text, 65 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 22 scripts, each with its path and the digest of its content;
- 7 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 preprocessing scripts, hidden Markov model (HMM) analysis code and visualization pipelines used in this study are openly available in a dedicated GitHub 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, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 8 authors, 5 keywords, 3 funders, 77 references.
Cite
This paper
Sadeqi, H., Ahmadi, B., Morshedizad, Z., Burke, R., Patel, B., McFarland, N. R., Armstrong, M. J., & Babajani-Feremi, A. (2026). Dynamic, state-dependent characteristics of cognitive fluctuations in Lewy body dementia: a magnetoencephalography study. Brain communications, 8(4), fcag236. https://
BibTeX
@article{sadeqi2026dynam
author = {Sadeqi, Hojjatollah and Ahmadi, Babak and Morshedizad, Zohreh and Burke, Rachael and Patel, Bhavana and McFarland, Nikolaus R and Armstrong, Melissa J and Babajani-Feremi, Abbas},
title = {{Dynamic, state-dependent characteristics of cognitive fluctuations in Lewy body dementia: a magnetoencephalography study}},
journal = {Brain communications},
year = {2026},
month = jun,
volume = {8},
number = {4},
pages = {fcag236},
publisher = {Oxford University Press},
issn = {2632-1297},
doi = {10.1093/
url = {https://
pmid = {42491938},
pmcid = {PMC13378770}
}
RIS
TY - JOUR
AU - Sadeqi, Hojjatollah
AU - Ahmadi, Babak
AU - Morshedizad, Zohreh
AU - Burke, Rachael
AU - Patel, Bhavana
AU - McFarland, Nikolaus R
AU - Armstrong, Melissa J
AU - Babajani-Feremi, Abbas
TI - Dynamic, state-dependent characteristics of cognitive fluctuations in Lewy body dementia: a magnetoencephalography study
T2 - Brain communications
J2 - Brain Commun
PY - 2026
DA - 2026/
VL - 8
IS - 4
SP - fcag236
SN - 2632-1297
PB - Oxford University Press
DO - 10.1093/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1093/
"type": "article-journal",
"title": "Dynamic, state-dependent characteristics of cognitive fluctuations in Lewy body dementia: a magnetoencephalography study",
"container-title": "Brain communications",
"author": [
{
"family": "Sadeqi",
"given": "Hojjatollah"
},
{
"family": "Ahmadi",
"given": "Babak"
},
{
"family": "Morshedizad",
"given": "Zohreh"
},
{
"family": "Burke",
"given": "Rachael"
},
{
"family": "Patel",
"given": "Bhavana"
},
{
"family": "McFarland",
"given": "Nikolaus R"
},
{
"family": "Armstrong",
"given": "Melissa J"
},
{
"family": "Babajani-Feremi",
"given": "Abbas"
}
],
"container-title-short":
"volume": "8",
"issue": "4",
"page": "fcag236",
"DOI": "10.1093/
"PMID": "42491938",
"PMCID": "PMC13378770",
"ISSN": "2632-1297",
"publisher": "Oxford University Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
24
]
]
}
}
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.1002/hbm.70516 [code]
- Effects of Age on Resting-State Cortical Networks.Journal: Human brain mappingIn common: OHBA Software Library (OSL), MNE-Python, pandas, 1 other tool, MEG, 11 references
- [2] doi:10.1162/imag.a.1190 [code]
- Canonical Hidden Markov Model Networks for studying M/
EEG. Journal: Imaging neuroscience (Cambridge, Mass.)In common: OHBA Software Library (OSL), MNE-Python, pandas, 1 other tool, MEG, 9 references - [3] doi:10.1093/bioinformatics/btag592 [code]
- Network-based stratification of allele-specific expression reveals patient subgroups in Huntington's disease.Journal: Bioinformatics (Oxford, England)In common: randomForest, pROC, broom, 9 other tools
- [4] doi:10.1038/s42003-026-10957-8 [code]
- Brain defence by the extracellular matrix protein Cochlin.Journal: Communications biologyIn common: randomForest, caret, broom, 8 other tools
- [5] 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 consciousnessIn common: ggseg, easystats, broom, 7 other tools, MEG, 1 reference
- [6] doi:10.1002/hbm.70605 [code]
- BrainEnrich: Revealing Biological Insights for Imaging-Derived Phenotypes Through Transcriptomic Enrichment.Journal: Human brain mappingIn common: ggseg, easystats, broom, 8 other tools
- [7] doi:10.1093/braincomms/fcag146 [code]
- Convergent structural brain alterations in chronic pain: a multi-metric individual participant data meta-analysis.Journal: Brain communicationsIn common: ggseg, pROC, caret, 6 other tools
- [8] doi:10.1162/imag.a.1237 [code]
- Modelling discrete states and long-term dynamics in functional brain networks.Journal: Imaging neuroscience (Cambridge, Mass.)In common: MNE-Python, pandas, NumPy, MEG, 8 references
- [9] doi:10.3390/ijms27104466 [code]
- Uncovering the Key Circuit FOSL2/
FOS/ EGR3/ EGR1, Contributing to the Hyperexcitability of Excitatory Neurons in the Epileptic Temporal Cortex and Hippocampus. Journal: International journal of molecular sciencesIn common: pROC, caret, igraph, 7 other tools - [10] doi:10.1016/j.isci.2026.115657 [code]
- Integration of machine learning to develop a disulfidptosis model for predicting glioma prognosis, immunotherapy response, and drug.Journal: iScienceIn common: pROC, psych, broom, 7 other tools
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, 22 scripts, and 7 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:50f9471b48007710…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
