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

we need to check maxcells rows in analysevenets, but now all dead cells are in...

we need to check maxcells rows in analysevenets, but now all dead cells are in the *second* chanel?!
parent 53cb09d8
......@@ -95,7 +95,7 @@ for t = 1:nframe/param.nchan
% store data
ncel(n, c+numel(param.fluo)*(t-1)) = count(1); % number of detected cells
bgi(n, c+numel(param.fluo)*(t-1)) = count(2); % background intensity
bgi(n, c+numel(param.fluo)*(t-1)) = count(2); % background intensity
if sum(mi(:, 1)) > 0
% mean object / cell intensity
fluo(n, c+numel(param.fluo)*(t-1)) = ...
......
......@@ -51,7 +51,7 @@ for d = 1:numel(dois)
pcel = zeros(param.nchan-1, nframe);
for c = 1:param.nchan-1
% reshape ncel into p(rocessed)cel: nchan by nframe
pcel(c, :) = ncel(dois(d), c:param.nchan-1:end);
pcel(c, :) = ncel(dois(d), c:param.nchan-1:end)
% identify gaps in cell detection
gap = 0;
......@@ -81,16 +81,16 @@ for d = 1:numel(dois)
dcr(end, :) = -max(pcel(end, :));
else
% find dead cell events
ndead = unique(pcel(end, :));
for dc = 1:max(ndead)
% first instance of dead cel
dframe = find(pcel(end, :) == dc, 1, 'first');
for dc = 1:max(pcel(end, :))
% first instance of dead cel
dframe = find(pcel(end, :) == dc, 1, 'first')
% dead cell centre & radius in first detected frame
x = obx(dois(d), dframe*numel(param.fluo));
y = oby(dois(d), dframe*numel(param.fluo));
r = sqrt(obA(dois(d), dframe*numel(param.fluo))/pi);
x = obx((dois(d)-1)*param.maxcells+dc, dframe*numel(param.fluo)) % param.maxcells*size(bf, 1) by nframe*(param.nchan-1)
y = oby((dois(d)-1)*param.maxcells+dc, dframe*numel(param.fluo))
r = sqrt(obA((dois(d)-1)*param.maxcells+dc, dframe*numel(param.fluo))/pi)
% check channels for matching cells
% check channels for matching cells
checkcells;
% did we find 'em?
if cellfound > 0
......@@ -136,19 +136,38 @@ fclose(fid);
function checkcells
cellfound = 0;
for ch = 1:param.nchan-2
% get coordinates
xc = obx(dois(d), ch + (dframe-1)*numel(param.fluo));
yc = oby(dois(d), ch + (dframe-1)*numel(param.fluo));
% check distance to dead cell
if sqrt( (x-xc)^2 + (y-yc)^2 ) <= r
% this is the one!
cellfound = ch;
break
if dframe > 1
for ch = 1:param.nchan-2
ch = ch
% loop over detected cells in this channel
for q = 1:param.maxcells
% get coordinates
xc = obx((dois(d)-1)*param.maxcells+q, ch + (dframe-1)*numel(param.fluo))
yc = oby((dois(d)-1)*param.maxcells+q, ch + (dframe-1)*numel(param.fluo))
if xc > 0
% check distance to dead cell
if sqrt( (x-xc)^2 + (y-yc)^2 ) <= r
% this is the one!
cellfound = ch
break
end
else
% there are no more detected cells
break
end
end
end
end
end
% % dead cell centre & radius in first detected frame
% x = obx(dois(d), dframe*numel(param.fluo));
% y = oby(dois(d), dframe*numel(param.fluo));
% r = sqrt(obA(dois(d), dframe*numel(param.fluo))/pi);
% part of DMAlab: https://gitlab.tue.nl/STEM/DMAlab
end
\ No newline at end of file
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