Home > data-vis > vis_streams_animation.m

vis_streams_animation

PURPOSE ^

cut table to be more accurate

SYNOPSIS ^

function vis_streams_animation(subexpIDs, varList, labels, camIDs)

DESCRIPTION ^

 cut table to be more accurate

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function vis_streams_animation(subexpIDs, varList, labels, camIDs)
0002 % cut table to be more accurate
0003 if ischar(subexpIDs)
0004     switch subexpIDs
0005         case 'demo1'
0006             close all;
0007             subexpIDs = 72;
0008             varList = {'cstream_eye_roi_child'};
0009             labels = {'ceye'};
0010             camIDs = [];
0011     end
0012 end
0013 varListrequired = {
0014     'cont3_motion_pos_head_child' % 1 2 3
0015     'cont3_motion_pos_head_parent' % 4 5 6
0016     'cont3_motion_pos_left-hand_child' % 7 8 9
0017     'cont3_motion_pos_right-hand_child' % 10 11 12
0018     'cont3_motion_pos_left-hand_parent' % 13 14 15
0019     'cont3_motion_pos_right-hand_parent'
0020     'cstream_eye_roi_child'
0021     'cstream_eye_roi_parent'
0022     'cstream_inhand_left-hand_obj-all_child'
0023     'cstream_inhand_right-hand_obj-all_child'
0024     'cstream_inhand_left-hand_obj-all_parent'
0025     'cstream_inhand_right-hand_obj-all_parent'};
0026 
0027 h = figure('position', [50 100 960 540]);
0028 m = figure('position', [1025 564 560 420]); % motion
0029 b = figure('position', [1026 100 284 372]); % frames
0030 z = figure('position', [1325 100 483 371]);
0031 
0032 fprintf('\nInstructions\n\tDown Arrow - next subject\n\tUp Arrow - prev subject\n\tLeft Click cstream to set begin point\n\tRight Click cstream to set end point\n');
0033 
0034 h.UserData.idx = 1;
0035 
0036 [subs,~,subpaths] = cIDs(subexpIDs);
0037 
0038 % varCheck = cat(1, varListrequired, varList);
0039 log1 = cellfun(@(a) has_all_variables(a, varList), subpaths);
0040 log2 = cellfun(@(a) has_all_variables(a, varListrequired), subpaths);
0041 log = log1 & log2;
0042 h.UserData.subs = subs(log);
0043 h.UserData.subpaths = subpaths(log);
0044 h.UserData.numsubs = length(h.UserData.subs);
0045 h.KeyPressFcn = @keypressed;
0046 update_vis();
0047 
0048     function keypressed(h, event)
0049         flagChanged = 0;
0050         if strcmp(event.Key, 'downarrow')
0051             if h.UserData.idx < h.UserData.numsubs
0052                 flagChanged = 1;
0053                 h.UserData.idx = h.UserData.idx + 1;
0054             end
0055         elseif strcmp(event.Key, 'uparrow')
0056             if h.UserData.idx > 1
0057                 h.UserData.idx = h.UserData.idx - 1;
0058                 flagChanged = 1;
0059             end
0060         end
0061         if flagChanged
0062             update_vis();
0063         end
0064     end
0065 
0066     function update_vis()
0067         figure(h);
0068         clf();
0069         figure(b);
0070         clf('reset');
0071         figure(m);
0072         clf('reset');
0073         figure(z);
0074         clf('reset');
0075         vis_streams(h.UserData.subs(h.UserData.idx), varList, labels, [], [], 1, h);
0076         load_frame_ui(h,b,m,z,h.UserData.subs(h.UserData.idx), camIDs);
0077     end
0078 end
0079

Generated on Wed 24-May-2017 00:00:56 by m2html © 2005