SLAP2 photon gain varies across sessions and paths (constant across trials); fixed photonScale and per-trial Vk don't match
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- MATLAB
- スター
- 3
- フォーク
- 3
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 31
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AllenNeuralDynamics/GIAnT-MATLAB のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
AllenNeuralDynamics/GIAnT-MATLAB#56 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
AllenNeuralDynamics/GIAnT-MATLAB#49 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
AllenNeuralDynamics/GIAnT-MATLAB#42 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
AllenNeuralDynamics/GIAnT-MATLAB#41 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
AllenNeuralDynamics/GIAnT-MATLAB#36 ·
メンテナーはふだん 1 日以内に返信
AllenNeuralDynamics/GIAnT-MATLAB の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
UniprJRC/DSwithMATLAB#255 ·
-
Bump ODEInterface_jll to rebuilt 0.0.2+2 (execstack fix) in 8 benchmark folder Manifests対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
SciML/SciMLBenchmarks.jl#2044 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
MohammadRaziei/ctoon#12 ·
-
easy first-contributor first-contributors good first issue help wanted matlab up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
fork-commit-merge/fork-commit-merge#8766 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100