Skip to content

instance segmentation pipeline - graph post processing#69

Open
stmartineau99 wants to merge 4 commits into
computational-cell-analytics:mainfrom
stmartineau99:skeleton-postprocessing
Open

instance segmentation pipeline - graph post processing#69
stmartineau99 wants to merge 4 commits into
computational-cell-analytics:mainfrom
stmartineau99:skeleton-postprocessing

Conversation

@stmartineau99

Copy link
Copy Markdown

graph postprocessing (postprocessing.py)

  • draw_instances function - rasterize the instances or skeleton graph for easy viewing in napari
  • clean_graph has 4 steps
  1. remove_ticks reimplemented function from kimimaro, prune ticks (spurs) below a certain tick_length
  2. split 3 degree junctions - separate the odd arm when it diverges from the through pair by at least min_branch_angle.
  3. split 4 degree junctions, separating its two through pairs when they are collinear to within min_through_angle.
  4. join close components at their endpoints - inspired by similar postporocessing approach in TARDIS library, search all endpoints for nearby endpoints that can be joined if they are within the join_dist and if they are sufficiently colinear, as determined by min_join_angle

tests/skeleton/test_postprocessing.py

  • tests all stages of clean_graph

examples/skeleton/instance_segmentation.py

  • script with CLI for the whole pipeline
    • starting from a binary mask, run teasar to get the skeleton, then convert to a graph and postprocess with clean_graph
    • convert to labels with connected_components - input to draw_instances
    • option to --view, open teasar skeleton and instances
  • importantly, increase direction_span to get better tangent measurements, I found this helps best at around 8-10 to minimize aliasing artifacts

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