Saccade length consistency during reading and shape-scanning.
The 1 match
- [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
- # %%
- import os
- import math
- import pyreadr
- import pyreadstat
- import scipy
- import scipy.ndimage
- import numpy as np
- import pandas as pd
- import matplotlib.pyplot as plt
- import scikit_posthocs as sp
- from itertools import combinations
- from scipy import stats
- from scipy.io import loadmat
- from matplotlib import rcParams
- from statsmodels.stats.anova import AnovaRM
- rcParams['font.family'] = 'sans-serif'
- rcParams['font.sans-serif'] = ['Arial']
- rcParams['font.size'] = 24
- # %%
- dataset_dict = {}
- num_participants = 27
- dataset_types = ['reading_saccades', 'reading_regressions', 'foraging_saccades', 'foraging_regressions']
- columns = ['RECORDING_SESSION_LABEL', 'TRIAL_INDEX', 'CURRENT_FIX_X', 'CURRENT_FIX_Y', ',']
- # Create the dictionary
- for dataset_type in dataset_types:
- for i in range(1, num_participants + 1):
- participant_id = f'P{i:02d}'
- filename = f'./data/participants/{participant_id}_{dataset_type}.csv'
- dataset_dict[filename] = columns
- # %%
- def calculate_multiples(df, participant_col, trial_col, x_col, y_col):
- # Replace ',' with '.' in the specified columns
- df[x_col] = df[x_col].str.replace(',', '.')
- df[y_col] = df[y_col].str.replace(',', '.')
- # Replace non-numeric values with NaN in the 'CURRENT_FIX_X' and 'CURRENT_FIX_Y' columns
- df[x_col] = pd.to_numeric(df[x_col], errors='coerce')
- df[y_col] = pd.to_numeric(df[y_col], errors='coerce')
- # Drop rows with NaN values in the columns containing the x and y coordinates
- df.dropna(subset=[x_col, y_col], inplace=True)
- # Group the DataFrame by participant_col and trial_col
- grouped = df.groupby([participant_col, trial_col])
- # Create an empty dictionary to store the positions for each trial
- all_multiples = []
- # Iterate through the groups and extract positions
- for (participant, trial), group in grouped:
- positions = np.array(list(zip(group[x_col], group[y_col])))
- # Calculate distances between adjacent fixations using vectorized operations
- distances = np.linalg.norm(positions[1:] - positions[:-1], axis=1)
- # Filter out zero distances
- pre_filtered_distances = distances[distances != 0]
- filtered_distances = pre_filtered_distances[pre_filtered_distances < 250]
- # Calculate the multiples using vectorized operations
- multiples = filtered_distances[1:] / filtered_distances[:-1]
- # Save all multiples in one list
- all_multiples.extend(multiples)
- return all_multiples
- def get_multiples_from_dataset(dataset_name, dataset_dict):
- parameters = dataset_dict[dataset_name]
- df = pd.read_csv(dataset_name, delimiter=parameters[4])
- multiples_dataset = calculate_multiples(df, parameters[0], parameters[1], parameters[2], parameters[3])
- return multiples_dataset
- def get_peak(data, type):
- positions = []
- all_counts=[]
- all_percentages=[]
- for sublist in data:
- counts, bin_edges, shapes = plt.hist(sublist, bins=100, range=(0, 5), log=True)
- plt.close()
- percentages = np.array([(val/np.sum(counts)) for val in counts])
- smoothed_hist = scipy.ndimage.gaussian_filter1d(counts, sigma=2)
- local_maxima = (np.diff(np.sign(np.diff(smoothed_hist))) < 0).nonzero()[0] + 1
- peak_index = local_maxima[np.argmax(smoothed_hist[local_maxima])]
- bin_center = (bin_edges[peak_index] + bin_edges[peak_index + 1]) / 2
- positions.append(bin_center)
- all_counts.append(counts)
- all_percentages.append(percentages)
- mean_counts = [sum(group) / len(group) for group in zip(*all_counts)]
- mean_percentages = [sum(group) / len(group) for group in zip(*all_percentages)]
- std_devs = np.sqrt(mean_counts) / np.sum(mean_counts)
- smoothed_hist = scipy.ndimage.gaussian_filter1d(mean_percentages, sigma=2)
- local_maxima = (np.diff(np.sign(np.diff(smoothed_hist))) < 0).nonzero()[0] + 1
- peak_index = local_maxima[np.argmax(smoothed_hist[local_maxima])]
- plt.figure(figsize=(12, 6))
- bin_centers = 0.5 * (bin_edges[1:] + bin_edges[:-1])
- plt.errorbar(bin_centers, mean_percentages, yerr=std_devs, fmt='o',
- label='Original Histogram with Error Bars', markersize=4,
- capsize=3, color='black')
- plt.axvline(np.mean(positions), color='red', linestyle='--', label='Peak')
- plt.yscale('log')
- plt.xlabel(f'Relative {type.split("_")[1][:-1]} length')
- plt.ylabel('Probability of occurence (log)')
- plt.xlim([0, 5])
- plt.ylim([0.0001, 0.1])
- plt.grid()
- plt.savefig(f'./plots/{type}.jpg', bbox_inches='tight', dpi=400)
- plt.show()
- bin_center = (bin_edges[peak_index] + bin_edges[peak_index + 1]) / 2
- print(np.mean(positions))
- return positions
- # %%
- all_multiples = []
- dataset_names = []
- for key, values in dataset_dict.items():
- dataset_multiples = get_multiples_from_dataset(key, dataset_dict)
- dataset_names.append(key.split('/')[-1].split('.')[0])
- all_multiples.append(dataset_multiples)
- whole_data = [all_multiples[:27], all_multiples[27:54], all_multiples[54:81], all_multiples[81:]]
- peak_positions = []
- for (i, type) in enumerate(dataset_types):
- positions = get_peak(whole_data[i], type)
- peak_positions.append(positions)
- # %%
- movement_groups = ['Reading_Saccades', 'Reading_Regressions', 'Foraging_Saccades', 'Foraging_Regressions']
- for (i, movement) in enumerate(movement_groups):
- all_relative_lengths = [item for sublist in whole_data[i] for item in sublist]
- average_relative_length = math.pow(math.prod(all_relative_lengths), 1/len(all_relative_lengths))
- print(movement)
- print('Average relative length:', average_relative_length)
- print('Mean peak position:\t', np.mean(peak_positions[i]))
- print('Standard deviation of peak position:', np.std(peak_positions[i]), '\n')
- # %%
- data = {
- 'subject': np.arange(len(peak_positions[0])),
- 'reading_saccades': peak_positions[0],
- 'reading_regressions': peak_positions[1],
- 'foraging_saccades': peak_positions[2],
- 'foraging_regressions': peak_positions[3]
- }
- df = pd.DataFrame(data)
- df_melted = pd.melt(df, id_vars=['subject'], var_name='condition', value_name='score')
- print("Normality Test Results (Shapiro-Wilk):")
- normality_results = df_melted.groupby('condition')['score'].apply(lambda x: stats.shapiro(x))
- for cond, result in normality_results.items():
- print(f" {cond}: W = {result.statistic:.4f}, p = {result.pvalue:.4f}")
- levene_stat, levene_p = stats.levene(
- df['reading_saccades'],
- df['reading_regressions'],
- df['foraging_saccades'],
- df['foraging_regressions']
- )
- print(f"\nLevene's Test for Homogeneity of Variances: W = {levene_stat:.4f}, p = {levene_p:.4f}")
- auto_nonparam = any(res.pvalue <= 0.05 for res in normality_results)
- if auto_nonparam:
- friedman_stat, friedman_p = stats.friedmanchisquare(
- df['reading_saccades'],
- df['reading_regressions'],
- df['foraging_saccades'],
- df['foraging_regressions']
- )
- print(f"\nFriedman Test: chi-square = {friedman_stat:.4f}, p = {friedman_p:.4f}")
- k = 4
- n = df.shape[0]
- kendall_w = friedman_stat / (n * k * (k - 1))
- print(f"Kendall's W = {kendall_w:.4f}")
- if friedman_p < 0.05:
- print("\nPairwise Comparisons (Wilcoxon signed-rank) with Cohen's dz:")
- conditions = ['reading_saccades', 'reading_regressions', 'foraging_saccades', 'foraging_regressions']
- for a, b in combinations(conditions, 2):
- x = df[a]
- y = df[b]
- stat, p = stats.wilcoxon(x, y)
- diff = x - y
- cohen_d = diff.mean() / diff.std(ddof=1)
- print(f" {a} vs {b}: W = {stat:.4f}, p = {p:.4f}, Cohen's d = {cohen_d:.4f}")
- else:
- print("\nRepeated Measures ANOVA:")
- aovrm = AnovaRM(df_melted, 'score', 'subject', within=['condition'])
- res = aovrm.fit()
- print(res)
- anova_table = res.anova_table
- ss_effect = anova_table['Mean SS']['condition'] * anova_table['Num DF']['condition']
- ss_error = anova_table['Mean SS']['Residual'] * anova_table['Den DF']['condition']
- partial_eta_sq = ss_effect / (ss_effect + ss_error)
- print(f"\nPartial eta squared = {partial_eta_sq:.4f}")
relative_lengths.ipynb, no license · at the source
Overview
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
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
3 files
- relative_lengths.ipynb, Jupyter, 225 lines, 1 match
- standard_measures.ipynb, Jupyter, 220 lines
- README.md, Text, 31 lines
Code availability
The custom code used for conducting the analyses reported in the current study is available on the Open Science Framework: 10.17605/
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/
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://
BibTeX
@article{fabian2026sacca
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/
url = {https://
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/
VL - 88
IS - 5
SP - 138
SN - 1943-3921
PB - Springer Science+Business Media
DO - 10.3758/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.3758/
"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":
"volume": "88",
"issue": "5",
"page": "138",
"DOI": "10.3758/
"PMID": "42230464",
"PMCID": "PMC13230309",
"ISSN": "1943-3921",
"publisher": "Springer Science+Business Media",
"URL": "https://
"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 oneIn 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 communicationsIn 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 neuroscienceIn 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/aIn 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 consciousnessIn 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: NeurophotonicsIn 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: EBioMedicineIn 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 biologyIn 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: iScienceIn 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 advancesIn 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.
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, 2 scripts, and 1 match 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:8632e4208d3cf970…
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.
