Home > demos > demo_manip_cevent.m

demo_manip_cevent

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 subs = cIDs([72]);
0002 
0003 min_dur = 0.25;
0004 merge_dur = 0.5;
0005 mkdir('demo_manip_cevent');
0006 for s = 1:numel(subs)
0007      subid = subs(s);
0008      % check that variables exist
0009      if has_all_variables(subid, {'cevent_eye_roi_child', 'cevent_eye_roi_parent'})
0010          
0011          % load cevents
0012          child_eye_orig = get_variable(subid, 'cevent_eye_roi_child');
0013          parent_eye_orig = get_variable(subid, 'cevent_eye_roi_parent');
0014          
0015          % only consider toy looks
0016          child_eye = cevent_category_equals(child_eye_orig, [1 2 3]);
0017          parent_eye = cevent_category_equals(parent_eye_orig, [1 2 3]);
0018          
0019          % merge over small gaps
0020          child_eye = cevent_merge_segments(child_eye, merge_dur);
0021          parent_eye = cevent_merge_segments(parent_eye, merge_dur);
0022          
0023          % remove short events
0024          child_eye = cevent_remove_small_segments(child_eye, min_dur);
0025          parent_eye = cevent_remove_small_segments(parent_eye, min_dur);
0026          
0027          % merge again, now that new gaps may have appeared
0028          child_eye = cevent_merge_segments(child_eye, merge_dur);
0029          parent_eye = cevent_merge_segments(parent_eye, merge_dur);
0030          
0031          JA = cevent_shared(child_eye, parent_eye);
0032          
0033          % view new JA with original eye streams and save image to folder
0034          vis_streams_data({child_eye_orig, parent_eye_orig, JA}, [], {'ceye', 'peye', 'ja'});
0035          export_fig(sprintf('demo_manip_cevent/%d.png', subid));
0036          close(gcf);
0037          
0038      end
0039 end

Generated on Tue 23-May-2017 03:00:58 by m2html © 2005