feat: Add multi-run support (#126) - #128
Draft
eurunuela wants to merge 2 commits into
Draft
Conversation
…or (ME-ICA#126) When a tedana output folder contains files from multiple BIDS runs (e.g. run-01, run-02), Rica now groups all per-run data into indexed arrays and shows a run selector bar above the tabs. - Add `parseRunLabel` / `deriveRunLabels` helpers to pathUtils.js - Refactor both loaders in IntroPopUp.js to detect BIDS run entities and accumulate per-run data (metrics, mixing matrix, NIfTIs, report, decision tree, etc.) into run-indexed arrays instead of scalars - Add `runs` / `selectedRunIndex` state to App (index.js); reset to 0 on every new dataset load - Split the `info` state into separate `reportText[]` and `dirPath[]` per-run arrays - Render a sticky run selector bar (only when runs.length > 1) that lets users switch between runs; all tabs reflect the selected run - Update Info.js to accept explicit `info` + `dirPath` string props - Add a useEffect in Plots.js to reset `selectedIndex` to 0 on run change, preventing out-of-range component selection - Carpets and QC Histograms/Time Series are unchanged — they already display all runs' SVGs via their accumulated flat arrays Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for rica-fmri ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Extend the per-run grouping to carpetFigures and diagnosticFigures so all tabs consistently show only the selected run's content. Previously these two arrays were kept flat (all runs mixed together), which made Carpets and QC Histograms work "accidentally" but inconsistently with the rest of the tabs. Now they are run-indexed arrays like all other per-run data, and index.js slices them with carpetFigures[r] / diagnosticFigures[r] before passing to the tabs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
@tsalo can you check if this works well in your multi-run setup? I don't have data to test this. |
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.
Summary
Closes #126. When a tedana output folder contains files from multiple BIDS runs (e.g.
run-01,run-02), Rica previously showed only one run's data in most tabs due to last-write-wins scalar variables. This PR adds full multi-run support with a per-run data grouping system and a run selector UI.What changed
src/utils/pathUtils.js— newparseRunLabelandderiveRunLabelshelpers extract BIDS run entities (run-XX) from filenamessrc/PopUps/IntroPopUp.js— both loaders (loadFromServer+processFiles) now detect run entities and accumulate all per-run data (metrics TSV, mixing matrix, NIfTIs, report text, decision tree, status table, QC NIfTIs, etc.) into run-indexed arrays. Files without arun-XXentity are treated as shared and broadcast to all run slotssrc/index.js— addsrunsandselectedRunIndexstate; splits theinfostate into separatereportText[]anddirPath[]arrays; renders a sticky run selector bar above the tabs (only shown when multiple runs are detected); slices all per-run props byselectedRunIndexbefore passing to tabssrc/Info/Info.js— prop signature updated frominfo(array[reportText, dirPath]) to explicitinfo(string) +dirPath(string)src/Plots/Plots.js— adds auseEffectto resetselectedIndexto 0 when the run changes, preventing out-of-range component selectionTabs that were already working (unchanged)
Tabs now fixed
report.txtand output directory pathTest plan
run-01,run-02, …) appears between the navbar and tabs; switching runs updates the ICA tab, Info tab, QC Brain Maps, and Tree tab🤖 Generated with Claude Code