SLAP2 photon gain varies across sessions and paths (constant across trials); fixed photonScale and per-trial Vk don't match
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
Direzione di ricerca
Start by reading setParamsExtractTrial.m (where photonScale = 25 is fixed) and the Vk estimation in localizeSources_vIM.m, then reproduce the photon transfer curve that slap2_f0/stats.py computes from exported trials. The first empirical step is measuring single-photon amplitude on the raw/200 Hz data for the four sessions and both paths and comparing against acquisition metadata. Done means photon units are consistent across sessions and paths, either by fixing a preprocessing scaling or by estimating the gain once per session/path and feeding it to both extraction and localization.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
In SLAP2 data, the photon-noise gain (temporal variance per unit mean) is constant across trials of a session, but it differs by up to 1.8× between sessions, and in one session between its two paths. The true photon gain should be constant barring an instrument recalibration. So either the instrument settings changed, or some step before GIAnT's fit scales the data differently by session or path.
GIAnT assumes one gain for all SLAP2 data in extraction: photonScale = 25 in setParamsExtractTrial.m. Localization re-estimates Vk independently for every trial in localizeSources_vIM.m.
Measurement
Data: the 80 Hz registered movies (alignHz 80, after MultiRoiRegistration), as SiLo localizes on them. Taken from the first 180 s of the four integration-test sessions, run through GIAnT main at d2fb85c.
Method:
- Per pixel, take the temporal mean and variance of movie − GIAnT's fitted activity, on background pixels (valid and outside every labeled region, so with no fitted activity).
- Fit binned variance against mean across pixels: a photon transfer curve. The slope is the gain; the intercept reflects an offset or additive noise.
| session | path | trial | lines / cycle | median bg mean | var / mean | PTC slope | intercept |
|---|---|---|---|---|---|---|---|
| 780125_2025-03-14 | 1 | 2 | 122 | 2.80 | 7.97 | 7.93 | −0.02 |
| 803121_2025-10-29 | 1 | 3 | 247 | 5.82 | 10.74 | 10.73 | −0.20 |
| 878030_2026-08-28 | 1 | 1 | 96 | 1.83 | 12.76 | 14.56 | −3.38 |
| 878030_2026-08-28 | 1 | 2 | 96 | 1.86 | 12.36 | 13.95 | −3.03 |
| 878030_2026-08-28 | 1 | 3 | 96 | 1.86 | 12.50 | 14.14 | −3.12 |
| 878030_2026-08-28 | 1 | 5 | 96 | 1.91 | 12.70 | 14.16 | −2.86 |
| 878030_2026-08-28 | 2 | 2 | 448 | 1.92 | 9.36 | 10.45 | −2.17 |
| 885233_2026-10-02 | 1 | 1 | 73 | 3.04 | 9.63 | 10.40 | −2.41 |
| 885233_2026-10-02 | 1 | 2 | 73 | 2.95 | 9.79 | 10.62 | −2.52 |
| 885233_2026-10-02 | 1 | 4 | 73 | 2.91 | 9.88 | 10.59 | −2.08 |
| 885233_2026-10-02 | 2 | 2 | 297 | 3.15 | 9.92 | 10.53 | −1.90 |
Observations:
- Constant across trials: within ±3% for the four 878030 Path 1 trials and the three 885233 Path 1 trials.
- Different across sessions: the slope ranges from 7.9 to 14.6.
- Different across paths in one session: 878030 Path 1 is 14.2 and Path 2 is 10.5. In 885233 the two paths agree (10.5).
- Not explained by the alignment kernel: lines per cycle sets how many raw samples the 80 Hz kernel averages per pixel, but it shows no relation to the gain. Correcting for the kernel's effective sample count (
exp(-|Δline|/134)within ±402 lines) makes the spread larger. - Not explained by registration smoothing: neighbour correlations of the noise are similar in every session (0.22–0.27 between rows, 0.36–0.40 between columns, 0.50–0.69 between consecutive frames).
- Intercepts: about 0 in two sessions, and −2 to −3 counts² in the other two, equivalent to an offset of about +0.2 counts.
Why it matters
- Extraction: it divides the data by a fixed
photonScale. If the per-photon amplitude differs by 1.8× between sessions or paths, the noise model and the sparsity penalties are miscalibrated by that much from one recording to the next. - Localization: the per-trial
Vkadapts to the gain. But it is the 10th percentile of a ratio over the brightest 10% of pixels, from the first 500 frames of each trial. It is recomputed for every trial even though the gain is constant within a session and path, so it adds trial-to-trial noise and bias to the Z-scores.
Caveats
- These numbers come from the 80 Hz aligned movie, not the raw samples or the 200 Hz data that
extractTrialfits. - The alignment kernel and registration interpolation scale the absolute values. That can't make the gain constant across trials yet session- and path-dependent unless those steps depend on session or path settings, and this should be checked.
Suggested next steps
- On raw data, check whether the single-photon amplitude differs between these sessions and paths. Compare against acquisition metadata (detector gain, digitizer settings, any averaging in the reader).
- If a preprocessing step causes it, fix the scaling so photon units are the same everywhere.
- If the instrument causes it (per path, or after recalibrations), estimate the photon scale once per session and path, pooled over trials, or read it from metadata. Use it in both extraction (
photonScale) and localization (Vk), instead of the fixed 25 and the per-trialVk.
Found while building training data for a blind-spot baseline network (AllenNeuralDynamics/slap2-F0-network; slap2_f0/stats.py computes these statistics from exported trials).
- Lingua principale
- MATLAB
- Stelle
- 3
- Fork
- 3
- Merge medio
- 1g 22h
- PR unite (30g)
- 31
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AllenNeuralDynamics/GIAnT-MATLAB
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
AllenNeuralDynamics/GIAnT-MATLAB#56 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
AllenNeuralDynamics/GIAnT-MATLAB#49 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
AllenNeuralDynamics/GIAnT-MATLAB#42 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
AllenNeuralDynamics/GIAnT-MATLAB#41 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
AllenNeuralDynamics/GIAnT-MATLAB#36 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di AllenNeuralDynamics/GIAnT-MATLAB
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
UniprJRC/DSwithMATLAB#255 ·
-
Bump ODEInterface_jll to rebuilt 0.0.2+2 (execstack fix) in 8 benchmark folder ManifestsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
SciML/SciMLBenchmarks.jl#2044 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
MohammadRaziei/ctoon#12 ·
-
easy first-contributor first-contributors good first issue help wanted matlab up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
fork-commit-merge/fork-commit-merge#8766 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100