From 2337c0bca567f1c8b7e780cf6cec06f4b138f449 Mon Sep 17 00:00:00 2001 From: kfrasier Date: Wed, 10 Mar 2021 17:18:43 -0800 Subject: [PATCH] Fix for mistakes that introduce 0 into zID col 2 This should fix an issue where sometimes the wrong key is hit, and zeros get introduced into zID in the second column, and that breaks the color indexing. This will only fix it the next time the user starts detEdit. --- detEdit.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/detEdit.m b/detEdit.m index 8d9d14b..8de47cc 100644 --- a/detEdit.m +++ b/detEdit.m @@ -176,6 +176,10 @@ function detEdit(userFunc) % whatever was in mySpID before. p.mySpID = labels; end +if sum(zID(:,2)==0)>0 + disp('WARNING: Found zeros in ID labels, removing bad rows.') + zID(zID(:,2)==0,:) = []; +end save(fNameList.ID,'zID'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%