OSCR

A Dataset of Microelectrode Recordings from Deep Brain Stimulation Procedures.

Code ↔ Paper

8 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 8 matches · 2 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
  1. [1] § Technical Validation › Artifact removal and quality control ↔ signal_quality_classifier/classifier/random_forest_trainer.py, lines 58–93 · score 0.85 · weighted F1 score, confusion matrix, balanced accuracy, Random Forest, leakage, predictions
  2. [2] § Technical Validation › Validation of subcortical brain structure annotations ↔ brain_layer_classifier/model_trainer_manual_features.py, the whole file · a weak match · score 0.84 · brain layer classifier, logistic regression, F1 score, windowing, accuracy, overlapping
  3. [3] § Technical Validation › Validation of subcortical brain structure annotations ↔ brain_layer_classifier/model_trainer.py, the whole file · a weak match · score 0.78 · brain layer classifier, F1 score, RBF, kernel, windowing, accuracy
  4. [4] § Technical Validation › Artifact removal and quality control ↔ signal_quality_classifier/cleaning/best_segment_extractor.py, lines 134–171 · score 0.70 · quality segments, artifact segments, segment duration, Neuronal Activity, classifications
  5. [5] § Methods › Signal quality classification ↔ signal_quality_classifier/cleaning/best_segment_extractor.py, lines 134–171 · score 0.66 · high quality, Neuronal activity, prioritizes, longest, duration, artifact
  6. [6] § Methods › Signal quality classification ↔ signal_quality_classifier/training_data/feature_definitions.py, lines 6–36 · score 0.58 · detected spikes, feature definitions, exceeding, threshold, quality, signal
  7. [7] § Methods › Signal quality classification ↔ signal_quality_classifier/cleaning/best_segment_extractor.py, lines 8–31 · score 0.54 · signal quality classifier, Neuronal activity, Validation, segments
  8. [8] § Methods › Signal quality classification ↔ signal_quality_classifier/classifier/random_forest_trainer.py, lines 39–56 · score 0.52 · Random Forest classifier, pipeline, quality, signal

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 · 171 lines · 7 KB · no license · 3 matches

  1. import pandas as pd
  2. from signal_quality_classifier.training_data.feature_calculator import calculate_statistics_of_segment
  3. import joblib
  4. model = joblib.load('../classifier/random_forest_pipeline.pkl')
  5. label_encoder = joblib.load('../classifier/label_encoder.pkl')
  6. def classify_signal_segments(df, segment_duration, fs=20000):
  7. """
  8. Analyzes signal quality by segmenting data and classifying each segment.
  9. Args:
  10. df (pandas.DataFrame): Signal data with 'Time' and '2: preprocessed' columns
  11. segment_duration (float): Length of each segment in seconds
  12. fs (int): Sampling frequency in Hz (default: 20000)
  13. Returns:
  14. tuple: (segments_list, optimal_segment)
  15. - segments_list: List of [label, (start_time, end_time)] for each classified segment
  16. - optimal_segment: (start_time, end_time) of the highest quality neuronal activity segment
  17. Raises:
  18. ValueError: If required columns are missing or signal is too short
  19. """
  20. validate_dataframe_columns(df, ['Time', '2: preprocessed'])
  21. samples_per_segment, num_segments = calculate_segments(df, segment_duration, fs)
  22. features_df, time_ranges = extract_features(df, samples_per_segment, num_segments)
  23. y_pred = classify_segments(features_df)
  24. segments_list = group_segments_by_label(y_pred, time_ranges)
  25. longest_segment = find_longest_segment(segments_list, segment_duration)
  26. return segments_list, longest_segment
  27. def validate_dataframe_columns(df, required_columns):
  28. if not all(col in df.columns for col in required_columns):
  29. raise ValueError(f'DataFrame must contain columns: {required_columns}')
  30. def calculate_segments(df, segment_duration, fs=20000):
  31. """
  32. Calculates segmentation parameters based on signal length and desired segment duration.
  33. Args:
  34. df (pandas.DataFrame): Signal data
  35. segment_duration (float): Desired segment length in seconds
  36. fs (int): Sampling frequency in Hz (default: 20000)
  37. Returns:
  38. tuple: (samples_per_segment, num_segments)
  39. Raises:
  40. ValueError: If signal is shorter than one segment
  41. """
  42. samples_per_segment = int(segment_duration * fs)
  43. total_samples = len(df)
  44. num_segments = int(total_samples / samples_per_segment) + (total_samples % samples_per_segment > 0)
  45. if num_segments == 0:
  46. raise ValueError('Signal length is less than the segment length.')
  47. return samples_per_segment, num_segments
  48. def extract_features(df, samples_per_segment, num_segments):
  49. """
  50. Extracts statistical features from each signal segment for classification.
  51. Args:
  52. df (pandas.DataFrame): Signal data
  53. samples_per_segment (int): Number of samples per segment
  54. num_segments (int): Total number of segments
  55. Returns:
  56. tuple: (features_df, time_ranges)
  57. - features_df: DataFrame with computed features for each segment
  58. - time_ranges: List of (start_time, end_time) for each segment
  59. """
  60. features_df = pd.DataFrame()
  61. time_ranges = []
  62. for i in range(num_segments):
  63. start_idx = i * samples_per_segment
  64. end_idx = start_idx + samples_per_segment
  65. segment = df.iloc[start_idx:end_idx]
  66. start_time, end_time = segment['Time'].iloc[0], segment['Time'].iloc[-1]
  67. time_ranges.append((start_time, end_time))
  68. preprocessed_segment = segment['2: preprocessed']
  69. print(f"Calculating statistics {i+1}/{num_segments}")
  70. features_df = calculate_statistics_of_segment(
  71. features_df, file_path="segment_file", label="segment_label", segment=preprocessed_segment
  72. )
  73. features_df = features_df.drop(columns=[col for col in ['file_path', 'label'] if col in features_df.columns])
  74. return features_df, time_ranges
  75. def classify_segments(features_df):
  76. """
  77. Classifies signal segments using the pre-trained Random Forest model.
  78. Args:
  79. features_df (pandas.DataFrame): Features extracted from signal segments
  80. Returns:
  81. numpy.array: Predicted class labels for each segment
  82. """
  83. X = features_df
  84. y_pred_numerical = model.predict(X)
  85. print("Prediction complete")
  86. return label_encoder.inverse_transform(y_pred_numerical)
  87. def group_segments_by_label(y_pred, time_ranges):
  88. """
  89. Groups consecutive segments with the same classification label into continuous time ranges.
  90. Args:
  91. y_pred (numpy.array): Predicted labels for each segment
  92. time_ranges (list): Time ranges for each segment
  93. Returns:
  94. list: List of [label, (start_time, end_time)] for each classified segment group
  95. """
  96. segments_list = []
  97. current_label = y_pred[0]
  98. current_start_time = time_ranges[0][0]
  99. current_end_time = time_ranges[0][1]
  100. for i in range(1, len(y_pred)):
  101. label = y_pred[i]
  102. start_time, end_time = time_ranges[i]
  103. if label == current_label:
  104. current_end_time = end_time
  105. else:
  106. segments_list.append([current_label, (current_start_time, current_end_time)])
  107. current_label, current_start_time, current_end_time = label, start_time, end_time
  108. segments_list.append([current_label, (current_start_time, current_end_time)])
  109. return segments_list
  110. def find_longest_segment(segments_list, segment_duration):
  111. """
  112. Finds the longest high-quality segment suitable for analysis.
  113. Priority rules:
  114. 1. Longest 'Neuronal activity' segment ≥ 2 seconds
  115. 2. If none found, longest non-artifact segment ≥ 2 seconds
  116. 3. If still none, returns None
  117. Args:
  118. segments_list: List of [label, (start_time, end_time)] classified segments
  119. segment_duration: Duration of each segment in seconds
  120. Returns:
  121. tuple or None: (start_time, end_time) of optimal segment or None if no suitable segment
  122. """
  123. longest_brain_signal_segment = None
  124. longest_non_artifact_segment = None
  125. current_start, current_end = 0, 0
  126. for label, (start, end) in segments_list:
  127. duration = end - start
  128. if label == 'Neuronal activity' and duration >= 3 * segment_duration:
  129. if longest_brain_signal_segment is None or duration > (longest_brain_signal_segment[1] - longest_brain_signal_segment[0]):
  130. longest_brain_signal_segment = (start, end)
  131. elif label != 'Artifact':
  132. current_end = end
  133. duration = current_end - current_start
  134. if longest_non_artifact_segment is None or duration > (longest_non_artifact_segment[1] - longest_non_artifact_segment[0]):
  135. longest_non_artifact_segment = (current_start, current_end)
  136. else:
  137. current_start = end
  138. if longest_non_artifact_segment and (longest_non_artifact_segment[1] - longest_non_artifact_segment[0]) < 2:
  139. longest_non_artifact_segment = None
  140. return longest_brain_signal_segment if longest_brain_signal_segment else longest_non_artifact_segment

best_segment_extractor.py at commit e7b2acf, no license · at the source

Overview

Authors: Katarzyna Osowska1, Julian Szymański1, Witold Libionka2
  1. Gdansk University of Technology, Faculty of Electronics, Telecommunications and Informatics,Gdańsk, 80-233 Poland
  2. GUMED, Gdańsk, Poland
Institutions: Gdańsk University of Technology (Poland)
Journal: Scientific data, volume 13, issue 1, article 870
Dates: received 23 May 2025; accepted 20 May 2026; published online 10 June 2026
Type: Data paper · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41597-026-07492-w · PMID 42270599 · PMCID PMC13254314 · OpenAlex W7164230709
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: human (organism), methods / tools (subfield)
Methods: Spectral & time-frequency, Machine learning
Keywords: Engineering, Neuroscience
MeSH: Deep Brain Stimulation*, Humans, Microelectrodes (* major topic)
Journal subjects: Data Descriptor
Topic: Neurological disorders and treatments (Neurology, Medicine), according to OpenAlex
Citations: not cited yet (Europe PMC); 8 references in the paper

Abstract

Precise intraoperative localisation of subcortical brain structures remains a critical challenge in deep brain stimulation, yet openly available microelectrode recording datasets are scarce. We present a dataset of 6,646 processed MER recordings from 132 patients with neurological disorders, including Parkinson’s disease, dystonia, Huntington’s disease, epilepsy and others, acquired during DBS procedures. Signals were band-pass filtered and cleaned using an automated machine learning-based artifact rejection pipeline; annotation quality was confirmed by independent review. In addition an experienced electrophysiologist annotated representative examples of three basal ganglia structures encountered along the electrode trajectories: striatum/putamen, external globus pallidus (GPe), and internal globus pallidus (GPi). The dataset, released together with the full processing pipeline and metadata, is intended to support semi-supervised subcortical structure classification, pathological neuronal activity analysis, and the development of novel DBS targeting methods.

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 8 matches between paragraphs and lines of code.

kasiaOsowska/Deep-Brain-Stimulation-Microelectrode-Recordings

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: e7b2acfc4f1e649dffd2752c9827be54a9aac30d, 10 June 2026
Languages: Python (21)
Size: 296 files, 21 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, environment (requirements.txt)
Not found: license file, CITATION.cff, tests, continuous integration, documentation
Tools: pandas (11 files), NumPy (8 files), scikit-learn (3 files), SciPy (3 files), Matplotlib (2 files), SHAP (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
22 files

Code availability

The source code used for data processing and analysis has been publicly released via MOST Wiedzy8. (within the ZIP archive under the codes directory) and on GitHub: https://github.com/kasiaOsowska/Deep-Brain-Stimulation-Microelectrode-Recordings.git. The project requires Python 3.11 with dependencies specified in requirements.txt. The repository includes scripts to (i) convert raw recordings to the distributed CSV format and apply preprocessing, (ii) compute time- and frequency-domain signal metrics and perform automated quality assessment, (iii) prepare MER segments and associated labels for machine-learning workflows (including brain-layer classification), and (iv) support visual inspection and export of example figures.

Reproduced under the paper's license (CC BY), from the paper cited above.

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;
  • 21 scripts, each with its path and the digest of its content;
  • 8 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 complete dataset, including microelectrode recordings, brain structure annotations, patient metadata, and codes is publicly available via MOST Wiedzy8 at 10.34808/nq8v-t162.

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, 3 authors, 2 keywords, 3 MeSH terms, 7 references.

Cite

This paper

Osowska, K., Szymański, J., & Libionka, W. (2026). A Dataset of Microelectrode Recordings from Deep Brain Stimulation Procedures. Scientific data, 13(1), 870. https://doi.org/10.1038/s41597-026-07492-w

BibTeX

@article{osowska2026dataset,
author = {Osowska, Katarzyna and Szymański, Julian and Libionka, Witold},
title = {{A Dataset of Microelectrode Recordings from Deep Brain Stimulation Procedures}},
journal = {Scientific data},
year = {2026},
month = jun,
volume = {13},
number = {1},
pages = {870},
publisher = {Nature Publishing Group},
issn = {2052-4463},
doi = {10.1038/s41597-026-07492-w},
url = {https://doi.org/10.1038/s41597-026-07492-w},
pmid = {42270599},
pmcid = {PMC13254314}
}

RIS

TY - JOUR
AU - Osowska, Katarzyna
AU - Szymański, Julian
AU - Libionka, Witold
TI - A Dataset of Microelectrode Recordings from Deep Brain Stimulation Procedures
T2 - Scientific data
J2 - Sci Data
PY - 2026
DA - 2026/06/10
VL - 13
IS - 1
SP - 870
SN - 2052-4463
PB - Nature Publishing Group
DO - 10.1038/s41597-026-07492-w
UR - https://doi.org/10.1038/s41597-026-07492-w
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41597-026-07492-w",
"type": "article-journal",
"title": "A Dataset of Microelectrode Recordings from Deep Brain Stimulation Procedures",
"container-title": "Scientific data",
"author": [
{
"family": "Osowska",
"given": "Katarzyna"
},
{
"family": "Szymański",
"given": "Julian"
},
{
"family": "Libionka",
"given": "Witold"
}
],
"container-title-short": "Sci Data",
"volume": "13",
"issue": "1",
"page": "870",
"DOI": "10.1038/s41597-026-07492-w",
"PMID": "42270599",
"PMCID": "PMC13254314",
"ISSN": "2052-4463",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41597-026-07492-w",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
10
]
]
}
}

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.1186/s13059-026-04125-8 [code]
MLMarker: a machine learning framework for tissue inference and biomarker discovery.
Journal: Genome biology
In common: SHAP, scikit-learn, pandas, 3 other tools, methods / tools
[2] doi:10.1038/s41598-026-52330-z [code]
SHAP analysis of an improved EEG-based mental workload classification framework: utilizing data augmentation and explainable AI.
Journal: Scientific reports
In common: SHAP, scikit-learn, pandas, 3 other tools, methods / tools
[3] doi:10.1016/j.nicl.2026.104001 [code]
Effect of vascular lesion preprocessing on Brain Intensity AbNormality Classification Algorithm (BIANCA) white matter hyperintensity segmentation.
Journal: NeuroImage. Clinical
In common: SHAP, scikit-learn, pandas, 3 other tools, methods / tools
[4] doi:10.3389/fsysb.2026.1873899 [code]
A systems microbiology framework for reproducible multi-dataset omics integration with application to long COVID.
Journal: Frontiers in systems biology
In common: SHAP, scikit-learn, pandas, 3 other tools, methods / tools
[5] doi:10.1126/sciadv.aed3650 [code]
Truthful visualizations for mass spectrometry imaging enable high-spatial-resolution interactive &lt;i&gt;m/z&lt;/i&gt; mapping and exploration.
Journal: Science advances
In common: SHAP, scikit-learn, pandas, 3 other tools, methods / tools
[6] doi:10.1039/d6ra03343a [code]
A benchmark dataset and interpretable deep learning framework for drug-induced developmental neurotoxicity prediction.
Journal: RSC advances
In common: SHAP, scikit-learn, pandas, 3 other tools, methods / tools
[7] doi:10.1038/s42003-026-10957-8 [code]
Brain defence by the extracellular matrix protein Cochlin.
Journal: Communications biology
In common: SHAP, scikit-learn, pandas, 3 other tools
[8] doi:10.1002/advs.202600020 [code]
Early Retinal UCHL1 Dysregulation Coupled With Synaptic Loss Reflects Alzheimer's Disease Severity.
Journal: Advanced science (Weinheim, Baden-Wurttemberg, Germany)
In common: SHAP, scikit-learn, pandas, 3 other tools
[9] doi:10.1212/wnl.0000000000218472 [code]
Lesion-Level Subtypes of White Matter Hyperintensity Evolution Beyond Spatial Location.
Journal: Neurology
In common: SHAP, scikit-learn, pandas, 3 other tools
[10] doi:10.3390/s26175327 [code]
Subject Identity Confounds qEEG Emotion Recognition on DEAP and DREAMER.
Journal: Sensors (Basel, Switzerland)
In common: SHAP, scikit-learn, pandas, 3 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.

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.