Conversation
…r, LinAlgUtils, StrahlerAnalyzer, and PathStatistics Agent-Logs-Url: https://github.com/morphonets/SNT/sessions/2f9534b0-79d5-45c3-b9b7-1922e6e743f4 Co-authored-by: tferr <2439948+tferr@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
tferr
April 7, 2026 20:57
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 6 new test files targeting areas of the codebase with no existing tests. Before this PR there were 20 test files covering 369 source files (~5.4% test-to-source ratio); this PR adds 6 new test classes with ~200 individual test cases.
New Test Files
sc.fiji.snt.util.PointInImageTestCovers the core geometric point class:
isReal()for NaN/Infinite coordinate detectionisSameLocation()comparisonscale()coordinate transformationgetCoordinateOnAxis()with valid/invalid axis valuesequals(),hashCode(),clone()contractsc.fiji.snt.util.BoundingBoxTestCovers the bounding box utility:
compute(),append(),combine(),intersection()contains(BoundingBox),contains(SNTPoint),contains2D(SNTPoint)getDimensions(),getDiagonal(),getCentroid()scale(),shift()spatial transformationsisScaled(),hasDimensions(),setDimensions()(including error case)sanitizedUnit()for various string inputs (null, "pixels", "um", "micron", custom)equals(),hashCode(),clone()sc.fiji.snt.util.SNTColorTestCovers the color utility class:
colorToString()for null, AWT Color, and ColorRGB inputsfromHex()for 6-digit, 8-digit, hash-prefixed, and named color stringsfromString()consistency withfromHex()average()for empty, single, two-color, and null-containing collectionsinterpolateNullEntries()for middle nulls, null array, and all-null casesalphaColor()for 0%, 50%, 100% and null inputcontrastColor()for dark and light inputsgetDistinctColors(),getDistinctColorsHex(),getDistinctColorsAWT()with various counts and excluded huessc.fiji.snt.util.LinAlgUtilsTestCovers the linear algebra utility:
sc.fiji.snt.analysis.StrahlerAnalyzerTestCovers Horton-Strahler analysis on the demo fractal tree:
getRootNumber()correctness and consistency withTreeStatistics.getStrahlerNumber()getHighestBranchOrder()boundsgetBranchCounts(),getLengths(),getBranchPointCounts()map structure and value validitygetBifurcationRatios()— NaN for highest order, positive for lower orders, avg = 2 for fractal treegetBranches()for all valid orders;IllegalArgumentExceptionfor out-of-range ordersgetAvgFragmentations(),getAvgContractions(),getGraph(),getRootAssociatedBranches()sc.fiji.snt.analysis.PathStatisticsTestCovers path-level morphometric analysis:
getNBranches(),getBranches()countgetMetric(String)for Path ID (single vs. multi path)getMetric(String, Path)for length, node count, and children countgetPrimaryBranches(),getTerminalBranches(),getInnerBranches()getPrimaryLength(),getTerminalLength(),getInnerLength()getCableLength()consistency with individual path lengths