Commit 5971eac6 authored by Andrew Cohen's avatar Andrew Cohen

tracker -- respect patches and mitosis on resetTrackID, patch exclude manual...

tracker -- respect patches and mitosis on resetTrackID, patch exclude manual edits from patch candidates
parent fe63cc2c
......@@ -189,7 +189,7 @@ double getHullDistance(int hull1, int hull2)
} //getHullDistance
// we have a track connection in tblManualEdits. Write that back to the db right meow.
int OverRideTrackID(Hull *pNewHull, int cellID_parent,int cellID_child1,int cellID_child2)
int OverRideTrackID(Hull *pNewHull, int cellID_parent)
{
int rc;
......@@ -262,9 +262,9 @@ static int getCellsCallback(void *pvnull, int argc, char **argv, char **azColNam
newHull.setParent(nParent);
newHull.setOverride(nChild2);
// if not mitotic, and there's a track override, set the override
if (nParent>=0) {
if (nParent>=0 && -1==nChild2) {
// else if there's a manual edit, we set its trackID to the overrideID
OverRideTrackID(&newHull, nParent,nChild1, nChild2);
OverRideTrackID(&newHull, nParent);
}
newHull.init_trackID(trackID);
......@@ -334,7 +334,7 @@ int ResetTrackIDs(int time)
// add
time = time + 1; // db time is 1 based, matdb time is 0 based. add 1 here.
sprintf(gszSqlCmd, "Update tblCells set trackID = cellID where time= %d and cellID not in "
" (select cellID_child1 from tblFamilies where cellID_child2=null)", time);
" (select cellID_child1 from tblFamilies where cellID_child2 is null)", time);
rc = dbExec(gszSqlCmd, NULL, NULL, "ResetTrackIDs");
return rc;
......
......@@ -4,17 +4,17 @@ function resegPatch(conn,tReseg,CONSTANTS)
% first, undo any patches that originate in frame tReseg-1 or tReseg-2
cmd=['delete from tblFamilies where rowid in (select tblFamilies.rowid from tblCells '...
' inner join tblFamilies on cellID_parent=cellID where cellID_child2 IS NULL and time='...
' inner join tblFamilies on cellID_parent=cellID where cellID_child2 IS NULL and (time='...
num2str(tReseg-1) ' or time=' num2str(tReseg-2) ...
' and cellID_parent not in (select cellID_src from tblManualEdits))'];
') and cellID_parent not in (select cellID_src from tblManualEdits))'];
exec(conn,cmd);
% object A at time t has first choice object B at t+1.
% Object B is untracked. Object B's second choice is A. then patch A->B
% tracks that end in the previous frame
cmd=['select * from (select max(time) as t1,cellID,trackID from tblCells group by trackID) where t1='...
cmd=['select * from (select max(time) as t1,cellID,trackID from tblCells group by trackID) where (t1='...
num2str(tReseg-1) ' or t1=' num2str(tReseg-2)...
' and cellID not in (select cellID_src from tblManualEdits)'];
') and cellID not in (select cellID_src from tblManualEdits)'];
q=fetch(conn,cmd);
if isempty(q)
return
......@@ -95,6 +95,10 @@ cidDst=q{2};
cmd=['select time,trackID from tblCells where cellID=' num2str(cidDst)];
q=fetch(conn,cmd);
if isempty(q)
cidDst=[];
return;
end
time=q{1};
tidDst=q{2};
......
No preview for this file type
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