Skip to content

feat: Add multi-run support (#126) - #128

Draft
eurunuela wants to merge 2 commits into
ME-ICA:masterfrom
eurunuela:feat/multi-run-support-126
Draft

feat: Add multi-run support (#126)#128
eurunuela wants to merge 2 commits into
ME-ICA:masterfrom
eurunuela:feat/multi-run-support-126

Conversation

@eurunuela

@eurunuela eurunuela commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

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 — new parseRunLabel and deriveRunLabels helpers extract BIDS run entities (run-XX) from filenames
  • src/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 a run-XX entity are treated as shared and broadcast to all run slots
  • src/index.js — adds runs and selectedRunIndex state; splits the info state into separate reportText[] and dirPath[] arrays; renders a sticky run selector bar above the tabs (only shown when multiple runs are detected); slices all per-run props by selectedRunIndex before passing to tabs
  • src/Info/Info.js — prop signature updated from info (array [reportText, dirPath]) to explicit info (string) + dirPath (string)
  • src/Plots/Plots.js — adds a useEffect to reset selectedIndex to 0 when the run changes, preventing out-of-range component selection

Tabs that were already working (unchanged)

  • Carpets — continues to list all runs' carpet SVGs in its dropdown
  • QC Histograms / Time Series / Other — continues to show all runs' SVGs via buttons

Tabs now fixed

  • Info — shows the selected run's report.txt and output directory path
  • ICA / Plots — shows the selected run's component metrics, mixing matrix, brain maps, and component figures
  • QC Brain Maps — shows the selected run's T2*, S0, RMSE NIfTIs
  • Tree — shows the selected run's decision tree and status table (tab only appears when that run has tree data)

Test plan

  • Load a single-run tedana output folder — no run selector appears, all tabs work as before
  • Load a multi-run tedana output folder — run selector (run-01, run-02, …) appears between the navbar and tabs; switching runs updates the ICA tab, Info tab, QC Brain Maps, and Tree tab
  • Carpets and QC Histograms continue to list SVGs from all runs regardless of selected run
  • Tree tab correctly appears/disappears per-run when only some runs have decision tree data

🤖 Generated with Claude Code

…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>
@netlify

netlify Bot commented Apr 24, 2026

Copy link
Copy Markdown

Deploy Preview for rica-fmri ready!

Name Link
🔨 Latest commit 57ec646
🔍 Latest deploy log https://app.netlify.com/projects/rica-fmri/deploys/69ebe009e7108c0008b351da
😎 Deploy Preview https://deploy-preview-128--rica-fmri.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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>
@eurunuela

Copy link
Copy Markdown
Collaborator Author

@tsalo can you check if this works well in your multi-run setup? I don't have data to test this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rica can only show one run at a time

1 participant