% Dataset from "Objective pupillometry shows that perceptual styles covary
% with autistic-like personality traits"
% Authors: Chiara Tortelli, Marco Turi, David Charles Burr, Paola Binda.
% published as Research Advances in eLife 2021

%% STD.mat 
% structure containing all data for generating the analyses and figures reported in the manuscript
% it has fields containing the information detailed below, coded
% with the format (N x M) with N = total number of participants (the number
% reported below is referred to the overall sample who participated to the
% standard ecperiment). Of these 53, 24 participants also
% took part in the the no-report experiment. 

%% STD_align2resp.mat  
% structure containing data aligned to perceptual switches
% with the format (N x M) with N=51 (key-press recording failed in 2
% participants of the 53 so 51 is the number of participants who succesfully
% reported perceptual switches)

%% NKR.mat  
% structure containing data from the no-report experiment. 
% with the format (N x M) with N= 24 (total number of participant to this condition)

%% common structure:
% The data structure is the same for the three structures (except where specified). 

% PARTICIPANTS' CHARACTERISTICS
% M = 1  
%         sind:                 [53x1 double] % subject identifier (may be used to link data from the three structures)
%         isfemale:             [53x1 double] % binary, 1=female, 0=male
%         age:                  [53x1 double] % age of the participants in years
%         AQ_total:             [53x1 double] % Autism-spectrum Quotient Questionnaire total score 
%         AQ_SocialSkills:      [53x1 double] % Social Skills subscale of Autism-spectrum Quotient Questionnaire score 
%         AQ_AttentionSwitch:   [53x1 double] % Attention Switch subscale of Autism-spectrum Quotient Questionnaire score 
%         AQ_AttentionToDetail: [53x1 double] % Attention to detail subscale of Autism-spectrum Quotient Questionnaire score 
%         AQ_Communication:     [53x1 double] % Communication subscale of Autism-spectrum Quotient Questionnaire score 
%         AQ_Immagination:      [53x1 double] % Immagination subscale of Autism-spectrum Quotient Questionnaire score 
%         medianpupil:          [53x1 double] % median pupil size computed over the course of the entire session

% TIMECOURSES
% M = 102 corresponding to the 102 timepoints (102 bins at 10Hz) where timecourses of pupil size, gaze velocity and stimulus stereo-depth were recorded. 
%         time:             [53x102 double] % time (from -5 secs to +5 secs , with 0 marking the end of a stereo-depth switch for matricex _STD e _NR, or marking a perceptual siwtch for matrix _align2resp)
%         pupil_1:          [53x102 double] % average pupil size change for segments with black in front (for time > 0, white in front otherwise)
%         pupil_2:          [53x102 double] % average pupil size change for segments with white in front (for time > 0, black in front otherwise)
%         pupil_diff:       [53x102 double] % average pupil size difference between twe two types of segments
%         pupil_mean:       [53x102 double] % grand average of pupil size change
%         xgaze_1:          [53x102 double] % gaze velocity for segments with black in front** (for time > 0, white in front otherwise)
%         xgaze_2:          [53x102 double] % gaze volcity for segments with white in front** (for time > 0, black in front otherwise)
%         xgaze_diff:       [53x102 double] % gaze volcity difference between the two types of segments
% ** note that gaze data for trials with leftward moving black dots were
% sign-swapped

% SUMMARY STATISTCS 
% M is variable between 1 and 2
%         np:                [53x2 double] % Number of valid phases per participant (1s column: with white dots in front, 2nd column: with black dots in front) 
%         xcorr.resp2disp:   [53x2 double] % (only for _STD )1st column response accuracy (peak of the cross-correlation); 2nd column: response time in secs (latency of the peak)
%         pcmixed:           [53x1 double] % (only for _STD) percentage of mixed percepts         
%         xgaze_diff_bin:    [53x1 double] % mean gaze volcity (deg/sec) difference in the selected interval
%         pupil_diff_bin:    [53x1 double] % pupillary response difference in the selected interval
%         pupil_mean_bin:    [53x1 double] % pupillary response mean in the selected interval