OSCR

Saccade length consistency during reading and shape-scanning.

Code ↔ Paper

1 match 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 1 match
  1. [1] § Results › Relative eye-movement lengths ↔ relative_lengths.ipynb, lines 162–224 · score 0.54 · Shapiro Wilk, peak positions, nonparametric, Friedman, Kendall, Levene

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

Jupyter notebook · 225 lines · 8.1 KB · no license · 1 match

  1. # %%
  2. import os
  3. import math
  4. import pyreadr
  5. import pyreadstat
  6. import scipy
  7. import scipy.ndimage
  8. import numpy as np
  9. import pandas as pd
  10. import matplotlib.pyplot as plt
  11. import scikit_posthocs as sp
  12. from itertools import combinations
  13. from scipy import stats
  14. from scipy.io import loadmat
  15. from matplotlib import rcParams
  16. from statsmodels.stats.anova import AnovaRM
  17. rcParams['font.family'] = 'sans-serif'
  18. rcParams['font.sans-serif'] = ['Arial']
  19. rcParams['font.size'] = 24
  20. # %%
  21. dataset_dict = {}
  22. num_participants = 27
  23. dataset_types = ['reading_saccades', 'reading_regressions', 'foraging_saccades', 'foraging_regressions']
  24. columns = ['RECORDING_SESSION_LABEL', 'TRIAL_INDEX', 'CURRENT_FIX_X', 'CURRENT_FIX_Y', ',']
  25. # Create the dictionary
  26. for dataset_type in dataset_types:
  27. for i in range(1, num_participants + 1):
  28. participant_id = f'P{i:02d}'
  29. filename = f'./data/participants/{participant_id}_{dataset_type}.csv'
  30. dataset_dict[filename] = columns
  31. # %%
  32. def calculate_multiples(df, participant_col, trial_col, x_col, y_col):
  33. # Replace ',' with '.' in the specified columns
  34. df[x_col] = df[x_col].str.replace(',', '.')
  35. df[y_col] = df[y_col].str.replace(',', '.')
  36. # Replace non-numeric values with NaN in the 'CURRENT_FIX_X' and 'CURRENT_FIX_Y' columns
  37. df[x_col] = pd.to_numeric(df[x_col], errors='coerce')
  38. df[y_col] = pd.to_numeric(df[y_col], errors='coerce')
  39. # Drop rows with NaN values in the columns containing the x and y coordinates
  40. df.dropna(subset=[x_col, y_col], inplace=True)
  41. # Group the DataFrame by participant_col and trial_col
  42. grouped = df.groupby([participant_col, trial_col])
  43. # Create an empty dictionary to store the positions for each trial
  44. all_multiples = []
  45. # Iterate through the groups and extract positions
  46. for (participant, trial), group in grouped:
  47. positions = np.array(list(zip(group[x_col], group[y_col])))
  48. # Calculate distances between adjacent fixations using vectorized operations
  49. distances = np.linalg.norm(positions[1:] - positions[:-1], axis=1)
  50. # Filter out zero distances
  51. pre_filtered_distances = distances[distances != 0]
  52. filtered_distances = pre_filtered_distances[pre_filtered_distances < 250]
  53. # Calculate the multiples using vectorized operations
  54. multiples = filtered_distances[1:] / filtered_distances[:-1]
  55. # Save all multiples in one list
  56. all_multiples.extend(multiples)
  57. return all_multiples
  58. def get_multiples_from_dataset(dataset_name, dataset_dict):
  59. parameters = dataset_dict[dataset_name]
  60. df = pd.read_csv(dataset_name, delimiter=parameters[4])
  61. multiples_dataset = calculate_multiples(df, parameters[0], parameters[1], parameters[2], parameters[3])
  62. return multiples_dataset
  63. def get_peak(data, type):
  64. positions = []
  65. all_counts=[]
  66. all_percentages=[]
  67. for sublist in data:
  68. counts, bin_edges, shapes = plt.hist(sublist, bins=100, range=(0, 5), log=True)
  69. plt.close()
  70. percentages = np.array([(val/np.sum(counts)) for val in counts])
  71. smoothed_hist = scipy.ndimage.gaussian_filter1d(counts, sigma=2)
  72. local_maxima = (np.diff(np.sign(np.diff(smoothed_hist))) < 0).nonzero()[0] + 1
  73. peak_index = local_maxima[np.argmax(smoothed_hist[local_maxima])]
  74. bin_center = (bin_edges[peak_index] + bin_edges[peak_index + 1]) / 2
  75. positions.append(bin_center)
  76. all_counts.append(counts)
  77. all_percentages.append(percentages)
  78. mean_counts = [sum(group) / len(group) for group in zip(*all_counts)]
  79. mean_percentages = [sum(group) / len(group) for group in zip(*all_percentages)]
  80. std_devs = np.sqrt(mean_counts) / np.sum(mean_counts)
  81. smoothed_hist = scipy.ndimage.gaussian_filter1d(mean_percentages, sigma=2)
  82. local_maxima = (np.diff(np.sign(np.diff(smoothed_hist))) < 0).nonzero()[0] + 1
  83. peak_index = local_maxima[np.argmax(smoothed_hist[local_maxima])]
  84. plt.figure(figsize=(12, 6))
  85. bin_centers = 0.5 * (bin_edges[1:] + bin_edges[:-1])
  86. plt.errorbar(bin_centers, mean_percentages, yerr=std_devs, fmt='o',
  87. label='Original Histogram with Error Bars', markersize=4,
  88. capsize=3, color='black')
  89. plt.axvline(np.mean(positions), color='red', linestyle='--', label='Peak')
  90. plt.yscale('log')
  91. plt.xlabel(f'Relative {type.split("_")[1][:-1]} length')
  92. plt.ylabel('Probability of occurence (log)')
  93. plt.xlim([0, 5])
  94. plt.ylim([0.0001, 0.1])
  95. plt.grid()
  96. plt.savefig(f'./plots/{type}.jpg', bbox_inches='tight', dpi=400)
  97. plt.show()
  98. bin_center = (bin_edges[peak_index] + bin_edges[peak_index + 1]) / 2
  99. print(np.mean(positions))
  100. return positions
  101. # %%
  102. all_multiples = []
  103. dataset_names = []
  104. for key, values in dataset_dict.items():
  105. dataset_multiples = get_multiples_from_dataset(key, dataset_dict)
  106. dataset_names.append(key.split('/')[-1].split('.')[0])
  107. all_multiples.append(dataset_multiples)
  108. whole_data = [all_multiples[:27], all_multiples[27:54], all_multiples[54:81], all_multiples[81:]]
  109. peak_positions = []
  110. for (i, type) in enumerate(dataset_types):
  111. positions = get_peak(whole_data[i], type)
  112. peak_positions.append(positions)
  113. # %%
  114. movement_groups = ['Reading_Saccades', 'Reading_Regressions', 'Foraging_Saccades', 'Foraging_Regressions']
  115. for (i, movement) in enumerate(movement_groups):
  116. all_relative_lengths = [item for sublist in whole_data[i] for item in sublist]
  117. average_relative_length = math.pow(math.prod(all_relative_lengths), 1/len(all_relative_lengths))
  118. print(movement)
  119. print('Average relative length:', average_relative_length)
  120. print('Mean peak position:\t', np.mean(peak_positions[i]))
  121. print('Standard deviation of peak position:', np.std(peak_positions[i]), '\n')
  122. # %%
  123. data = {
  124. 'subject': np.arange(len(peak_positions[0])),
  125. 'reading_saccades': peak_positions[0],
  126. 'reading_regressions': peak_positions[1],
  127. 'foraging_saccades': peak_positions[2],
  128. 'foraging_regressions': peak_positions[3]
  129. }
  130. df = pd.DataFrame(data)
  131. df_melted = pd.melt(df, id_vars=['subject'], var_name='condition', value_name='score')
  132. print("Normality Test Results (Shapiro-Wilk):")
  133. normality_results = df_melted.groupby('condition')['score'].apply(lambda x: stats.shapiro(x))
  134. for cond, result in normality_results.items():
  135. print(f" {cond}: W = {result.statistic:.4f}, p = {result.pvalue:.4f}")
  136. levene_stat, levene_p = stats.levene(
  137. df['reading_saccades'],
  138. df['reading_regressions'],
  139. df['foraging_saccades'],
  140. df['foraging_regressions']
  141. )
  142. print(f"\nLevene's Test for Homogeneity of Variances: W = {levene_stat:.4f}, p = {levene_p:.4f}")
  143. auto_nonparam = any(res.pvalue <= 0.05 for res in normality_results)
  144. if auto_nonparam:
  145. friedman_stat, friedman_p = stats.friedmanchisquare(
  146. df['reading_saccades'],
  147. df['reading_regressions'],
  148. df['foraging_saccades'],
  149. df['foraging_regressions']
  150. )
  151. print(f"\nFriedman Test: chi-square = {friedman_stat:.4f}, p = {friedman_p:.4f}")
  152. k = 4
  153. n = df.shape[0]
  154. kendall_w = friedman_stat / (n * k * (k - 1))
  155. print(f"Kendall's W = {kendall_w:.4f}")
  156. if friedman_p < 0.05:
  157. print("\nPairwise Comparisons (Wilcoxon signed-rank) with Cohen's dz:")
  158. conditions = ['reading_saccades', 'reading_regressions', 'foraging_saccades', 'foraging_regressions']
  159. for a, b in combinations(conditions, 2):
  160. x = df[a]
  161. y = df[b]
  162. stat, p = stats.wilcoxon(x, y)
  163. diff = x - y
  164. cohen_d = diff.mean() / diff.std(ddof=1)
  165. print(f" {a} vs {b}: W = {stat:.4f}, p = {p:.4f}, Cohen's d = {cohen_d:.4f}")
  166. else:
  167. print("\nRepeated Measures ANOVA:")
  168. aovrm = AnovaRM(df_melted, 'score', 'subject', within=['condition'])
  169. res = aovrm.fit()
  170. print(res)
  171. anova_table = res.anova_table
  172. ss_effect = anova_table['Mean SS']['condition'] * anova_table['Num DF']['condition']
  173. ss_error = anova_table['Mean SS']['Residual'] * anova_table['Den DF']['condition']
  174. partial_eta_sq = ss_effect / (ss_effect + ss_error)
  175. print(f"\nPartial eta squared = {partial_eta_sq:.4f}")

relative_lengths.ipynb, no license · at the source

Overview

Authors: Thomas Fabian1
ORCID iDs: Thomas Fabian
  1. Department of History and Social Sciences, Technical University of Darmstadt,Residenzschloss 1, 64283 Darmstadt, Germany
Institutions: Technische Universität Darmstadt (Germany)
Journal: Attention, perception & psychophysics, volume 88, issue 5, article 138
Dates: received 12 December 2025; accepted 5 May 2026; published online 3 June 2026; in print 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.3758/s13414-026-03289-6 · PMID 42230464 · PMCID PMC13230309 · OpenAlex W7163156958
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: behavior only (modality), human (organism), cognitive (subfield)
Methods: Statistics, Physiology & signal measures
Keywords: Eye movements and visual attention, Reading, Visual search
MeSH: Attention*, Form Perception*, Pattern Recognition, Visual*, Reading*, Saccades*, Adult, Female, Fixation, Ocular, Humans, Male, Young Adult (* major topic)
Topic: Neurobiology of Language and Bilingualism (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Technische Universität Darmstadt (3139)
Citations: not cited yet (Europe PMC); 85 references in the paper

Abstract

Human gaze behaviour provides insights into the mental processes underlying the execution of a task. As reading involves visual sampling and language processing, various studies investigate how the linguistic information of texts influences visual behaviour. However, established measures of human visual behaviour are dependent on the exact configuration of the text stimuli and the nonlinguistic stimuli used for comparison, leaving systematic stimulus-independent differences largely unknown. Here, we show that relative saccade length distributions reveal similarities and differences in gaze dynamics during reading and shape-scanning. In a within-subject design, participants read texts and scanned a spatially matched array of geometric shapes. We find that the lengths of consecutive saccades in target direction are more consistent during reading than during shape-scanning, suggesting that saccadic planning is more constrained during reading. The consistency of eye movements opposite to the target direction does not differ for the experimental conditions. These results consolidate findings from neurocognitive studies on the vision–language interface and suggest how underlying neural structures manifest themselves in observable visual behaviour. Furthermore, the results indicate that relative saccade lengths could present a new measure for investigating how linguistic processing influences human visual behaviour during reading. More broadly, the results suggest that analysing gaze behaviour dynamics via relative saccade lengths might provide novel insights into similarities and differences across tasks.

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 1 match between paragraphs and lines of code.

OSF hnu32

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: Jupyter (2)
Size: 327 files, 2 scripts
Software Heritage: not checked
Found in: “Code availability”
Holds: README, environment (requirements.txt), 2 notebooks
Not found: license file, CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (2 files), pandas (2 files), SciPy (2 files), statsmodels (2 files), Matplotlib (1 file), scikit-posthocs (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
3 files
At the source:

Code availability

The custom code used for conducting the analyses reported in the current study is available on the Open Science Framework: 10.17605/OSF.IO/HNU32

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;
  • 2 scripts, each with its path and the digest of its content;
  • 1 match 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.

Availability of data and materials

The materials used in the experiment and the datasets generated by the experiment and analysed during the current study are available on the Open Science Framework: 10.17605/OSF.IO/HNU32

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 2, 28 September 2026

  • Publisher: n/a → Springer Science+Business Media

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 1 author, 3 keywords, 11 MeSH terms, 1 funder, 75 references.

Cite

This paper

Fabian, T. (2026). Saccade length consistency during reading and shape-scanning. Attention, perception & psychophysics, 88(5), 138. https://doi.org/10.3758/s13414-026-03289-6

BibTeX

@article{fabian2026saccade,
author = {Fabian, Thomas},
title = {{Saccade length consistency during reading and shape-scanning}},
journal = {Attention, perception \& psychophysics},
year = {2026},
month = jun,
volume = {88},
number = {5},
pages = {138},
publisher = {Springer Science+Business Media},
issn = {1943-3921},
doi = {10.3758/s13414-026-03289-6},
url = {https://doi.org/10.3758/s13414-026-03289-6},
pmid = {42230464},
pmcid = {PMC13230309}
}

RIS

TY - JOUR
AU - Fabian, Thomas
TI - Saccade length consistency during reading and shape-scanning
T2 - Attention, perception & psychophysics
J2 - Atten Percept Psychophys
PY - 2026
DA - 2026/06/03
VL - 88
IS - 5
SP - 138
SN - 1943-3921
PB - Springer Science+Business Media
DO - 10.3758/s13414-026-03289-6
UR - https://doi.org/10.3758/s13414-026-03289-6
LA - en
ER -

CSL-JSON

{
"id": "10.3758/s13414-026-03289-6",
"type": "article-journal",
"title": "Saccade length consistency during reading and shape-scanning",
"container-title": "Attention, perception & psychophysics",
"author": [
{
"family": "Fabian",
"given": "Thomas"
}
],
"container-title-short": "Atten Percept Psychophys",
"volume": "88",
"issue": "5",
"page": "138",
"DOI": "10.3758/s13414-026-03289-6",
"PMID": "42230464",
"PMCID": "PMC13230309",
"ISSN": "1943-3921",
"publisher": "Springer Science+Business Media",
"URL": "https://doi.org/10.3758/s13414-026-03289-6",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
3
]
]
}
}

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.1371/journal.pone.0345651 [code]
Non-concussive head impacts sustained during American football correlate with changes in gut microbiome diversity and composition.
Journal: PloS one
In common: scikit-posthocs, statsmodels, pandas, 3 other tools, 1 reference
[2] doi:10.1038/s41467-026-75662-w [code]
Distinct Roles of Deep and Superficial Cortical Layers in Tone Prediction, Comparison, and Adaptation in Human Auditory Cortices.
Journal: Nature communications
In common: scikit-posthocs, statsmodels, pandas, 3 other tools, cognitive
[3] doi:10.1038/s41593-026-02362-5 [code]
Replay of procedural memory is independent of the hippocampus.
Journal: Nature neuroscience
In common: scikit-posthocs, statsmodels, pandas, 3 other tools, cognitive
[4] doi:10.7554/elife.100605 [code]
Age-related changes in ‘cortical’ 1/f dynamics are linked to cardiac activity
Journal: n/a
In common: statsmodels, pandas, SciPy, 2 other tools, 2 references
[5] doi:10.1093/nc/niag043 [code]
Demographics-robust spontaneous eye blinking slowing in patients with severe acquired brain injury.
Journal: Neuroscience of consciousness
In common: scikit-posthocs, statsmodels, pandas, 3 other tools
[6] doi:10.1117/1.nph.13.3.035006 [code]
Characterizing developmental changes in infant habituation using functional change point detection.
Journal: Neurophotonics
In common: scikit-posthocs, statsmodels, pandas, 3 other tools
[7] doi:10.1016/j.ebiom.2026.106293 [code]
Dynamic neural states underpin motor symptom severity in Parkinson's disease: a longitudinal analysis of chronic cortico-subthalamic nucleus recordings.
Journal: EBioMedicine
In common: scikit-posthocs, statsmodels, pandas, 3 other tools
[8] doi:10.1371/journal.pbio.3003959 [code]
Recurrent synapses between CO2-sensitive olfactory sensory neurons enable robust CO2 detection in Aedes aegypti mosquitoes.
Journal: PLoS biology
In common: scikit-posthocs, statsmodels, pandas, 3 other tools
[9] doi:10.1016/j.isci.2026.117375 [code]
Motor priming is associated with widespread recruitment into neural ensembles and more rapid ensemble transitions.
Journal: iScience
In common: scikit-posthocs, statsmodels, pandas, 3 other tools
[10] doi:10.1126/sciadv.adz6517 [code]
Corticosterone-linked microglial activity underpins sexually dimorphic neuroplasticity after ketamine anesthesia.
Journal: Science advances
In common: scikit-posthocs, statsmodels, 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.