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
Files
3
+ 54
0
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% Take 200nm slice of vbSPT synthetic data
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% Select the mat result file generated by simulation
 
[fn pt] = uigetfile(('*.mat'), 'Choose a File');
 
load(fn)
 
 
min_length = 3;%minimum length minus 1
 
%% set number of trajectories
 
traj_no = 10000;
 
 
for k = 1 : traj_no
 
l = size(finalTraj{k},1);
 
 
for i = 1:l
 
 
%take slice
 
if finalTraj{k}(i,3)>= -100 && finalTraj{k}(i,3)<= 100
 
finalTraj{k}(i,5) = 1;
 
%if not in our z range then it is a blink
 
else finalTraj{k}(i,5) = 2;
 
end
 
end
 
 
end
 
%%
 
ct = 1;
 
for k = 1:traj_no
 
chop = [1; find(finalTraj{k}(:,5)==2)];
 
if length(chop) == 1
 
chtrack{ct} = finalTraj{k}(:,1:5);
 
ct = ct+1;
 
else
 
if chop(2) > min_length + 1
 
chtrack{ct} = finalTraj{k}(1:chop(2)-1,1:5);
 
ct = ct+1;
 
end
 
for m =3:length(chop)
 
if (chop(m)-chop(m-1)) > min_length+1
 
chtrack{ct} = finalTraj{k}((chop(m-1)+1:chop(m)-1), 1:5);
 
ct = ct+1;
 
end
 
end
 
if l - chop(end) > min_length
 
chtrack{ct} = finalTraj{k}((chop(end)+1:end), 1:5);
 
ct = ct+1;
 
end
 
 
end
 
end
 
 
 
chtrack = chtrack(~cellfun('isempty',chtrack));
 
save(fullfile(pt, strcat('chtrack_',strtok(fn, '.'), '.mat')), 'chtrack');
 
\ No newline at end of file
Loading