Repository navigation
Port task_ist_preprocessing segmentation methods to spatial proteomics - #4
Open
danielStrobl wants to merge 2 commits into
Open
danielStrobl wants to merge 2 commits into
danielStrobl wants to merge 2 commits into
Conversation
Add five segmentation components adapted from openproblems-bio/task_ist_preprocessing, rewritten to this task's .npy contract (gapless int32 labels plus a metadata JSON): - cellpose_segmentation (Cellpose 3: cyto, cyto2, cyto3, nuclei) - cellposev4_segmentation (Cellpose-SAM / cpsam) - stardist_segmentation (2D_versatile_fluo, IST big-image strategy) - watershed_txsim_segmentation (txsim segment_watershed, inlined) - binning_segmentation (txsim segment_binning, inlined) custom_segmentation is not ported; reference_segmentation covers it. Channels are selected by marker name (--input_markers with --nuclear_markers / --membrane_markers) instead of IST's hard-coded image[0], with --nuclei_channel as the fallback. Both Cellpose components run in two-channel [membrane, nuclear] mode when membrane markers are given; the Cellpose nuclei model ignores them. The txsim watershed is inlined so the component needs no txsim, squidpy or rasterio. Integer-valued images take txsim's exact code path; masks were pixel-identical to txsim on 36 synthetic image/option combinations. The segmentation API now holds only shared arguments; the threshold and watershed arguments moved into basic_threshold_segmentation and watershed_expand_segmentation, whose outputs are unchanged. The remove_small_* calls go through a scikit-image-version-agnostic helper. run_benchmark runs all seven image-derived segmenters by default, forwards the marker sidecar, and gains --segmentation_nuclear_markers and --membrane_markers. GPU directive labels match IST. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
viash 0.9.7 rejects single quotes in a python setup '.script' field, which made 'viash ns list' fail on stardist_segmentation and stopped CI before any component test ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Add five segmentation components adapted from
openproblems-bio/task_ist_preprocessing, rewritten to this task's .npy contract (gapless int32 labels plus a metadata JSON):
custom_segmentation is not ported; reference_segmentation covers it.
Channels are selected by marker name (--input_markers with --nuclear_markers / --membrane_markers) instead of IST's hard-coded image[0], with --nuclei_channel as the fallback. Both Cellpose components run in two-channel [membrane, nuclear] mode when membrane markers are given; the Cellpose nuclei model ignores them.
The txsim watershed is inlined so the component needs no txsim, squidpy or rasterio. Integer-valued images take txsim's exact code path; masks were pixel-identical to txsim on 36 synthetic image/option combinations.
The segmentation API now holds only shared arguments; the threshold and watershed arguments moved into basic_threshold_segmentation and watershed_expand_segmentation, whose outputs are unchanged. The remove_small_* calls go through a scikit-image-version-agnostic helper.
run_benchmark runs all seven image-derived segmenters by default, forwards the marker sidecar, and gains --segmentation_nuclear_markers and --membrane_markers. GPU directive labels match IST.
Describe your changes
Checklist before requesting a review
I have performed a self-review of my code
Check the correct box. Does this PR contain:
Proposed changes are described in the CHANGELOG.md
CI Tests succeed and look good!