Skip to content

Comments

post-hoc soma detection#17

Merged
huangziwei merged 4 commits intomainfrom
post
Jul 18, 2025
Merged

post-hoc soma detection#17
huangziwei merged 4 commits intomainfrom
post

Conversation

@huangziwei
Copy link
Collaborator

@huangziwei huangziwei commented Jul 18, 2025

The default parameters in sk.skeletonize() are optimized for bigger cells (SACs, GCs), so they might not always be optimal for smaller ones (such as BCs). Most often, the soma detection fails because the potential soma node radii is not significantly larger than the neurites (we set the percentile (soma_radius_percentile_threshold) to 99.9, which is quite extreme, but works very well for large cells):

wrong_soma

in this case, we might want to just re-estimate the soma instead of rerunning skeletonize() again.

skel_new_soma = skel.detect_soma(
                    soma_radius_percentile_threshold=99,
                    soma_radius_distance_factor=2,
                )
# skel_new_soma.prune(num_nodes=2) # by default we already prune the 1-node twigs but there might still be other longer artifact twigs, so prune it as you please
redetect_soma

@huangziwei huangziwei merged commit 2f19045 into main Jul 18, 2025
4 checks passed
@huangziwei huangziwei changed the title [wip] post-hoc soma detection post-hoc soma detection Jul 18, 2025
@huangziwei huangziwei deleted the post branch July 21, 2025 14:49
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