140211

2/11/14

- Deleted cfgModifyCB.
- Added cfgAddNew.m
- cfgSaccCB.m/addDblClickCB: Identifies current request from
CFG.CFG_TAGS{2} handle and switches action
- cfgSaccCB.m/addDblClickCB:
- Removed cfgUISecure(‘clearsaccaction’)
- Set current table UserData as selected row
- Added src.clearSelection to clear JIDE table row.
- cfgUISecure(‘clearuitablecb’)
- cfgUISecure:
- Added switch argument ‘clearuitablecb’ to remove CBs attached to JIDE
table (e.g. addDblClickCB)
- Added switch argument ‘clearuitableud’ to remove UserData from both
data tables
- Assuming 3:4 in CFG.handles.hLUI
- cfgAddNew: Added clean-up items
- Find non-empty user data from UI tables
- Assuming 3:4 in CFG.handles.hLUI
- Finds selected row from non-empty data table
- cfgUISecure(‘clearuitableud’)
- cfgUISecure(‘anyselect’)
- cfgUISecure(‘clearsaccaction’)

ToDo:
- Add function Done
- Row select Done
- Double-click Done
- Record selected index somewhere
- Feedback
- User prompt to signify double-click
- Remove row selection on select Done
- Add an “Add new saccade” follow up function (or some kind of call to
forward activity) Done
- UISecure
Option 1 -- Plot from nearly scratch:
- Remove current plotting
- Restrict trial slider/entry
- Restrict Velocity Plot
- Restrict scan path plotting
- Edit plot parms and use ilabSetPlotParms manually.
- Restrict RelMovmnt
- Restrict Fixations
- Restrict Pupil
Option 2 -- Plot by faking AP.saccade.list:
- Save AP.saccade.list and ‘SaccadeListbox’ handle
- Create pseudo AP.saccade.list and ‘SaccadeListbox’ with pseudo ‘valSL’
== trial selection from dblclick:
- AP.saccade.list(valSL,1) = trial selection from dblclick
- AP.saccade.list(valSL,3) = Grip 1 pos, default 0, parameterize default
- AP.saccade.list(valSL,4) = Grip 2 pos, default 1, parameterize default
- Need to get valSL (indexing) correct.
- PP.trialList changed and restricted to trial selection from dblclick
(Get and Set)
- Set TrialSlider, TrialCurrent, TrialList, with set(‘Tag’)
- Imitate ilabVelocityPlotCB.m/setMainWinTrialUICtls(trial)
- get’s ilabGetMainWinHdl
- get’s TrialCurrent, TrialSlider, and TrialList
- sets value to trial
- Can’t use CB’s because of gcbo
- Restrict TrialSlider, TrialList, and VelocityPlot

Option 3 -- Separate Window

- Multislider
- Restrict 2 sliders only
- Left and right, can’t cross
- Domain conversion to trial, for window presentation and entry
-Grip Call back:
- Modify pseudo saccade.list values 3 (Left grip) and 4 (Right grip)
- ilabPlotSaccade
- ilabDrawCoordPlot
- Pop-up window during to confirm/deny, and present
- Callback will update cfg_datatool
- Callback will revert AP.saccade.list and ‘SaccadeListbox’ handle
- ListBox selection cleared.
- Need velocity calculations
- ilabEditSaccadeCB(‘add’) > ilabEditSaccadeCB.m/newSaccade
- uses s1, s2 from ginput(1), then divides by acqIntvl_sec
- tT is index from target code
- See ilabReviewILABCB.m/ckStartStopCnt
- index(1), index for start code
- index(2), index for stop code
- index(3), index for target code
- Will need to revisit this when performing latency and trial data load
-  Different trial codes for initial/final
- Need to create trial codes
- Or perform separate calculations
- vabs:
- ilabVelocityPlotCB.m/drawVelocityTraces
t = PP.trialList(n);
t1 = PP.index(t,1);
t2 = PP.index(t,2);

trialx = PP.data(t1:t2,1);
trialy = PP.data(t1:t2,2);

vx = [0; diff(trialx)];
vy = [0; diff(trialy)];

%  Change velocity units from ILAB_coord/sample_interval to deg/s
[pixPerDegH, pixPerDegV] = ilabPixelsPerDegree;

vx = vx/(pixPerDegH*acqIntvl);
vy = vy/(pixPerDegV*acqIntvl);

vabs = sqrt(vx.^2 + vy.^2);
VPLOT_VABS = vabs;
- ilabMkSaccadeList.m:
- Almost identical except vx and vy are not converted to deg/s
1) Still in ILAB pixels/sample
2) vPeak, iPeak, and vCutoff calculated non-converted
3) ts1 and ts2 converted to ms
4) ts2 - ts1 checked against AP.saccade.minDuration
5) sRT and ttP converted to ms
6) vPeak and vMean are converted to deg/s
7) Distance travelled (dSac) calculated with all converted units
- ilabMkSaccadeList.m occurs when you run Auto-saccade detection, and
populates PP
- Absolute velocity vector for trial
- vPeak = max(vabs(s1:s2))
- iPeak = s1 + min(find(vabs(s1:s2) == vPeak)) - 1;
- min is to find first vPeak, if 2+
- Add additional indices to s1
- NaN’s, infinite values, in vabs? pctInvalid?
- sRT is saccadic reaction time (s1), relative to tT index
- time-to-peak is peak index (iPeak) relative to tT index
- dist = vMean (mean vel) * (ts2 - ts1) /1000
- ts2 = s1 in ms
- ts2 = s2 in ms
- pctPeak, used with vPeak to show if the velocity has passed the
vCutoff limit in Velocity window
- Show, or show if not passed vCutOff, but not in velocity window
- Release row select Done
- Release saccade action Done
- cfgParams(‘setsacc’)
- Finalize saccade action restrictions
- User prompt to stop current action, or continue
- Add plot clearing functions where appropriate
- Include “Are you sure?” text if selected saccade already has saccade
data inputted for that initial/final trial.  Do same for Modify, Add,
Select, and Clear
- Checking for “NaN”, or never modified/cleared saccades.
- This will allow “Modify” to function, and also prevent overwrite.
- Add method to cfgParams for loading experimental data. Write up
specifications.  Add file string to data structure.  Add ui text to
“General Info”.  Edit CFG.CFG_TAGS.  Maybe modify menu item (Import
trial data)
- Add clear saccade data function