Rename vessel-specific identifiers, harden radius_stats composition, … - #32
Merged
Conversation
…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.
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.
…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_statsunpacking (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.