Commit 0677409d authored by Turnhout, M.C. van's avatar Turnhout, M.C. van
Browse files

add droplets checks to tracedroplet

parent 9a1a2d9a
......@@ -144,7 +144,7 @@ save(strcat(name,'.obA'), 'obA', '-ascii');
% save results to file with friendlier format?
DMA_writecsv(fullfile(param.dir, imname), ncel, param);
fprintf('\t* analysing events for %s\n', fullfile(param.dir, imname));
% analyse events
dcel = DMA_analyseevents(imname, param);
% close screen output
......
......@@ -27,7 +27,7 @@ end
name = fullfile(param.dir, param.odir, imname(1:end-4));
BF = load(strcat(name, '.bf'));
fluod = load(strcat(name, '.fluo'));
ncel = load(strcat(name, '.ncel'));
if drop == 0, drop = 1:size(BF, 1); end
% get image (information)
......@@ -65,42 +65,52 @@ for cdrop = drop % loop over droplets
hold on
end
% add droplet circle for current time frame to BF image
figure(f)
viscircles(BF(cdrop, 2+5*(t-1):3+5*(t-1)), ...
BF(cdrop, 4+5*(t-1)), 'EdgeColor', cmap(t, :), ...
'LineWidth', 1/2);
% get mask
mask = DMA_dropletmask(x, y, BF(cdrop, 2+5*(t-1):4+5*(t-1)) );
% loop over fluorescence channels
for c = 1:numel(param.fluo)
if BF(cdrop, 1+5*(t-1)) > 0 % check if droplet still exists
% read fluorescence image
F = DMA_tifread(fullfile(param.dir, imname), ...
param.fluo(c) + (t-1)*param.nchan, param);
% add droplet circle for current time frame to BF image
figure(f)
viscircles(BF(cdrop, 2+5*(t-1):3+5*(t-1)), ...
BF(cdrop, 4+5*(t-1)), 'EdgeColor', cmap(t, :), ...
'LineWidth', 1/2);
% perform fluorescence analysis
[raw, A, BW, cs] = DMA_preprocessfluo(F, mask, c, param);
if param.cellminIraw > 0
[~, ~, bwg] = DMA_countfluo(raw, BW, c, param);
else
[~, ~, bwg] = DMA_countfluo(A, BW, c, param);
% get mask
mask = DMA_dropletmask(x, y, BF(cdrop, 2+5*(t-1):4+5*(t-1)) );
% loop over fluorescence channels
for c = 1:numel(param.fluo)
% read fluorescence image
F = DMA_tifread(fullfile(param.dir, imname), ...
param.fluo(c) + (t-1)*param.nchan, param);
% perform fluorescence analysis
[raw, A, BW, cs] = DMA_preprocessfluo(F, mask, c, param);
if param.cellminIraw > 0
[~, ~, bwg] = DMA_countfluo(raw, BW, c, param);
else
[~, ~, bwg] = DMA_countfluo(A, BW, c, param);
end
% put results in overview
fluo(1:size(raw, 1), ...
1+(t-1)*s:(t-1)*s+size(raw, 2), c) = raw;
fluo(s+1:s+size(A, 1), ...
1+(t-1)*s:(t-1)*s+size(A, 2), c) = cs;
fluo(2*s+1:2*s+size(BW, 1), ...
1+(t-1)*s:(t-1)*s+size(BW, 2), c) = A;
fluo(3*s+1:3*s+size(bwg, 1), ...
1+(t-1)*s:(t-1)*s+size(bwg, 2), c) = BW;
fluo(4*s+1:4*s+size(bwg, 1), ...
1+(t-1)*s:(t-1)*s+size(bwg, 2), c) = bwg;
end
% put results in overview
fluo(1:size(raw, 1), ...
1+(t-1)*s:(t-1)*s+size(raw, 2), c) = raw;
fluo(s+1:s+size(A, 1), ...
1+(t-1)*s:(t-1)*s+size(A, 2), c) = cs;
fluo(2*s+1:2*s+size(BW, 1), ...
1+(t-1)*s:(t-1)*s+size(BW, 2), c) = A;
fluo(3*s+1:3*s+size(bwg, 1), ...
1+(t-1)*s:(t-1)*s+size(bwg, 2), c) = BW;
fluo(4*s+1:4*s+size(bwg, 1), ...
1+(t-1)*s:(t-1)*s+size(bwg, 2), c) = bwg;
else
fprintf('- droplet %3i disappeared in frame %i\n', cdrop, t);
% droplet disappeared
fluo(:, 1+(t-1)*s:end) = 0;
break
end
end
% fluorescence channel overview images
......
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