Movatterモバイル変換


[0]ホーム

URL:


QC with Interactive Reports

1 Setup

After extracting epochs from your data,

eye<- eye|>epoch(events ="PROBE_START_{trial}",limits =c(0,1),label ="probeEpochs",calc_baseline =TRUE,apply_baseline =TRUE,baseline_type ="sub",baseline_events ="DELAY_STOP_*",baseline_period =c(-1,0)  )

(for more details on extracting pupil data epochs, see theExtracting Data Epochs and ExportingPupil Data vignette; for more details on this specific example codeshown above,clickhere).

2 Generating the Interactive HTML Reports

When runningbidsify on the previously epoched data, besure to sethtml_report toTRUE (as shownbelow).

bidsify(eyeris = eye_1c,bids_dir =tempdir(),# Replace with preferred path, like "~/Documents/eyeris"participant_id ="001",session_num ="01",task_name ="assocmem",run_num ="01",save_raw =TRUE,# Also save raw timeserieshtml_report =TRUE,# Generate an interactive preproc summary report documentreport_seed =0# Make randomly selected plot epochs reproducible across runs)

Which will create a directory structure like this:

eyeris└── derivatives    └── sub-001        └── ses-01            ├── eye            │   ├── sub-001_ses-01_task-assocret_run-01_desc-timeseries_pupil.csv            │   └── sub-001_ses-01_task-assocret_run-01_epoch-prePostProbe_desc-preproc_pupil.csv            ├── source            │   └── figures            │       └── run-01            │           ├── epoch_prePostProbe            │           │   ├── run-01_PROBE_START_22_1.png            │           │   ├── run-01_PROBE_START_22_2.png            │           │   ├── run-01_PROBE_START_22_3.png            │           │   ├── run-01_PROBE_START_22_4.png            │           │   ├── run-01_PROBE_START_22_5.png            │           │   ├── run-01_PROBE_START_22_6.png            │           │   ├── ...            │           │   ├── run-01_PROBE_STOP_22_1.png            │           │   ├── run-01_PROBE_STOP_22_2.png            │           │   ├── run-01_PROBE_STOP_22_3.png            │           │   ├── run-01_PROBE_STOP_22_4.png            │           │   ├── run-01_PROBE_STOP_22_5.png            │           │   ├── run-01_PROBE_STOP_22_6.png            │           │   ├── ...            │           ├── run-01_fig-1_desc-histogram.jpg            │           ├── run-01_fig-1_desc-timeseries.jpg            ├── sub-001_epoch-prePostProbe_run-01.html            └── sub-001.html9 directories, 80 files

Here, notice specifically these two files:

3 Previewing your Entire Pupil Timeseries

sub-001.html will look something like this:

4 Data QC of Extracted Pupil Epochs with Interactive Reports

Meanwhile,sub-001_epoch-prePostProbe_run-01.html willenable you to interact with images of each extracted data epoch (forwhich you will see include separate images for each epoch at eachsequential stage of the preprocessing pipeline). This feature wasintentionally designed to make data QC a default behavior without thebarriers of needing to code up a script with loops to print out imagesof each preprocessing step for each epoch for each participant.

As you see below, you can use your left/right arrow keysonyour keyboard to quickly scan through the data fromeach trial, whilesimultaneously watching what happenedto any given epoch’s signal from startto finish! Wehope this intuitive feature is fun and helps you make moreappropriate preprocessing decisions to optimize yoursignal-to-noise ratiowith as little overhead aspossible!

5 Gaze Heatmaps

In addition to the standard pupil timeseries plots,eyeris now includes gaze heatmaps that show thedistribution of eye coordinates across the entire screen area. Theseheatmaps are automatically generated in the BIDS reports and can also becreated manually.

Standalone Gaze Heatmaps

When you runbidsify() withhtml_report = TRUE,eyeris automaticallycreates standalone gaze heatmaps for each block of data. These heatmapsshow:

Manual Gaze Heatmap Creation

You can also create gaze heatmaps manually using theplot_gaze_heatmap() function:

plot_gaze_heatmap(eyeris = eyeris_data$timeseries$block_1,screen_width = eyeris_data$info$screen.x,screen_height = eyeris_data$info$screen.y,n_bins =50,col_palette ="viridis")

Epoch-Level Gaze Heatmaps

For epoched data, each epoch automatically generates a gaze heatmapshowing the distribution of eye coordinates during that specific epoch.These are saved as separate files in the epoch directories and help youquickly assess:

The gaze heatmaps use the screen dimensions stored in theeyeris$info object to properly show the full screen areaand use color-coded density to visualize gaze patterns.


📚 Citingeyeris

If you use theeyeris package in your research, pleasecite it!

Run the following in R to get the citation:

citation("eyeris")#> To cite package 'eyeris' in publications use:#>#>   Schwartz ST, Yang H, Xue AM, He M (2025). "eyeris: A flexible,#>   extensible, and reproducible pupillometry preprocessing framework in#>   R." _bioRxiv_, 1-37. doi:10.1101/2025.06.01.657312#>   <https://doi.org/10.1101/2025.06.01.657312>.#>#> A BibTeX entry for LaTeX users is#>#>   @Article{,#>     title = {eyeris: A flexible, extensible, and reproducible pupillometry preprocessing framework in R},#>     author = {Shawn T Schwartz and Haopei Yang and Alice M Xue and Mingjian He},#>     journal = {bioRxiv},#>     year = {2025},#>     pages = {1--37},#>     doi = {10.1101/2025.06.01.657312},#>   }

[8]ページ先頭

©2009-2025 Movatter.jp