Home > data-import > generate_derived_smart_room > make_joint_eye_inhand_smart_room.m

make_joint_eye_inhand_smart_room

PURPOSE ^

SYNOPSIS ^

function make_joint_eye_inhand_smart_room(subexpIDs)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function make_joint_eye_inhand_smart_room(subexpIDs)
0002 subs = cIDs(subexpIDs);
0003 agents = {'child', 'parent'};
0004 for s = 1:numel(subs)
0005     sub = subs(s);
0006     fprintf('%d\n', sub);
0007     timebase = get_variable(sub, 'cstream_trials');
0008     for a = 1:2
0009         for b = 1:2
0010             agent1 = agents{a};
0011             agent2 = agents{b};
0012             inhandvar1 = sprintf('cevent_inhand_right-hand_obj-all_%s', agent1);
0013             inhandvar2 = sprintf('cevent_inhand_left-hand_obj-all_%s', agent1);
0014             eyevar = sprintf('cevent_eye_roi_%s', agent2);
0015             if has_all_variables(subs(s), {eyevar, inhandvar1, inhandvar2})
0016                 eyedata = get_variable(sub, eyevar);
0017                 inhanddata1 = get_variable(sub, inhandvar1);
0018                 inhanddata2 = get_variable(sub, inhandvar2);
0019                 eyedatacst = cevent2cstreamtb(eyedata, timebase);
0020                 inhanddatacst1 = cevent2cstreamtb(inhanddata1, timebase);
0021                 inhanddatacst2 = cevent2cstreamtb(inhanddata2, timebase);
0022                 
0023                 jointcst = timebase;
0024                 jointcst(:,2) = 0;
0025                 log = ( eyedatacst(:,2) == inhanddatacst1(:,2) ) | ( eyedatacst(:,2) == inhanddatacst2(:,2) );
0026                 jointcst(log,2) = eyedatacst(log,2);
0027                 jointcev = cstream2cevent(jointcst);
0028                 %             vis_cstreams({eyedata, inhanddata, joint});
0029                 %             pause();
0030                 jointname = sprintf('cevent_inhand-eye_%s-%s', agent1, agent2);
0031                 record_variable(sub, jointname, jointcev);
0032                 record_variable(sub, strrep(jointname, 'cevent', 'cstream'), jointcst);
0033             end
0034         end
0035     end
0036 end

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