Skip to content
bachlabPublic

About

Continuous eyetracking (including pupil size) data from N = 361 participants undergoing fear conditioning with different ISIs and different settings, combining data from 12 experiments.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PupilFear

PupilFear logo

Continuous eyetracking data from N = 361 participants undergoing fear conditioning with different ISIs and different settings, combining data from 12 experiments.

Description

PupilFear converts public fear-conditioning eyetracking datasets (including pupillometry) from the PsPM open data collection to the M-BIDS format consistent with BIDS, and can combine them into a single corpus. The source datasets are downloaded from Zenodo. Dataset-specific differences are defined in configuration. PupilFear also includes tools to check and correct gaze data.

Source datasets

Dataset Zenodo record License
DoxMem2 10.5281/zenodo.3460921 CC-BY-4.0
FER01 10.5281/zenodo.5650832 CC-BY-4.0
FER02 10.5281/zenodo.5573760 CC-BY-4.0
FSS6B 10.5281/zenodo.7334479 CC-BY-4.0
LI 10.5281/zenodo.7477719 CC-BY-4.0
LSOA 10.5281/zenodo.3835557 CC-BY-4.0
PIT1 10.5281/zenodo.2641734 CC-BY-4.0
PIT2 10.5281/zenodo.2641738 CC-BY-4.0
PubFe 10.5281/zenodo.5573788 CC-BY-4.0
SC4B 10.5281/zenodo.5573810 CC-BY-SA-4.0
VC7B 10.5281/zenodo.5573833 CC-BY-4.0
ViS 10.5281/zenodo.4290767 CC-BY-4.0

Descriptors for FSS7B and VC1F are also included, but these datasets cannot currently be downloaded or converted with PupilFear.

System requirements

  1. Python 3.10 or newer
  2. PowerShell, if you want to use the optional batch scripts for gaze quality control and correction
  3. Enough disk space for the downloaded, converted and combined datasets

Installation

Clone the repository and install the package:

git clone https://github.com/bachlab/PupilFear.git
cd PupilFear
python -m pip install .

Usage

Run the commands below from the repository root. By default the data are stored in Datasets, Converted_Datasets and Corpus in the current directory. Every location can be changed with command-line options.

1. Download the datasets

pupilfear list
pupilfear download FER01
# or download every configured dataset
pupilfear download all

--raw-dir sets the directory in which the dataset folders are stored (default: Datasets).

2. Convert to BIDS

pupilfear convert DoxMem2 FER01 FER02 FSS6B LI LSOA PIT1 PIT2 PubFe SC4B VC7B ViS --verbose

This writes one BIDS dataset per source dataset to Converted_Datasets. To convert one dataset, give its name. Use --overwrite to replace an existing conversion:

pupilfear convert DoxMem2 --verbose --overwrite

3. Check and correct gaze data (optional)

Calibration problems can make gaze data look shifted. This can affect later preprocessing, for example with pspm_find_valid_fixations. The scripts in scripts create a quality-control plot for every recording and can correct the most obvious shifts.

Create the plots and a qc_summary.tsv for each dataset:

$rootIn  = "Converted_Datasets"
$rootOut = "GazeQC"

Get-ChildItem -Path $rootIn -Directory | ForEach-Object {
    $outputPath = Join-Path $rootOut $_.Name
    if (Test-Path (Join-Path $outputPath "qc_summary.tsv")) {
        Write-Host "Skipping $($_.Name) (qc_summary.tsv exists)"
        return
    }
    .\scripts\pf_gazeqc.ps1 -InputFolder $_.FullName -OutputFolder $outputPath
}

Inspect the *.png images. Add an apply_fix column to qc_summary.tsv and set it to True for the recordings you want to correct. For example, with pandas:

import pandas as pd

dataset = "VC7B"
file = f"GazeQC/{dataset}/qc_summary.tsv"
df = pd.read_csv(file, sep="\t")
df["apply_fix"] = df["subject"].isin(["sub-09", "sub-10"])
df.to_csv(file, sep="\t", index=False)

Then correct the selected recordings:

.\scripts\pf_fix_gaze.ps1 -InputFolder "GazeQC\VC7B\qc_summary.tsv"

Files are corrected in place. The JSON sidecar of each corrected file records the transformation, the script parameters and the shift values.

Without PowerShell, pupilfear gaze-qc and pupilfear fix-gaze process one recording at a time.

4. Create the Corpus

Optionally, first check the converted datasets with the BIDS validator. Then combine them:

pupilfear combine --verbose

This creates the Corpus folder. Use --force only when an existing non-empty Corpus should be replaced. Every folder in Converted_Datasets must be one of the datasets listed above.

Command help

pupilfear download --help
pupilfear convert --help
pupilfear combine --help
pupilfear gaze-qc --help
pupilfear fix-gaze --help

Source data and citation

PupilFear does not include any physiological data. Each dataset is downloaded from its Zenodo record, and the record's license and citation apply to the data. Every converted dataset lists its authors and Zenodo source in dataset_description.json. Please cite the original datasets when you use the converted data, and cite Heij et al. (2026). preprint for the collection.

Converted datasets keep the license of their source dataset. A Corpus that includes SC4B is licensed CC-BY-SA-4.0, because the ShareAlike terms of SC4B apply to the combined data. A Corpus without SC4B is licensed CC-BY-4.0. The dataset_description.json and README of the Corpus record this automatically.

Development

python -m pip install -e ".[dev]"
python -m pytest

License

PupilFear is licensed under the GNU Affero General Public License v3.0. See LICENSE.

About

Continuous eyetracking (including pupil size) data from N = 361 participants undergoing fear conditioning with different ISIs and different settings, combining data from 12 experiments.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages