RodSizer improvements: calibration & raft-splitting fixes, batch comparison, richer stats, UX (supersedes #2) - #3
Open
aaturk2 wants to merge 10 commits into
Open
Conversation
Nothing in the pipeline imports stardist or tensorflow, and they were the main cause of slow (~5-10 min, ~1 GB) and failure-prone first-time setup. Mac launcher no longer forces Python 3.11 (a TensorFlow constraint) and now accepts any Python 3.10+; Windows launchers auto-detect 3.12/3.13. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Re-implements the column sorting (click header to toggle asc/desc with arrow indicator) that existed in Arda's local copy, adapted to the new XSS-safe textContent row rendering. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Unpinned installs meant each computer resolved different library versions - a major source of machine-to-machine differences. Versions pinned from the tested working environment (Python 3.12.5, macOS). Launchers now target Python 3.10-3.12 to match the pinned numpy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Results housekeeping: Excel export temps now self-delete after download, deleting a folder removes its cached results, and a startup sweep purges results whose source upload no longer exists (freed 362 MB / 541 files on first run). - Statistics: new compute_summary_stats() adds median, D10/D90, CV% and rod yield (AR >= 1.5) to Excel exports, the folder aggregate API, and a Detailed Statistics table on the folder analysis page. - New Compare Batches page (/compare): overlay normalized length / width / aspect-ratio distributions of 2-4 folders with side-by-side extended statistics; linked from the dashboard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Embedded browser panes (e.g. IDE previews) block native confirm()
dialogs, which made image and folder deletion silently do nothing.
First click arms the button ('Delete?' / 'Really delete?'), a second
click within 4s confirms; it disarms automatically otherwise.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Calibration lookup ran inside the per-file save loop, so an image saved before its .dm3 partner in the same batch never found it — the decision was frozen into the queued background task. Lookup now happens after the entire batch is on disk. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Parallel rods touching along their full length have no binary 'neck', so the distance-transform watershed measured whole rafts as one giant particle (widths 3-5x the true rod width). New split path: - Estimate single-rod width from the narrowest substantial regions. - Regions much wider than that (even convex ones that pass the solidity test) get split_clump_intensity: re-threshold the clump interior at a darker cutoff so the lighter contact seams drop out, leaving one core per rod; cores seed a watershed over the smoothed intensity. - split_raft recurses on still-wide children with LOCAL contrast, which resolves rods much lighter than their raft neighbours. - Accept a split only if most pieces are single-rod-width — rejects bogus cuts through single rods with internal diffraction bands. Worst raft image: 19 particles (9 fused monsters, widths to 175 nm) -> 67 particles, zero width outliers, median width unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- 'Add to Folder Analysis' no longer flickers and no longer relies on a popup alert (blocked in embedded browsers, so saves looked like they did nothing): the button itself shows 'Added N particles' inline, with a stable width and inline error text on failure. - Gallery cards now show a green tick badge on images whose selection is part of the folder analysis (backend reports in_analysis). - Clicking the tick (twice, two-step confirm) removes that image's data from the folder analysis via a new DELETE endpoint. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Box outlines thickened (base line ~2.3x) for visibility on dense rafts; excluded particles keep their orange dashed style. - Particle IDs now show by default; button starts as 'Hide IDs'. - ID numbers are color-coded by decade (0s yellow, 10s magenta, 20s green, 30s cyan, 40s red, 50s orange, 60s pink, 70s spring green, cycling) so a given ID is findable at a glance, restoring the scheme from the original pre-fork overlay renderer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Thumbnail grid tightened (min column 250->160px, image height 200->110px, smaller gap and caption) so ~40-image folders show far more per screen with less scrolling. - Returning from an image's analysis view restores the previous scroll position (saved to sessionStorage per folder on image open) instead of jumping back to the top of the folder. Co-Authored-By: Claude Fable 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.
Builds on #2 and supersedes it — this PR contains everything in #2 (the first three commits) plus seven further commits of bug fixes and features. Reviewing this one alone covers all of it; #2 can be closed.
Bug fixes (scientifically important)
.dm3partner never picked up the scale, so ~half of paired uploads silently fell back to an uncalibrated placeholder. Lookup now runs after the whole batch is on disk. (50ff705)88e953c)Features
/compare) — overlay normalized length/width/AR distributions of 2–4 folders with side-by-side extended statistics. (eb1ac43)eb1ac43)2869c30)Fixes & polish
eb1ac43)confirm()popups (blocked in embedded browser panes, which made delete appear to do nothing). (a09c571)cfb6354)36860f1)Notes for review
🤖 Generated with Claude Code