Skip to content

Rename vessel-specific identifiers, harden radius_stats composition, … - #32

Merged
annmoel merged 1 commit into
mainfrom
fix/api-docs-correctness
Sep 4, 2026
Merged

Rename vessel-specific identifiers, harden radius_stats composition, …#32
annmoel merged 1 commit into
mainfrom
fix/api-docs-correctness

Conversation

@annmoel

@annmoel annmoel commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

…narrow exception handling, fix docs

Rename build_vessel_graph -> build_skeleton_graph and extract_vessel_features -> extract_summary_features: maskel is domain-general (vasculature is one example among fibers/neurites/cells), and "summary" already matches this package's own established terminology everywhere else (extraction.summary, summary_features, summary.csv) - the old name was the inconsistent one. vessel_area/vessel_area_fraction (the actual CSV column names) are left alone here - renaming those is a real schema change, tracked separately alongside the maskel-evaluations notebook rerun that needs to happen anyway.

extract_summary_features's radius_stats composition: replaced the blind **radius_stats unpacking (which silently dropped mean_segment_volume/ mean_surface_area from the returned dict whenever radius_stats didn't already include them) with an explicit per-key default lookup, so the returned schema is always the same 10 keys regardless of what radius_stats supplies. The two-key aggregation itself moves out of pipeline.py's private inline logic into a new public aggregate_segment_stats(branch_data), so a caller composing compute_radii -> extract_summary_features directly has a real way to get the full schema instead of silently getting a smaller one.

junction_cleanup's cycle-detection now narrows its except Exception to (NetworkXException, KeyError, ValueError) and warns instead of silently returning a no-op - a genuine bug there (as opposed to "no cycles found") no longer disappears silently, which matters given this module has thin test coverage.

docs/index.md: corrected "the CLI only writes data, not images" - it does write a PNG skeleton (write_skeleton_png), just never a rendered visualization like the example in this same doc.
docs/glossary.md: vessel_area (and the radius/diameter statistics) are measured against the mask after preprocessing when fill_holes/ closing_iterations is set, not the "original" input as previously stated.

…narrow exception handling, fix docs

Rename build_vessel_graph -> build_skeleton_graph and extract_vessel_features
-> extract_summary_features: maskel is domain-general (vasculature is one
example among fibers/neurites/cells), and "summary" already matches this
package's own established terminology everywhere else (extraction.summary,
summary_features, summary.csv) - the old name was the inconsistent one.
vessel_area/vessel_area_fraction (the actual CSV column names) are left
alone here - renaming those is a real schema change, tracked separately
alongside the maskel-evaluations notebook rerun that needs to happen anyway.

extract_summary_features's radius_stats composition: replaced the blind
`**radius_stats` unpacking (which silently dropped mean_segment_volume/
mean_surface_area from the returned dict whenever radius_stats didn't
already include them) with an explicit per-key default lookup, so the
returned schema is always the same 10 keys regardless of what radius_stats
supplies. The two-key aggregation itself moves out of pipeline.py's private
inline logic into a new public aggregate_segment_stats(branch_data), so a
caller composing compute_radii -> extract_summary_features directly has a
real way to get the full schema instead of silently getting a smaller one.

junction_cleanup's cycle-detection now narrows its except Exception to
(NetworkXException, KeyError, ValueError) and warns instead of silently
returning a no-op - a genuine bug there (as opposed to "no cycles found")
no longer disappears silently, which matters given this module has thin
test coverage.

docs/index.md: corrected "the CLI only writes data, not images" - it does
write a PNG skeleton (write_skeleton_png), just never a rendered
visualization like the example in this same doc.
docs/glossary.md: vessel_area (and the radius/diameter statistics) are
measured against the mask *after* preprocessing when fill_holes/
closing_iterations is set, not the "original" input as previously stated.
@annmoel
annmoel merged commit 6509dff into main Sep 4, 2026
1 check passed
@annmoel
annmoel deleted the fix/api-docs-correctness branch September 4, 2026 11:48
annmoel added a commit that referenced this pull request Sep 4, 2026
Fix test collection broken by merging PRs #32 and #35 together
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant