Saccade length consistency during reading and shape-scanning.
The 1 match
- [1] § Results › Relative eye-movement lengths ↔ relative_lengths.ipynb, lines 162 to 224 · score 0.54 · Shapiro Wilk, peak positions, nonparametric, Friedman, Kendall, Levene · Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: 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.7554/elife.91327 [code]
- Early parafoveal semantic integration in natural reading.Journal: eLifeIn common: Matplotlib, cognitive, 7 references
- [2] doi:10.7554/elife.87197 [code]
- Human attention during goal-directed reading comprehension relies on task optimization.Journal: eLifeIn common: statsmodels, pandas, SciPy, 2 other tools, behavior only, cognitive, 4 references
- [3] doi:10.1162/opmi_a_00126 [code]
- A Deep Learning Approach to Analyzing Continuous-Time Cognitive Processes.Journal: Open mind : discoveries in cognitive scienceIn common: statsmodels, pandas, SciPy, 2 other tools, cognitive, 3 references
- [4] doi:10.1111/psyp.70205
- How the Dominant Reading Direction Changes Parafoveal Processing: A Combined EEG/
Eye-Tracking Study. Journal: PsychophysiologyIn common: cognitive, 5 references - [5] doi:10.1038/s41467-025-63916-y [code]
- Fast hierarchical processing of orthographic and semantic parafoveal information during natural reading.Journal: Nature communicationsIn common: pandas, SciPy, NumPy, cognitive, 3 references
- [6] doi:10.3390/brainsci14090901 [code]
- Tai Chi Practice Buffers Aging Effects in Functional Brain Connectivity.Journal: Brain sciencesIn common: scikit-posthocs, statsmodels, pandas, 3 other tools, 1 reference
- [7] doi:10.1073/pnas.2410955121 [code]
- A distributed subcortical circuit linked to instrumental information-seeking about threat.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: scikit-posthocs, statsmodels, pandas, 3 other tools, 1 reference
- [8] doi:10.1186/s13229-022-00517-2 [code]
- Atypical gaze patterns in autistic adults are heterogeneous across but reliable within individuals.Journal: Molecular autismIn common: statsmodels, pandas, SciPy, 2 other tools, behavior only, 2 references
- [9] doi:10.1167/jov.22.7.3 [code]
- Could simplified stimuli change how the brain performs visual search tasks? A deep neural network study.Journal: Journal of visionIn common: scikit-posthocs, statsmodels, pandas, 3 other tools, behavior only, cognitive
- [10] doi:10.1002/ana.27185 [code]
- Spiking Patterns in the Globus Pallidus Highlight Convergent Neural Dynamics across Diverse Genetic Dystonia Syndromes.Journal: Annals of neurologyIn common: scikit-posthocs, statsmodels, pandas, 3 other tools, 1 reference
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:62edbd1e69370ae9…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.3758/s13414-026-03289-6)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.3758/s13414-026-03289-6.svg
:target: https://openscicode.org/badge/doi/10.3758/s13414-026-03289-6
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.3758/s13414-026-03289-6"><img src="https://openscicode.org/badge/doi/10.3758/s13414-026-03289-6.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
