Skip to content

Commit 406eef7

Browse files
committed
Fix bug to correctly calculate the lenght of branches in all cases.
Bug reported by Jorge Valero.
1 parent 3e0c370 commit 406eef7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/java/sc/fiji/analyzeSkeleton/AnalyzeSkeleton_.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,10 +1709,6 @@ private void visitSkeleton(ImageStack taggedImage, ImageStack treeImage, int cur
17091709
double color = properties[2];
17101710
double length_ra = properties[3];
17111711

1712-
1713-
// Increase total length of branches
1714-
branchLength += length;
1715-
17161712
// Increase number of branches
17171713
if(length != 0)
17181714
{
@@ -1768,6 +1764,14 @@ private void visitSkeleton(ImageStack taggedImage, ImageStack treeImage, int cur
17681764
if(debug)
17691765
IJ.log("adding branch from " + initialVertex.getPoints().get(0) + " to " + this.auxFinalVertex.getPoints().get(0));
17701766
this.graph[iTree].addEdge(new Edge(initialVertex, this.auxFinalVertex, this.slabList, length, color3rd, color, length_ra));
1767+
// Increase total length of branches
1768+
branchLength += length;
1769+
1770+
// update maximum branch length
1771+
if(length > this.maximumBranchLength[iTree])
1772+
{
1773+
this.maximumBranchLength[iTree] = length;
1774+
}
17711775
}
17721776
}
17731777
else

0 commit comments

Comments
 (0)