biac:analysis:roi_et
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
biac:analysis:roi_et [2011/04/25 19:48] – [Calculate Eyetracking Hits] petty | biac:analysis:roi_et [2011/04/25 20:17] – [Visualizing Eyetracking Points in Matlab] petty | ||
---|---|---|---|
Line 247: | Line 247: | ||
Hits are considered eyetracking points where gaze was within ROIs defined in step 1, during the duration of each image. | Hits are considered eyetracking points where gaze was within ROIs defined in step 1, during the duration of each image. | ||
- | Chris written a perl script (**merge_eyetracking.pl**), | + | Chris has written a perl script (**merge_eyetracking.pl**), |
The script can be copied from: \\Munin\Data\Programs\User_Scripts\petty, | The script can be copied from: \\Munin\Data\Programs\User_Scripts\petty, | ||
Line 268: | Line 268: | ||
< | < | ||
+ | |||
+ | The processing script will add elements to the behavioral XML that represent hits and samples of valid eyetracking points from within your duration, this instance has 120 valid sample, with more than 50% inside the ROI: | ||
+ | |||
+ | < | ||
+ | <event type=" | ||
+ | < | ||
+ | < | ||
+ | <value name=" | ||
+ | <value name=" | ||
+ | <value name=" | ||
+ | <value name=" | ||
+ | <value name=" | ||
+ | <roi type=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <value name=" | ||
+ | <value name=" | ||
+ | </ | ||
+ | <value name=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | At this point you could use these additional XML elements when extracting your onsets for FSL, etc by including some hit criteria in your xcede_extract_schedules.pl queries. | ||
+ | |||
+ | |||
+ | ===== Visualizing Eyetracking Points in Matlab ===== | ||
+ | |||
+ | Once eyetracking has been preprocessed, | ||
+ | |||
+ | Functions can be added to matlab path: \\Munin\Data\Programs\User_Scripts\petty\matlab\ or copied into a local location. | ||
+ | |||
+ | To run the plotter: | ||
+ | |||
+ | <file matlab et_visualization_sample.m> | ||
+ | %% add biac tools if needed | ||
+ | %run / | ||
+ | |||
+ | %%add my functions | ||
+ | %addpath \\Munin\Data\Programs\User_Scripts\petty\matlab\ | ||
+ | addpath / | ||
+ | |||
+ | %%XML with behavioral and ROIS | ||
+ | XML_docname = ' | ||
+ | |||
+ | %%preprocessed eyetracking data | ||
+ | ET_filename = ' | ||
+ | |||
+ | %%Path to your actual images, an array if multiple locations possible | ||
+ | imgPath = {'// | ||
+ | |||
+ | %%Image attribute name from behavioral XML [value=name" | ||
+ | imgAttr = ' | ||
+ | |||
+ | %%screen resolution of stimulus computer | ||
+ | xRes = 1024; | ||
+ | yRes = 768; | ||
+ | scrSize = [ xRes yRes ]; | ||
+ | |||
+ | %%turn on scanpath lines | ||
+ | linesOn = 1; | ||
+ | %%turn on pause | ||
+ | withPause = 0; %1=on, this pauses between every point | ||
+ | |||
+ | %%run the function | ||
+ | %%this will show image, ROI, and ET points | ||
+ | ROI_redraw(XML_docname, | ||
+ | |||
+ | %%this will only show image and ET points | ||
+ | %ET_plot(XML_docname, | ||
+ | |||
+ | </ | ||
+ | |||
+ | The output will look like this: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Hits are green circles inside the ROI, misses are red Xs outside. | ||
+ | |||
+ | Currently, to move to the next image in the XML, just close the current figure. | ||
+ | |||
+ | Also, if you just have the behavioral XML and preprocessed ET data, you can run the function **ET_plot** instead. | ||
+ |
biac/analysis/roi_et.txt · Last modified: 2024/06/21 15:44 by 127.0.0.1