Skip to content

Commit

Permalink
added code into frameLink/errorRez.m to revent cells from being creat…
Browse files Browse the repository at this point in the history
…ed with ID == 0. This shouldnt happen but I added an extra backup mechanism to prevent this from occuring.
  • Loading branch information
Paul Wiggins committed Aug 14, 2018
1 parent 608e767 commit d40f2c5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions frameLink/errorRez.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
modRegions = [];

for regNum = 1 : data_c.regs.num_regs

% if regNum == 37;
% 'hi'
% end

if isfield (data_c.regs, 'manual_link')
manual_link = data_c.regs.manual_link.r(regNum);
else
Expand Down Expand Up @@ -301,8 +306,13 @@
end

end

end

% if the current ID is still zero, make a new cell
if data_c.regs.ID(regNum) == 0
[data_c,cell_count] = createNewCell (data_c, regNum, time, cell_count);
end

end
%intDisplay (data_c,regToDelete,data_f,[]);
[data_c] = deleteRegions( data_c,regToDelete);
Expand All @@ -318,6 +328,7 @@ function intDisplay (data_c,regC,data_f,regF)
% blue : all cell masks in c



maskC = data_c.regs.regs_label*0;
for c = 1 : numel(regC)
if ~isnan(regC(c))
Expand All @@ -336,7 +347,8 @@ function intDisplay (data_c,regC,data_f,regF)
maskF = maskF + (data_f.regs.regs_label == regF(f))>0;
end
end
imshow (cat(3,ag(maskF),ag(maskC),ag(data_c.mask_cell)));
imshow (cat(3,ag(maskF),ag(maskC),ag(data_c.mask_cell)));

end
end
end
Expand Down

0 comments on commit d40f2c5

Please sign in to comment.