3 detection filter upgrades - #4
Merged
Merged
Conversation
Upon changes in fit/detection method, or upon changing the raw frame, detection/fit is run for this frame and displayed to the user.
Fit radius now dictates the detection-green-boxes in live preview
Scroll wheel now scrubs through data, ctrl+scroll wheel zooms. Scroll wheel also works on the slider below. Tested on windows+firefox
Threshold (k·sigma_noise) and Exact band-pass were shared across the Wavelet and DoG filters even though they don't mean the same thing (or apply at all) for each. Give each method its own field (detection_wavelet_thr / detection_DoG_thr / detection_DoG_exactbp), show only the relevant row for the selected filter, and thread the rename through settings save/load and live-preview wiring. Prep work for adding the Uniform Box Filter detection method. Refs #3 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Implements the box-averaging detection from Huang, Schwartz, Byars & Lidke (2011): difference of two box filters sized off sigma_PSF, thresholded on plain intensity rather than k*sigma, with local maxima found via a sigma_PSF-sized square dilation instead of the fixed 3x3 window wave/dog use. detectSpots() is now the single dispatch point (main thread + worker) picking band-pass + maxima-finder per method. The dilation's sliding-max (maxH/maxV) initially recreated a closure per row/column and used modulo in the hot loop, making box detection much slower than DoG; rewrote it closure-free with persistent scratch buffers, bringing it in line with DoG's per-frame cost. Also documents the live-preview mechanism (showFrame/detectSpots reuse for the real-time scrub preview) in CLAUDE.md. Refs #3 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Closed
Contributor
Author
|
Changed scroll and ctrl-scroll behavior as requested by JH |
jhohlbein
approved these changes
Jul 27, 2026
jhohlbein
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the full diff, syntax-checked the branch, numerically validated the new detection path, and checked for regressions. Solid, merge-ready.
Verified
- Box-filter math is correct:
boxH/boxVnormalise (nm=1/(2r+1)), souniformBPis a true difference of box means — strongly positive at spots, ~0 at background. - The deque dilation (
maxH/maxV) is exact: matched a brute-force sliding-window max with 0 mismatches;findMaximaUniformfound precisely the planted spot. - Worker gotcha handled: new state in
WORKER_PRELUDE, all 8 new functions inworkerSource(), and the ping self-test exercisesdetectSpots(...,'box',...)(so any stringification slip falls back cleanly). - Rename complete — no stale
$('thr')/$('exactbp')references. - No conflict with 0.9.0: the ctrl+wheel scrub is inside
if(!nav.full()), so it never fires while a histogram/profile plot owns the raw panel. - Full-file syntax OK; CLAUDE.md / help text / Huang 2011 reference all added well.
Minor (non-blocking) follow-ups
SETTING_IDSdroppedthr/exactbp, so asettings.jsonsaved by ≤0.9.0 won't restore those two fields — consider aliasing the old keys on load.- Box maxima are non-strict (
filt[i]===dilation) vs. the strict>used by wavelet/DoG — theoretical plateau duplicates only (won't happen on real float data). - Live preview re-detects+re-fits the whole frame on the main thread per scrub/setting change (incl. MLE); coalesced so it won't queue, but may feel heavy on dense stacks under MLE.
Approving.
jhohlbein
added a commit
that referenced
this pull request
Jul 27, 2026
…view) Version bump + docs for the merged PR #4: adds a uniform box detection filter (Huang et al. 2011) behind a single detectSpots() dispatch, per-method threshold fields, a real-time scrubbed-frame preview toggle, and a raw-panel scroll rework (wheel = zoom, ctrl+wheel = scrub). Patch release — no new DOI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jhohlbein
added a commit
that referenced
this pull request
Aug 8, 2026
…ic-aliasing note - webSMLM.html: copyright/attribution "Johannes Hohlbein" -> "Hohlbein et al." (top-of-file comment, header, Help & guide License section); new Acknowledgements section in Help & guide crediting Koen J. A. Martens' verified PR #4 contributions (uniform box-filter detection, Real-time update toggle, wheel-zoom/ctrl+wheel-scrub scroll rework, ROI box sizing). - experimental_data/README.md: note that FRC peaks at 40/20 nm on the GATTA-PAINT dataset are harmonics of the 80 nm ruler spacing, not a bug. - README.md: fix stale button names (Run localisations -> Localize, Display table -> View data + filtering), same copyright change, mention the crop tool and temporal clustering (previously undocumented), qualify the single "~350k loc/s" figure as Phasor-specific and a ceiling not a typical rate. - CLAUDE.md: correct line count (~4000 -> ~5800), drop the dead reference to REFACTOR_PLAN.md's removed "Shipped" table, drop the dangling reference to the removed Nile Red section. - docs/REFACTOR_PLAN.md: drop the CSV-export-of-filtered-subset roadmap item (already shipped via renderLocs-based export), correct stale line count. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jhohlbein
added a commit
that referenced
this pull request
Aug 15, 2026
…l, FTM mobile-OOM fix Clears the -dev marker (v0.10.2-dev · build 2026-08-15h -> v0.10.2) and brings docs up to date for release: - CHANGELOG.md gets the full 0.10.2 entry. - docs/REFACTOR_PLAN.md's photon-calibration roadmap item trimmed: PCFO (single-image gain/offset estimation) shipped, per-pixel sCMOS calibration maps stays the open remainder. - README.md gains a "What it does" bullet and reference for PCFO gain/offset estimation, and the ADU/gain known-limitation note now points to it. - docs/DOCUMENTATION.md's line-reference note bumped to v0.10.2. - In-app Help & guide: new References entry for the PCFO paper (Heintzmann, Relich, Nieuwenhuizen, Lidke & Rieger, arXiv:1611.05654 — verified title via the arXiv listing itself, not invented) and a second Acknowledgements line crediting Koen J. A. Martens' PR #5 contribution, alongside his existing PR #4 credit. - CITATION.cff version/date-released bumped to 0.10.2 / 2026-08-15; authors list unchanged (Hohlbein only) — PR contributions are credited in Acknowledgements, not software citation authorship, matching the existing PR #4 precedent. Verified end-to-end in a real browser after all doc/version edits: Simulate -> Estimate -> Transfer estimates -> Localize (FTM on) completes cleanly, version pill reads v0.10.2, no console/page errors. Co-Authored-By: Koen J.A. Martens <32260034+kjamartens@users.noreply.github.com> Co-Authored-By: Claude Sonnet 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.
See issue #3