Home > data-vis > vis_streams_multiwork.m

vis_streams_multiwork

PURPOSE ^

see demo_vis_streams_multiwork for documentation

SYNOPSIS ^

function vis_streams_multiwork(subexpIDs, vars, streamlabels, directory, args)

DESCRIPTION ^

 see demo_vis_streams_multiwork for documentation

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function vis_streams_multiwork(subexpIDs, vars, streamlabels, directory, args)
0002 % see demo_vis_streams_multiwork for documentation
0003 if ischar(subexpIDs) && contains(subexpIDs, 'demo')
0004     switch subexpIDs
0005         case 'demo1'
0006             subexpIDs = [7206, 7207];
0007             vars = {'cstream_eye_roi_child', 'cstream_eye_roi_parent'};
0008             directory = '/desktop/vis_streams_multiwork';
0009             streamlabels = {'ceye', 'peye'};
0010     end
0011 end
0012 
0013 if ~exist('args', 'var') || isempty(args)
0014     args = struct();
0015 end
0016 
0017 if ~isfield(args, 'draw_edge')
0018     args.draw_edge = 1;
0019 end
0020 
0021 if ~isfield(args, 'colors')
0022     args.colors = [];
0023 end
0024 
0025 [subs,subtable,subpaths] = cIDs(subexpIDs);
0026 
0027 for s = 1:numel(subs)
0028     try
0029         filenames = cell(numel(vars), 1);
0030         for v = 1:numel(vars)
0031             if ischar(vars{v})
0032                 filenames{v,1} = fullfile(subpaths{s}, [vars{v} '.mat']);
0033             else
0034                 filenames{v,1} = vars{v};
0035             end
0036         end
0037         if isfield(args, 'window_times_variable')
0038             window_times_file = fullfile(subpaths{s}, [args.window_times_variable '.mat']);
0039         elseif ismember(subtable(s,2), [12])
0040             window_times_file = [];
0041         else
0042             window_times_file = fullfile(subpaths{s}, 'cevent_trials.mat');
0043         end
0044         flag_dir = 1;
0045         if exist('directory', 'var') && ~isempty(directory)
0046             if exist(directory, 'dir')
0047                 savefilename = fullfile(directory, sprintf('%d.png', subs(s)));
0048             else
0049                 error('%s does not exist', directory);
0050             end
0051         else
0052             savefilename = [];
0053             flag_dir = 0;
0054         end
0055         
0056         args.titlelabel = sprintf('%d', subs(s));
0057         h = vis_streams_files(filenames, window_times_file, savefilename, streamlabels, args);
0058         if flag_dir
0059             close(h);
0060         end
0061     catch ME
0062         format_error_message(ME, sprintf('%d', subs(s)));
0063         continue;
0064     end
0065 end
0066 end

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