Commit 30f7f3ca authored by Turnhout, M.C. van's avatar Turnhout, M.C. van
Browse files

clean and update missing droplet feedback

parent 0677409d
......@@ -22,6 +22,7 @@ end
% go
[~, nframe] = DMA_tifread(fullfile(param.dir, imname), 1, param);
lost = [0 0];
for t = 1:nframe/param.nchan
% is het nog ver, Grote Smurf?
......@@ -68,11 +69,11 @@ for t = 1:nframe/param.nchan
% find matching (closest) droplets
for n = 1:size(BF, 1)
idx = find(D(n, :) == min(D(n, :)));
if ~isempty(idx)
% check distance
if ~isempty(idx) % check distance
% check for disappearance
if D(n, idx) <= BF(n, 4+5*(t-2))*param.maxmove && ...
isempty( find( BF(n, 4:5:4+5*(t-2)) == 0, 1) ) % check disappearance
isempty( find( BF(n, 4:5:4+5*(t-2)) == 0, 1) )
% add detected droplet
BF(n, 1+5*(t-1)) = idx;
......@@ -80,7 +81,12 @@ for t = 1:nframe/param.nchan
BF(n, 4+5*(t-1)) = R(idx);
BF(n, 5+5*(t-1)) = D(n, idx);
else
fprintf('\t\t\tdroplet %3i disappeared\n', n)
if isempty(intersect(lost(:, 1), n))
% add to lost droplets list
fprintf(['\t\t\tdroplet %3i disappeared', ...
' in frame %i\n'], n, t);
lost(end+1, :) = [n t]; %#ok<AGROW>
end
end
end
end
......@@ -98,5 +104,12 @@ name = fullfile(param.dir, param.odir, strcat(imname(1:end-4), '.bf'));
fprintf('\t* saving droplet data in %s\n', name);
save(name, 'BF', '-ascii');
% save lost droplets data
fid = fopen(fullfile(param.dir, param.odir, ...
strcat(imname(1:end-4), '.bfl')), 'w');
fprintf(fid, '%% id,\tframe lost\n');
fprintf(fid, '%3i,\t%3i\n', lost(2:end, :)');
fclose(fid);
% part of DMAlab: https://gitlab.tue.nl/STEM/DMAlab
end
\ No newline at end of file
......@@ -74,7 +74,7 @@ for t = 1:nframe/param.nchan
% analyse fluorescence
for n = 1:size(BF, 1)
if BF(n, 1+5*(t-1)) > 0
if BF(n, 1+5*(t-1)) > 0 % check for droplet existence
% get mask
mask = DMA_dropletmask(x, y, BF(n, 2+5*(t-1):4+5*(t-1)) );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment