From d40f2c59d9a275e17ae0d56ffc0980ad8464866d Mon Sep 17 00:00:00 2001 From: Paul Wiggins Date: Tue, 14 Aug 2018 10:54:50 -0700 Subject: [PATCH] added code into frameLink/errorRez.m to revent cells from being created with ID == 0. This shouldnt happen but I added an extra backup mechanism to prevent this from occuring. --- frameLink/errorRez.m | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/frameLink/errorRez.m b/frameLink/errorRez.m index 4c493a6..768eb96 100644 --- a/frameLink/errorRez.m +++ b/frameLink/errorRez.m @@ -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 @@ -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); @@ -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)) @@ -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