Closed ihgumilar closed 1 year ago
9179b3e1debfb281d4d8ab5b86e2536ca725b55f use this repo for point no.2 above.
Make function to combine eye data to dataframe
Combine all cleaned eye tracker data into dataframe. It is separated between odd and even subjects
ToDo :
Still has an issue when running function to convert from cartesian to degree for averted_pre_even subjects
The above issue is due to the the number of columns are more than 24, i.e., 44. No idea what it happens but we solve it by cutting the extra columns. 00f00b67f4947aaa205932b49845bedb27af3c6b is the repo that fixed the issue
[x] 1. Populate odd subjects and even subjects into one separate dataFrame for all conditions , i.e. averted_pre , averted_post , direct_pre, direct_post, natural_pre, and natural_post. It means for each condition, eg. averted_pre* , there will be two dataFrames, one for odd subjects and one for even subjects.
[x] 2. Convert GazeDirections, which are in cartesian (x, y, z) to degree, see Functions to convert cartesian to polar degree, for both Right and Left eyes. Put the converted value (degree) into a new column (eg. eye right-left), by using this code. Inside it, a function gaze_direction_in_x_axis_degree(x, y) is resulting a degree that indicates a movement of the eye in xaxis (right or left). A function gaze_direction_in_y_axis_degree(y, z) is resulting a degree that indicates a movement of eye in yaxis (up or down).
**averted_pre_even**
subject. See the issue below here.[x] 3. Check whether the values (degree) that are under the column of (eg. eye right-left) are within the range of fovea, see Function to check whether a degree within fovea (30 degrees in total) and use the function check_degree_within_fovea(gaze_direction) inside this script. If it is within the fovea, it will result it 1 otherwise 0. Save those new values (1 or 0) into a new colum, eg in_fovea.
[x] 4. Compare values of
in_fovea
for both x-axis and y-axis whether both of them are 1. For example, if both of them are 1 then give a label or value 1 in a new column, e.g.look_each_other
, otherwise 0. Do this for both right and left eyes as well. Of course, for both odd and even subject dataframes.[x] 5. Since the sampling rate is 125 / per second (125 rows for each second) , we need to count how many "1" as well as "0" in column
look_each_other
within a second (125 rows). We need a threshold Threshold of within a second to determine "looking" (conscious) or "not looking" (unconscious) #10. For example, if the threshold is 13, when we count "1" in columnlook_each_other
within a second (125 rows), there are 13 of "1", then we need to create a new label 1 which indicates "really" or "scientifically" looking, otherwise 0. Put those new values (0 and 1) into a new column, eg.sig_looking
[x] 6. Do the step 2-4 for both odd and even subjects' dataFrames for each eye condition.
[x] 7. Check whether each pair looked at each other or not. Take a value from column
in_fovea
of odd and even subject, then check if both are giving 1 (must be 1 for both of them), which indicates look at each other in the same range of fovea. If so, give label 1 and put it into a new column again, eg.look_each_other
, otherwise give label 0, that indicates that their eyes were not matched within a second.[ ] 8. Count a proportion of value 1 and 0 in column
sig_looking
. For example, if there are 60 "1" in the columnsig_looking
, then we can calculate the proportion : (60 / 1800) x 100 = 33 %. It means that out of 120 seconds (2 minutes), their eyes met only in 33%~40 seconds). Note 1800 = 120 (seconds) x 15 subjects (odd or even)