This shows you the differences between two versions of the page.
biac:analysis:roi_et [2011/04/25 17:53] petty [ROI Drawing] |
biac:analysis:roi_et [2023/02/23 18:43] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Region of Interest Based Eyetracking Analysis ====== | ||
- | These steps were created to gather eyetracking information based on specific regions of interest drawn on stimuli from the experimental task. The following assumes your task was image based, ( or images can be created to mimic the task ), there is XML behavioral output from the task, and your eyetracking was collected through Cigal or Viewpoint. | ||
- | |||
- | ===== Behavioral XML ===== | ||
- | |||
- | The first step is to create behavioral XML files using the [[http:// | ||
- | Please see the documentation for eprime2xml, showplay2xml, | ||
- | |||
- | Your resulting event nodes should include (at minimum): | ||
- | * the image name | ||
- | * onset | ||
- | * duration | ||
- | |||
- | For example: | ||
- | < | ||
- | <event type=" | ||
- | < | ||
- | < | ||
- | <value name=" | ||
- | <value name=" | ||
- | <value name=" | ||
- | <value name=" | ||
- | <value name=" | ||
- | </ | ||
- | </ | ||
- | |||
- | |||
- | ===== ROI Drawing ===== | ||
- | |||
- | Next, ROIs should be drawn for each image that you wish to calculate eyetracking data. These ROIs should be saved in an XML based format. | ||
- | |||
- | All of the following steps are based on this type of ROI. | ||
- | |||
- | Here is a sample script to run the drawing function. | ||
- | * The first thing you need is a text file with all the image paths ( the full path to the image is recommended ). | ||
- | * Also, either add the path to the actual drawing function **" | ||
- | |||
- | <file matlab drawer_sample.m> | ||
- | %% add path to functions | ||
- | %addpath \\Munin\Data\Programs\User_Scripts\petty\matlab\ | ||
- | addpath ~/ | ||
- | |||
- | %% full path to your text file, which contains images ( also full path ) | ||
- | fileList = textread(' | ||
- | XML.rois = {}; %create empty XML | ||
- | outName = ' | ||
- | |||
- | %screen resolution of task display | ||
- | xRes = 1024; | ||
- | yRes = 768; | ||
- | scrSize = [ xRes yRes ]; | ||
- | |||
- | imgIDX = 0; %leave 0 to start at first image | ||
- | |||
- | figUD = struct(' | ||
- | %loop that finds images | ||
- | imgs = {}; | ||
- | for file=1: | ||
- | [path name ext] = fileparts(fileList{file}); | ||
- | imgs{file} = struct(' | ||
- | end | ||
- | |||
- | %% this opens the drawing window and runs functions: do not edit %% | ||
- | fscreen = repmat(uint8(0), | ||
- | axes_h = axes; | ||
- | imshow(fscreen,' | ||
- | text(10, | ||
- | figH = gcf; | ||
- | set(figH,' | ||
- | set(figH,' | ||
- | hold on; | ||
- | |||
- | % calls the functions | ||
- | set(figH,' | ||
- | </ |