Skip to content

Commit 425c5c1

Browse files
authored
Merge pull request #80 from eurunuela/modernize-app-performance
Modernize Rica v2.0: Brain viewer, component table, and UI improvements
2 parents 60b09ec + dc3c68d commit 425c5c1

50 files changed

Lines changed: 18848 additions & 8667 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ jobs:
3232
- name: Inline assets (single-file HTML)
3333
run: npx gulp
3434

35-
- name: Copy server files
36-
run: |
37-
cp scripts/rica_server.py build/
38-
cp public/favicon.ico build/
35+
- name: Copy server script
36+
run: cp scripts/rica_server.py build/
3937

4038
- name: Upload build artifacts
4139
uses: actions/upload-artifact@v4
@@ -44,7 +42,6 @@ jobs:
4442
path: |
4543
build/index.html
4644
build/rica_server.py
47-
build/favicon.ico
4845
retention-days: 90
4946

5047
# Create release assets when a tag is pushed
@@ -55,5 +52,4 @@ jobs:
5552
files: |
5653
build/index.html
5754
build/rica_server.py
58-
build/favicon.ico
5955
generate_release_notes: true

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
# misc
1515
.DS_Store
16+
.env
1617
.env.local
1718
.env.development.local
1819
.env.test.local
@@ -21,3 +22,12 @@
2122
npm-debug.log*
2223
yarn-debug.log*
2324
yarn-error.log*
25+
26+
# IDE
27+
.idea/
28+
.vscode/
29+
*.swp
30+
*.swo
31+
32+
# OS
33+
Thumbs.db

.mise.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tools]
2+
node = "20"

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

README.md

Lines changed: 106 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,135 @@
22

33
[![DOI](https://zenodo.org/badge/391155862.svg)](https://zenodo.org/badge/latestdoi/391155862)
44

5-
As part of the ME-ICA pipeline, `Rica` (Reports for ICA) provides a reporting tool for ICA decompositions performed with [tedana](https://github.com/ME-ICA/tedana) and [aroma](https://github.com/ME-ICA/aroma).
5+
**Rica** (Reports for ICA) is an interactive visualization tool for reviewing and classifying ICA components from [tedana](https://github.com/ME-ICA/tedana) multi-echo fMRI analysis.
66

7-
**Pronunciation:** [ˈrika]. For an audio recording on how to pronounce Rica [see here](https://easypronunciation.com/en/spanish/word/rica).
7+
**Pronunciation:** [ˈrika]. [Hear it here](https://easypronunciation.com/en/spanish/word/rica).
88

9-
## About
9+
## Features
1010

11-
`Rica` originally came out as an alternative to the reports provided by [tedana](https://github.com/ME-ICA/tedana), with the aim of making manual classification of ICA components possible. At the same time, the tool aspires to be of value for ICA decompositions made with tools other than `tedana`. `Rica` assumes you're working with files that mimic the outputs of `tedana`.
11+
### ICA Component Analysis
12+
- **Interactive scatter plots** - Kappa vs Rho, Kappa/Rho Rank plots with elbow threshold lines, zoom/pan
13+
- **Pie chart** - Component variance distribution, click to select
14+
- **3D brain viewer** - Interactive stat-z maps using Niivue with mosaic view (7 slices per orientation)
15+
- **Time series & FFT** - Component time courses and power spectra
16+
- **Component table** - Full metrics with sorting and selection sync
17+
- **External regressor heatmap** - Interactive correlation visualization (requires tedana 24.1+)
1218

13-
## How to use Rica
19+
### Quality Control (QC) Tab
20+
- **Brain maps** - T2\*, S0, and RMSE maps with Niivue mosaic viewer
21+
- **Histograms** - Distribution plots for QC metrics
22+
- **Carpet plots** - Time series visualization in dedicated Carpets tab
1423

15-
Even if Rica is designed to be simple to use, you might want to see how you can use the app by watching this [tutorial video](https://www.loom.com/share/ad37cf6f3c2d41e48721f62168a8284e).
24+
### User Experience
25+
- **Classification toggle** - Accept/reject components with A/R keyboard shortcuts
26+
- **Arrow navigation** - Previous/next component with wrap-around
27+
- **Light/dark theme** - Toggle with the sun/moon button
28+
- **Export** - Save modified classifications as TSV
1629

17-
Rica also supports keyboard shortcuts on the ICA components page. You can use the following shortcuts:
30+
## How to Use
1831

19-
- `a`: Accept component.
20-
- `r`: Reject component.
21-
- `i`: Ignore component.
22-
- `left arrow`: Go to previous component.
23-
- `right arrow`: Go to next component.
32+
For a video tutorial, see [this walkthrough](https://www.loom.com/share/ad37cf6f3c2d41e48721f62168a8284e).
2433

25-
## Using Rica online
34+
### Keyboard Shortcuts
2635

27-
Just head over to https://rica-fmri.netlify.app and have fun!
36+
| Key | Action |
37+
|-----|--------|
38+
| `A` | Accept component |
39+
| `R` | Reject component |
40+
| `` | Previous component |
41+
| `` | Next component |
2842

29-
## Using Rica locally
43+
## Using Rica
3044

31-
### Installation
45+
### Option 1: Online (Easiest)
3246

33-
`Rica` can be installed by cloning this repository and executing the following command in the cloned repository:
47+
Visit **https://rica-fmri.netlify.app** and select your tedana output folder.
3448

35-
```npm install```
49+
### Option 2: Local Server (Recommended for Local Use)
3650

37-
In order to run the tool locally, two options exist:
51+
Run Rica directly from your tedana output folder with automatic data loading:
3852

39-
#### 1. Using a localhost
53+
1. Download the latest release files:
54+
- `index.html` (self-contained single-file app with embedded logo)
55+
- `rica_server.py`
4056

41-
By executing the `npm start` command in the cloned repository, `Rica` will open in a new browser tab at [http://localhost:3000](http://localhost:3000) and you will be able to use the tool.
57+
2. Copy these files to your tedana output folder:
58+
```bash
59+
cp index.html rica_server.py /path/to/tedana/output/
60+
```
4261

43-
#### 2. Compiling the tool
62+
3. Run the server:
63+
```bash
64+
cd /path/to/tedana/output/
65+
python rica_server.py
66+
```
4467

45-
You could also compile the project so that you can use the tool just by opening an HTML file. For that, it is necessary to execute the following commands in the cloned repository.
68+
4. Your browser opens automatically and data loads instantly!
69+
70+
> **Note:** The "New" button is hidden in local server mode since data is loaded automatically.
71+
72+
### Option 3: Development Server
73+
74+
For development or if you want to load different folders:
75+
76+
```bash
77+
# Clone and install
78+
git clone https://github.com/ME-ICA/rica.git
79+
cd rica
80+
npm install
81+
82+
# Start development server
83+
npm start
84+
```
85+
86+
Then open http://localhost:3000 and select your tedana output folder.
87+
88+
### Option 4: Build from Source
89+
90+
Build a single-file HTML distribution:
4691

4792
```bash
93+
# Install dependencies
94+
npm install
95+
96+
# Build with inlined assets
4897
npm run build
4998
npx gulp
50-
mv build/index.html build/rica.html
51-
open build/rica.html
99+
100+
# Output files in build/
101+
# - index.html (self-contained single-file app)
102+
# - rica_server.py (local server)
52103
```
53104

54-
> Pro tip: when you open rica.html for the first time, BOOKMARK IT 😉
105+
## Required Files
106+
107+
Rica expects these files from tedana output:
108+
109+
| File Pattern | Description |
110+
|--------------|-------------|
111+
| `*_metrics.tsv` | Component metrics table (required) |
112+
| `*_mixing.tsv` | ICA mixing matrix (time series) |
113+
| `*stat-z_components.nii.gz` | 4D component stat maps |
114+
| `*_desc-ICACrossComponent_metrics.json` | Elbow thresholds for reference lines |
115+
| `figures/comp_*.png` | Component figures |
116+
| `*.svg` | Carpet plots and diagnostic figures |
117+
| `report.txt` | Tedana report |
118+
| `T2starmap.nii*`, `S0map.nii*`, `rmse_statmap.nii*` | QC brain maps |
119+
120+
## Versioning
121+
122+
Rica version is displayed in the About popup and managed centrally:
123+
- Version is defined in `package.json`
124+
- UI automatically displays the current version
125+
- GitHub releases should be tagged as `v<version>` (e.g., `v2.0.0`)
126+
127+
To bump the version:
128+
```bash
129+
npm version patch # 2.0.0 -> 2.0.1
130+
npm version minor # 2.0.0 -> 2.1.0
131+
npm version major # 2.0.0 -> 3.0.0
132+
```
55133

56-
## Getting involved
134+
## Contributing
57135

58-
Want to learn more about our plans for developing `Rica`? Have a question, comment, or suggestion? Open or comment on one of our issues!
136+
Questions, suggestions, or contributions? Open an issue on [GitHub](https://github.com/ME-ICA/rica/issues)!

0 commit comments

Comments
 (0)