Consolidate functions duplicated in ophys-slap2-analysis into GIAnT-MATLAB
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reviewing the inventory and proposed consolidation in this issue, then compare the named GIAnT-MATLAB and ophys-slap2-analysis entry points, especially setParams, optionsGUI, and the older summarize_LoCo pipeline. The issue leaves key decisions open about retiring or freezing that pipeline and choosing an annotation format. Done means the repositories no longer have unintended function-name collisions, their dependency and path setup is documented, and the proposed path-resolution test is in place.
索引モデルが issue の本文から書いたものです。
説明
GIAnT-MATLAB started on 2026-03-23 by moving processing code out of ophys-slap2-analysis, but the originals stayed there. I compared the two main branches (GIAnT-MATLAB at c69d1db, ophys-slap2-analysis at AllenNeuralDynamics/ophys-slap2-analysis@8b89d18) by file name and by content. 31 GIAnT functions have a copy or an earlier version in ophys-slap2-analysis, and two more names differ from GIAnT's only by letter case.
This causes three problems:
-
With both repos on the MATLAB path, one copy silently shadows the other. The worst case is
setParams: the two copies have the same signature but disjoint case lists. Whichever is first on the path makes the other repo's stages fail with "Unknown function name passed to setParams.m". -
Fixes land in only one copy. GIAnT has:
- the
nansvdpadding fix - the
drawROIscircle-radius fix - an
errorinstead ofkeyboardin thexcorr2_nans*functions
ophys-slap2-analysis has the
optionsGUIdialog-centering fix (AllenNeuralDynamics/ophys-slap2-analysis@2282dd1), and GIAnT does not. - the
-
New copies are still being made.
extractDendritesnow carriesreadTrialTableH5, an inline copy of GIAnT'sloadStructFromH5, so that it doesn't need GIAnT-MATLAB on the path.
Since the split, only four of these ophys-slap2-analysis files have changed: setParams, optionsGUI, postAcquisitionAnnotation and summarize_LoCo. Every other copy there is an older version of the GIAnT code.
Inventory
A. Identical. These can be deleted from ophys-slap2-analysis once GIAnT is on its path.
| GIAnT-MATLAB | ophys-slap2-analysis | Files calling it in ophys-slap2-analysis |
|---|---|---|
dependencies/alignment/dftregistration_clipped.m |
matlab/dependencies/dftregistration_clipped.m |
8 |
dependencies/alignment/interpFrame.m |
matlab/dependencies/interpFrame.m |
2 |
dependencies/alignment/interpFrames.m |
matlab/preprocessing/interpFrames.m |
1 |
dependencies/alignment/slap2/bandscan/makeLookupTable.m |
matlab/slap2/Registration/Michael/makeLookupTable.m |
2 |
dependencies/alignment/slap2/bandscan/poissonLogLikelihoodTable.m |
matlab/slap2/Registration/Michael/poissonLogLikelihoodTable.m |
2 |
dependencies/alignment/slap2/getOnlineMotion.m |
matlab/slap2/Registration/getOnlineMotion.m |
3 |
dependencies/io/loadMetadata.m |
matlab/slap2/loadMetadata.m |
9 |
B. Same signature, and the GIAnT copy has fixes. The GIAnT copies are drop-in replacements.
| GIAnT-MATLAB | ophys-slap2-analysis | What GIAnT changed | Callers |
|---|---|---|---|
dependencies/alignment/xcorr2_nans.m |
matlab/dependencies/xcorr2_nans.m |
error instead of keyboard when the motion is NaN |
13 |
dependencies/alignment/xcorr2_nans3d.m |
matlab/dependencies/xcorr2_nans3d.m |
Same | 1 |
dependencies/alignment/xcorr2_nans_weighted.m |
matlab/dependencies/xcorr2_nans_weighted.m |
Same, plus a faster version of the same arithmetic | 1 |
dependencies/nansvd.m |
matlab/dependencies/nansvd.m |
Pads the outputs when svds returns fewer components than requested |
3 |
dependencies/gui/drawROIs.m |
matlab/dependencies/drawROIs.m |
Circle ROIs keep their radius, closing the window keeps the ROIs, and the display image comes from annotationDisplayImage |
6 |
dependencies/nanmedfilt2.m |
matlab/dependencies/nanmedfilt2.m |
Licence header and an error-message typo only | 3 |
dependencies/alignment/makeConsensusTemplate.m |
matlab/slap2/Registration/makeTemplateMultiRoi.m |
Renamed only | 6 |
C. Same name, diverged. These are stages of the older ophys-slap2-analysis pipeline, which uses trialTable.mat and .mat alignment files.
| Function | GIAnT-MATLAB | ophys-slap2-analysis | How they differ |
|---|---|---|---|
buildTrialTableSLAP2 |
buildTrialTableSLAP2.m |
matlab/preprocessing/buildTrialTableSLAP2.m |
GIAnT takes (dr, savedr, useAllFiles) and writes trial_table.h5; ophys-slap2-analysis takes (dr) and writes trialTable.mat |
verifyFiles |
dependencies/verifyFiles.m |
matlab/preprocessing/verifyFiles.m |
ophys-slap2-analysis takes an extra params argument |
loadAndProcessTrialAsync |
dependencies/extraction/activityImage/ |
matlab/preprocessing/ |
GIAnT takes the motion_correction folder and reads the H5 alignment layout |
localizeSources_vIM |
dependencies/extraction/activityImage/ |
matlab/preprocessing/ |
Different first output (skIm vs summaryEroded) |
processAllTrials_Async |
dependencies/extraction/ |
matlab/preprocessing/ |
Same signature; GIAnT expects the H5 alignment layout (alignData.slap2) and reads frames only at the sampled pixels |
extractTrial |
dependencies/extraction/ |
matlab/preprocessing/ |
GIAnT takes an extra alignData argument |
setParamsExtractTrial |
dependencies/extraction/ |
matlab/preprocessing/ |
The parameter sets have diverged |
D. Same name, different function (collisions)
| Name | GIAnT-MATLAB | ophys-slap2-analysis | Notes |
|---|---|---|---|
setParams |
dependencies/gui/setParams.m, with cases SILo, MultiRoiRegistration, BandRegistration, StripRegistration |
matlab/dependencies/setParams.m, with cases summarize_NoLoCo, summarize_LoCo, multiRoiRegSLAP2, integrationRegistration, stripRegBergamo, extractDendrites, summarize_Voltage |
Whichever comes first on the path breaks the other repo. 14 files in ophys-slap2-analysis call it. |
optionsGUI |
dependencies/gui/optionsGUI.m |
matlab/dependencies/optionsGUI.m |
The copies have diverged substantially; only ophys-slap2-analysis has the centering fix. |
postAcquisitionAnnotation |
utils/postAcquisitionAnnotation.m: (dr, fns), writes postacq_annotations.h5 for importPostAcqAnnotations |
matlab/slap2/postAcquisition/postAcquisitionAnnotation.m: (dr), its output is read by summarize_LoCo |
Two implementations of the same step at the rig, writing different formats |
ScanImageTiffReader |
dependencies/io/ScanImageTiffReader.m (a MATLAB class) |
matlab/dependencies/+ScanImageTiffReader/ (MEX package) |
Two different readers under one name |
MultiRoiRegistration / multiRoiRegistration |
motion_correction/MultiRoiRegistration.m |
matlab/slap2/Registration/multiRoiRegistration.m (old, no callers) |
The names differ only in case, which is fragile on Windows and macOS |
StripRegistration / stripRegistration |
motion_correction/StripRegistration.m |
matlab/bergamo/stripRegistration.m (old, no callers) |
Same |
E. Renamed copies. These are the ophys-slap2-analysis originals of GIAnT functions.
| GIAnT-MATLAB | ophys-slap2-analysis | Content similarity |
|---|---|---|
motion_correction/MultiRoiRegistration.m |
matlab/preprocessing/multiRoiRegSLAP2.m |
0.75 |
motion_correction/StripRegistration.m |
matlab/preprocessing/stripRegBergamo.m |
0.74 |
motion_correction/BandRegistration.m |
matlab/slap2/Registration/Michael/integrationRegistration.m |
0.76 |
buildTrialTable.m |
matlab/preprocessing/buildTrialTableBergamo.m |
0.54 |
dependencies/alignment/shiftRoiData.m |
Local function in matlab/preprocessing/summarize_LoCo.m |
|
dependencies/io/loadStructFromH5.m |
Local readTrialTableH5 in matlab/slap2/Voltage/extractDendrites.m |
Proposed consolidation
-
Bring into GIAnT the one fix that exists only in ophys-slap2-analysis: the
optionsGUIcentering fix (AllenNeuralDynamics/ophys-slap2-analysis@2282dd1). -
Make GIAnT-MATLAB a declared dependency of ophys-slap2-analysis, in its README and with a helper that sets up the path. Then:
- Delete groups A and B from ophys-slap2-analysis.
- Point the 6 callers of
makeTemplateMultiRoiatmakeConsensusTemplate.
One behaviour changes for ophys-slap2-analysis callers: the
xcorr2_nans*functions throw an error on NaN motion instead of stopping inkeyboard. -
Remove the collisions in group D:
setParams: rename the ophys-slap2-analysis copy, which only configures ophys-slap2-analysis functions, or merge both sets of cases into the GIAnT copy.optionsGUI: delete the ophys-slap2-analysis copy after step 1.postAcquisitionAnnotation: settle on one output format. Ifsummarize_LoCocan readpostacq_annotations.h5, delete the ophys-slap2-analysis copy.multiRoiRegistration.mandbergamo/stripRegistration.m: delete them, since nothing calls them.ScanImageTiffReader: check that ophys-slap2-analysis calls toScanImageTiffReader.ScanImageTiffReaderstill reach the MEX package when GIAnT is on the path.
-
Decide what happens to the older pipeline in groups C and E (
multiRoiRegSLAP2/stripRegBergamo→summarize_LoCo). It still uses its own copies and the.matlayouts, andsummarize_LoCochanged as recently as 2026-08-25, so it is still in use. There are two options:- Retire it in favour of
MultiRoiRegistration/StripRegistration→SILo, and keep in ophys-slap2-analysis only the analyses that GIAnT doesn't have, such asextractDendritesand the voltage analysis. - Freeze it, and rename its internals so they no longer shadow GIAnT's.
- Retire it in favour of
-
Replace the inline
readTrialTableH5inextractDendriteswithloadStructFromH5.
To keep the repos from drifting apart again, add a test that runs with both repos on the path and fails when any function name resolves to more than one file (which -all).
How the inventory was made. Each non-test .m file in GIAnT-MATLAB was matched against every .m file in ophys-slap2-analysis, by file name (ignoring case) and by content similarity (difflib ratio on non-comment lines). Local functions defined in both repos were listed as well. Third-party code bundled in ophys-slap2-analysis (NoRMCorre, OASIS, Fast_Tiff_Write) is out of scope.
- 主要言語
- 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週間以上 初心者へのやさしさ 20/100
AllenNeuralDynamics/GIAnT-MATLAB#45 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
AllenNeuralDynamics/GIAnT-MATLAB#42 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
AllenNeuralDynamics/GIAnT-MATLAB#41 ·
メンテナーはふだん 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