Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Palmer
VTK
Commits
68e444d3
Commit
68e444d3
authored
11 years ago
by
Xiaoxiao Liu
Committed by
Code Review
11 years ago
Browse files
Options
Downloads
Plain Diff
Merge topic 'fix_RCalc' into master
5bd3962d
fix bug in vtkRAdapter::VTKTreeToR(vtkTree* tree)
parents
2c597d38
5bd3962d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Filters/StatisticsGnuR/vtkRAdapter.cxx
+5
-8
5 additions, 8 deletions
Filters/StatisticsGnuR/vtkRAdapter.cxx
with
5 additions
and
8 deletions
Filters/StatisticsGnuR/vtkRAdapter.cxx
+
5
−
8
View file @
68e444d3
...
...
@@ -485,7 +485,7 @@ SEXP vtkRAdapter::VTKTreeToR(vtkTree* tree)
// traverse the tree to reorder the leaf vertices according to the
// phylo tree numbering rule;
// newNodeId is the checkup table that maps a vertexId(starting from 0)
// to it
'
s corresponding R tree point id (staring from 1)
// to its corresponding R tree point id (star
t
ing from 1)
vtkIdType
leafCount
=
0
;
vtkTreeDFSIterator
*
iter
=
vtkTreeDFSIterator
::
New
();
iter
->
SetTree
(
tree
);
...
...
@@ -494,7 +494,7 @@ SEXP vtkRAdapter::VTKTreeToR(vtkTree* tree)
while
(
iter
->
HasNext
())
{
// find out all the leaf nodes, and number them sequentially
vtkIdType
vertexId
=
iter
->
Next
();
newNodeId
[
vertexId
]
=
0
;
//initilize
newNodeId
[
vertexId
]
=
0
;
//initi
a
lize
if
(
tree
->
IsLeaf
(
vertexId
))
{
leafCount
++
;
...
...
@@ -505,7 +505,7 @@ SEXP vtkRAdapter::VTKTreeToR(vtkTree* tree)
// second tree traverse to reorder the node vertices
int
nodeId
=
leafCount
;
iter
->
Restart
();
vtkIdType
vertexId
=
iter
->
Next
();
//skip the root (which id is zero)
vtkIdType
vertexId
;
while
(
iter
->
HasNext
())
{
vertexId
=
iter
->
Next
();
...
...
@@ -516,7 +516,7 @@ SEXP vtkRAdapter::VTKTreeToR(vtkTree* tree)
}
}
nedge
=
tree
->
GetNumberOfEdges
()
-
1
;
// the first edge 0-1 does not count in R tree
nedge
=
tree
->
GetNumberOfEdges
()
;
ntip
=
leafCount
;
nnode
=
nedge
-
ntip
+
1
;
...
...
@@ -534,7 +534,7 @@ SEXP vtkRAdapter::VTKTreeToR(vtkTree* tree)
// fill in e and e_len
vtkSmartPointer
<
vtkEdgeListIterator
>
edgeIterator
=
vtkSmartPointer
<
vtkEdgeListIterator
>::
New
();
tree
->
GetEdges
(
edgeIterator
);
vtkEdgeType
vEdge
=
edgeIterator
->
Next
();
//skip the first empty edge (0,1) with weight 0
vtkEdgeType
vEdge
;
int
i
=
0
;
vtkDoubleArray
*
weights
=
vtkDoubleArray
::
SafeDownCast
((
tree
->
GetEdgeData
())
->
GetArray
(
"weight"
));
while
(
edgeIterator
->
HasNext
())
...
...
@@ -552,7 +552,6 @@ SEXP vtkRAdapter::VTKTreeToR(vtkTree* tree)
// use GetAbstractArray() instead of GetArray()
vtkStringArray
*
labels
=
vtkStringArray
::
SafeDownCast
((
tree
->
GetVertexData
())
->
GetAbstractArray
(
"node name"
));
iter
->
Restart
();
vertexId
=
iter
->
Next
();
//skip the root
while
(
iter
->
HasNext
())
{
// find out all the leaf nodes, and number them sequentially
vertexId
=
iter
->
Next
();
...
...
@@ -760,8 +759,6 @@ vtkTree* vtkRAdapter::RToVTKTree(SEXP variable)
return
NULL
;
}
// Create the "node weight" array for the Vertices, in order to use
// vtkTreeLayoutStrategy for visualizing the tree using vtkTreeHeatmapItem
vtkNew
<
vtkDoubleArray
>
nodeWeights
;
...
...
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