Add midplane z-slice to TestCase and thread through runner - #2
Closed
trisha-ant wants to merge 1 commit into
Closed
Conversation
…l kwarg Max-intensity projections collapse depth, so overlapping body segments fuse into one band — the key discriminative feature for fold stages is lost. This is the harness half of the z-slice subagent work: expose a single non-projected XY slice (z=Z//2) so a perception variant can count discrete body-segment profiles at one plane. - testset.py: new _create_slice_image() helper (same crop as the three-view projection); TestCase gains midplane_b64; iter_embryo populates it. Also collapses the duplicated load-volumes-or-not branch into one path. - run.py: introspect perceive_fn signature once and only pass midplane_b64 when the function declares it (or **kwargs), so all existing variants are called unchanged. - program.md: document the new optional kwarg.
This was referenced Apr 17, 2026
trisha-ant
marked this pull request as ready for review
April 23, 2026 15:53
Owner
Author
|
Subsumed into #5 — all commits are in that branch and the retrospective there covers this variant. |
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.
Stacked on #1.
Why
Max-intensity projections collapse depth: overlapping body segments fuse into one bright band, destroying the discriminative feature for fold stages — how many times the body folds back on itself. The fold-stage accuracy gap (1.5fold 55–65%, 2fold 58–77%) is the primary bottleneck. To let a perception variant count discrete body-segment cross-sections at one plane, the harness needs to expose a non-projected z-slice alongside the projection.
This is the harness half of the z-slice subagent work — no perception logic here, just plumbing.
What
benchmark/testset.py_create_slice_image(volume, z=None, max_dim=800)— renders one XY slice (defaults to z=Z//2), uses the same crop as the three-view projection so framing matches, returns base64 JPEG.TestCasegains amidplane_b64field;iter_embryopopulates it.run.py_accepted_optional_kwargs(perceive_fn)introspects the perception function's signature once and passesmidplane_b64only if the function declares it (or**kwargs). All 15 existing variants get an empty extra-kwargs set, so they're called exactly as before — zero churn to existing variants.program.md× 2 — document the optional kwarg.4 files, +69 / −9.
Verification
_create_slice_imageproduces valid JPEG (ffd8ff); default is byte-identical toz=Z//2; negative/over-range z clamps to boundaries; Z=1 volumes and the resize-to-800px path handled._accepted_optional_kwargs(...) == set()(no breakage).iter_embryopopulatesmidplane_b64in bothload_volumes={True,False}modes (mocked volume loader).run_variantdelivers the kwarg as JPEG b64 when declared, omits it cleanly (noTypeError) when not.python run.py --helpexits 0; all modules import cleanly.PIL_Imagelazy-import instances inside_create_slice_image— same pattern as the 7 pre-existing instances in the file; no other deltas.