Skip to content

Avoid tunnels from the mitochondria closing ("holding hands") - #191

Merged
constantinpape merged 2 commits into
mainfrom
fix-mito-closing-tunnels
Nov 5, 2026
Merged

constantinpape merged 2 commits into
mainfrom
fix-mito-closing-tunnels

Conversation

@lufre1

@lufre1 lufre1 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

The closing in _postprocess_seg_3d (3D cross x 4, then 3x3 in-plane x 8) joins parts of a mitochondrion that only come close, e.g. the two ends of a curled one, and gives the object a tunnel. For mitochondria, use a weaker closing (x 2, x 3), fill the holes per slice along z, y and x (into background only), and remove the added components that touch the object in two or more places and give it a tunnel.

The defaults of _postprocess_seg_3d are unchanged, so the compartment segmentation is not affected.

The closing in _postprocess_seg_3d (3D cross x 4, then 3x3 in-plane x 8) joins
parts of a mitochondrion that only come close, e.g. the two ends of a curled
one, and gives the object a tunnel. For mitochondria, use a weaker closing
(x 2, x 3), fill the holes per slice along z, y and x (into background only),
and remove the added components that touch the object in two or more places
and give it a tunnel.

The defaults of _postprocess_seg_3d are unchanged, so the compartment
segmentation is not affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lufre1

lufre1 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author
panel_2 where it works nicely (above) and where it is worse (below) - but this is only happens at the z-dim ends of mitochondria where you see them crumble (also because the models prediction is low in these z-dim tiles) panel_1

@lufre1
lufre1 marked this pull request as ready for review November 2, 2026 14:28
@lufre1
lufre1 requested a review from constantinpape November 2, 2026 14:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lufre1

lufre1 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

any objections on merging this into main?
@constantinpape

@constantinpape constantinpape left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@constantinpape
constantinpape merged commit 398e36a into main Nov 5, 2026
3 checks passed
@constantinpape
constantinpape deleted the fix-mito-closing-tunnels branch November 5, 2026 09:14
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.

2 participants