Home > data-import > supporting_functions > parse_yarbus.m

parse_yarbus

PURPOSE ^

SYNOPSIS ^

function [data, infoidx, n] = parse_yarbus(filename)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [data, infoidx, n] = parse_yarbus(filename)
0002 
0003 fid = fopen(filename, 'rb');
0004 
0005 line = fgetl(fid);
0006 n = 1;
0007 
0008 while isempty(strfind(line, 'scene resolution:'))
0009     line = fgetl(fid);
0010     n = n + 1;
0011 end
0012 
0013 res = sscanf(line, 'eye resolution: %dx%d scene resolution: %dx%d');
0014 
0015 infoidx.eyeResolution = [res(1) res(2)];
0016 infoidx.sceneResolution = [res(3) res(4)];
0017 
0018 while isempty(strfind(line, 'recordFrameCount'))
0019     line = fgetl(fid);
0020     n = n + 1;
0021 end
0022 
0023 delim = strsplit(line, ' ');
0024 for d = 1:numel(delim)
0025     switch delim{d}
0026         case 'recordFrameCount'
0027             infoidx.frameCount = d;
0028         case 'porX'
0029             infoidx.porX = d;
0030         case 'porY'
0031             infoidx.porY = d;
0032     end
0033 end
0034 
0035 % skip additional blank lines
0036 while isempty(fgetl(fid))
0037     n = n + 1;
0038 end
0039 fclose(fid);
0040 
0041 data = scantext(filename, ' ', n);
0042 end

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