Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LEVER
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
LEVER
Commits
ecd821fa
Commit
ecd821fa
authored
Aug 9, 2012
by
Mark Winter
Browse files
Options
Downloads
Patches
Plain Diff
Tree inference fixes, relink back once before the inference loop.
parent
6a4bfbad
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/MATLAB/+Families/LinkTrees.m
+48
-1
48 additions, 1 deletion
src/MATLAB/+Families/LinkTrees.m
src/MATLAB/+Families/LinkTreesForward.m
+0
-30
0 additions, 30 deletions
src/MATLAB/+Families/LinkTreesForward.m
with
48 additions
and
31 deletions
src/MATLAB/+Families/LinkTrees.m
+
48
−
1
View file @
ecd821fa
function
[
iterations
totalTime
]
=
LinkTrees
(
families
)
global
CellFamilies
global
CellFamilies
CellTracks
iterations
=
0
;
rootTrackIDs
=
[
CellFamilies
(
families
)
.
rootTrackID
];
% Use changelabel to try and extend tracks back to first frame
newRootTracks
=
[];
backTracks
=
rootTrackIDs
([
CellTracks
(
rootTrackIDs
)
.
startTime
]
~=
1
);
for
i
=
1
:
length
(
backTracks
)
newRootTracks
=
[
newRootTracks
linkTreeBack
(
backTracks
(
i
))];
end
rootTrackIDs
=
unique
(
getRootTracks
(
union
(
rootTrackIDs
,
newRootTracks
)));
% Try to Push/reseg
totalTime
=
0
;
maxPushCount
=
10
;
...
...
@@ -22,3 +31,41 @@ function [iterations totalTime] = LinkTrees(families)
% LogAction('Completed Tree Inference', [i totalTime],[]);
end
function
newroot
=
linkTreeBack
(
rootTrack
)
global
CellTracks
costMatrix
=
Tracker
.
GetCostMatrix
();
curTrack
=
rootTrack
;
while
(
CellTracks
(
curTrack
)
.
startTime
>
1
)
curHull
=
CellTracks
(
curTrack
)
.
hulls
(
1
);
prevHulls
=
find
(
costMatrix
(:,
curHull
)
>
0
);
if
(
isempty
(
prevHulls
)
)
break
;
end
[
bestCost
bestIdx
]
=
min
(
costMatrix
(
prevHulls
,
curHull
));
prevTrack
=
Hulls
.
GetTrackID
(
prevHulls
(
bestIdx
));
Tracks
.
ChangeLabel
(
curTrack
,
prevTrack
);
curTrack
=
getRootTracks
(
prevTrack
);
end
newroot
=
curTrack
;
end
function
rootTracks
=
getRootTracks
(
tracks
)
global
CellTracks
CellFamilies
rootTracks
=
[];
for
i
=
1
:
length
(
tracks
)
if
(
isempty
(
CellTracks
(
tracks
(
i
))
.
startTime
)
)
continue
;
end
familyID
=
CellTracks
(
tracks
(
i
))
.
familyID
;
rootTracks
=
[
rootTracks
CellFamilies
(
familyID
)
.
rootTrackID
];
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/MATLAB/+Families/LinkTreesForward.m
+
0
−
30
View file @
ecd821fa
...
...
@@ -13,14 +13,6 @@ function [assignedExtensions findTime extTime] = LinkTreesForward(rootTracks)
costMatrix
=
Tracker
.
GetCostMatrix
();
mexDijkstra
(
'initGraph'
,
costMatrix
);
% Use changelabel to try and extend tracks back to first frame
backTracks
=
rootTracks
([
CellTracks
(
rootTracks
)
.
startTime
]
~=
1
);
for
i
=
1
:
length
(
backTracks
)
linkTreeBack
(
backTracks
(
i
));
end
rootTracks
=
unique
(
getRootTracks
(
rootTracks
));
leafHulls
=
getLeafHulls
(
rootTracks
);
tStart
=
CellHulls
(
leafHulls
(
1
))
.
time
;
tEnd
=
length
(
HashedCells
);
...
...
@@ -129,28 +121,6 @@ function [assignedExtensions findTime extTime] = LinkTreesForward(rootTracks)
extTime
=
toc
(
chkExtendTime
);
end
function
linkTreeBack
(
rootTrack
)
global
CellTracks
costMatrix
=
Tracker
.
GetCostMatrix
();
curTrack
=
rootTrack
;
while
(
CellTracks
(
curTrack
)
.
startTime
>
1
)
curHull
=
CellTracks
(
curTrack
)
.
hulls
(
1
);
prevHulls
=
find
(
costMatrix
(:,
curHull
)
>
0
);
if
(
isempty
(
prevHulls
)
)
break
;
end
[
bestCost
bestIdx
]
=
min
(
costMatrix
(
prevHulls
,
curHull
));
prevTrack
=
Hulls
.
GetTrackID
(
prevHulls
(
bestIdx
));
Tracks
.
ChangeLabel
(
curTrack
,
prevTrack
);
curTrack
=
getRootTracks
(
prevTrack
);
end
end
function
cost
=
calcTrackCost
(
costMatrix
,
startHull
,
endHull
,
maxFrameExt
)
global
CellHulls
CellTracks
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment