FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects

angles

Merged C. Roussos requested to merge cr607-master-patch-11262 into master
+ 51
0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Convert the output of icy to input for vbspt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Select the xml result file generated by icy
[fn pt]= uigetfile('*.xml', 'Select xml file')
% read as an Excel file
A = xlsread(fullfile(pt,fn)); % select the xml file
%% set pixel size - if icy results are in pixels. Otherwise px = 1
px = 110;
%% create tracks and chopped tracks
% chopped tracks are the tracks that do not allow blinks
id = unique(A(:,5));
ct = 1;
for k = 1:length(id)
ii = find(A(:,5)==id(k));
track{k} = A(ii, 10:11);
track{k}(:,1:2) = track{k}(:,1:2)*px;
chop = [1; find(A(ii,9)==2)];
if length(chop) == 1
if length(ii) > 2
chtrack{ct} = track{k}(:,1:2);
ct = ct+1;
else
end
else
if chop(2) > 3
chtrack{ct} = A(ii(1:chop(2)-1), 10:11)*px;
ct = ct+1;
else
end
for m =3:length(chop)
if (chop(m)-chop(m-1)) > 3
chtrack{ct} = A(ii(chop(m-1)+1:chop(m)-1), 10:11)*px;
ct = ct+1;
else
end
end
if length(ii) - chop(end) > 2
chtrack{ct} = A(ii(chop(end)+1:length(ii)), 10:11)*px;
ct = ct+1;
else
end
end
end
save(fullfile(pt, strcat('chopped_track',strtok(fn, '.'), '.mat')), 'chtrack');
\ No newline at end of file
Loading