Home > data-import > make_eye_roi.m

make_eye_roi

PURPOSE ^

convert individual coding stream into one

SYNOPSIS ^

function make_eye_roi(IDs, obj_list)

DESCRIPTION ^

 convert individual coding stream into one

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function make_eye_roi(IDs, obj_list)
0002 % convert individual coding stream into one
0003 subs = cIDs(IDs);
0004 
0005 if ~exist('obj_list', 'var') || isempty(obj_list)
0006     roi_list = {'obj1','obj2','obj3','head'};
0007 else
0008     roi_list = [];
0009     for r = obj_list;
0010         roi_list{r} = sprintf('obj%d',r);
0011     end
0012     roi_list = cat(2, roi_list, 'head');
0013 end
0014 
0015 prefix = 'cstream_eye_roi';
0016 agent = {'child' 'parent'};
0017 
0018 for i = 1 : numel(subs)
0019     for a = 1:2
0020         suffix = agent{a};
0021         if has_variable(subs(i),sprintf('%s_%s_%s',prefix, roi_list{1}, suffix))
0022             data = [];output=[];
0023             for j = 1 : size(roi_list,2)
0024                 temp = get_variable(subs(i), sprintf('%s_%s_%s',prefix, ...
0025                     roi_list{j}, suffix));
0026                 data(:,j) = temp(:,2);
0027             end;
0028             
0029             output(:,2) = sum(data,2);
0030             output(:,1) = temp(:,1);
0031             record_variable(subs(i), sprintf('%s_%s',prefix,suffix),output);
0032             
0033             cevent_data = cstream2cevent(output);
0034             record_variable(subs(i), sprintf('cevent_eye_roi_%s',suffix),cevent_data);
0035             
0036         end;
0037     end
0038 end;
0039

Generated on Tue 23-May-2017 02:00:59 by m2html © 2005