function T = parse(f) % Parses _trajectories.txt files from Mouse Embryo Tracking Database % Example of usage: % f = fopen('MouEmbTrkDtb/E00/_trajectories.txt'); % T = parse(f); % fclose(f); % T contains the trajectories (centers, radii) of cells % from appearance to division: % T(:,1:3): centers x, centers y, and radii of cell c0 % T(:,4:6): centers x, centers y, and radii of cell c00 % T(:,7:9): centers x, centers y, and radii of cell c01 % T(:,10:12): centers x, centers y, and radii of cell c000 % T(:,13:15): centers x, centers y, and radii of cell c001 % T(:,16:18): centers x, centers y, and radii of cell c010 % T(:,19:21): centers x, centers y, and radii of cell c011 % Note that (x,y) = (row,column) % Also, a zero entry means that the cell doesn't "exist" in that frame nframes = 0; while ~feof(f) for j = 1:21 fscanf(f,'%d',1); fscanf(f,'\t',1); end fscanf(f,'\n',1); nframes = nframes+1; end frewind(f); T = zeros(nframes,21); for i = 1:nframes for j = 1:21 a = fscanf(f,'%d',1); fscanf(f,'\t',1); T(i,j) = a; end fscanf(f,'\n',1); end end