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
19d4e7f7
Commit
19d4e7f7
authored
Oct 1, 2012
by
Walt Mankowski
Browse files
Options
Downloads
Patches
Plain Diff
In DrawTree, always draw the taller subtree to the left
parent
3887518f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/MATLAB/+UI/DrawTree.m
+37
-4
37 additions, 4 deletions
src/MATLAB/+UI/DrawTree.m
with
37 additions
and
4 deletions
src/MATLAB/+UI/DrawTree.m
+
37
−
4
View file @
19d4e7f7
...
...
@@ -68,7 +68,11 @@ set(overAxes,...
hold
on
[
xMin
xCenter
xMax
phenoScratch
]
=
traverseTree
(
trackID
,
0
,
phenoScratch
);
% build a map with the heights for each node in the tree rooted at trackID
trackHeights
=
containers
.
Map
(
'KeyType'
,
'uint32'
,
'ValueType'
,
'uint32'
);
computeTrackHeights
(
trackID
,
trackHeights
);
[
xMin
xCenter
xMax
phenoScratch
]
=
traverseTree
(
trackID
,
0
,
phenoScratch
,
trackHeights
);
set
(
overAxes
,
...
'XLim'
,
[
xMin
-
1
xMax
+
1
]);
...
...
@@ -113,12 +117,23 @@ set(Figures.tree.handle,'Pointer','arrow');
set
(
Figures
.
cells
.
handle
,
'Pointer'
,
'arrow'
);
end
function
[
xMin
xCenter
xMax
phenoScratch
labelHandles
]
=
traverseTree
(
trackID
,
initXmin
,
phenoScratch
)
function
[
xMin
xCenter
xMax
phenoScratch
labelHandles
]
=
traverseTree
(
trackID
,
initXmin
,
phenoScratch
,
trackHeights
)
global
CellTracks
if
(
~
isempty
(
CellTracks
(
trackID
)
.
childrenTracks
))
[
child1Xmin
child1Xcenter
child1Xmax
phenoScratch
child1Handles
]
=
traverseTree
(
CellTracks
(
trackID
)
.
childrenTracks
(
1
),
initXmin
,
phenoScratch
);
[
child2Xmin
child2Xcenter
child2Xmax
phenoScratch
child2Handles
]
=
traverseTree
(
CellTracks
(
trackID
)
.
childrenTracks
(
2
),
child1Xmax
+
1
,
phenoScratch
);
% the taller subtree should go on the left
ID1
=
CellTracks
(
trackID
)
.
childrenTracks
(
1
);
ID2
=
CellTracks
(
trackID
)
.
childrenTracks
(
2
);
if
(
trackHeights
(
ID1
)
>=
trackHeights
(
ID2
))
left
=
ID1
;
right
=
ID2
;
else
left
=
ID2
;
right
=
ID1
;
end
[
child1Xmin
child1Xcenter
child1Xmax
phenoScratch
child1Handles
]
=
traverseTree
(
left
,
initXmin
,
phenoScratch
,
trackHeights
);
[
child2Xmin
child2Xcenter
child2Xmax
phenoScratch
child2Handles
]
=
traverseTree
(
right
,
child1Xmax
+
1
,
phenoScratch
,
trackHeights
);
xMin
=
min
(
child1Xmin
,
child2Xmin
);
xMax
=
max
(
child1Xmax
,
child2Xmax
);
...
...
@@ -151,6 +166,24 @@ else
end
end
% WCM - 10/1/2012 - Created
% This function does a breadth-first search starting from trackID and
% computes the height of each node in the tree. These are stored in the map
% trackHeights.
function
height
=
computeTrackHeights
(
trackID
,
trackHeights
)
global
CellTracks
if
(
~
isempty
(
CellTracks
(
trackID
)
.
childrenTracks
))
% root node
leftHeight
=
computeTrackHeights
(
CellTracks
(
trackID
)
.
childrenTracks
(
1
),
trackHeights
);
rightHeight
=
computeTrackHeights
(
CellTracks
(
trackID
)
.
childrenTracks
(
2
),
trackHeights
);
height
=
1
+
max
(
leftHeight
,
rightHeight
);
else
% leaf node
height
=
1
;
end
trackHeights
(
trackID
)
=
height
;
end
% NLS - 6/8/2012 - Created
function
mitosisHandleDown
(
src
,
evt
)
global
Figures
mitosisMotionListener
mitosisMouseUpListener
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