Skip to content

Commit 933833f

Browse files
eurunuelaclaude
andcommitted
docs: Correct update guide based on actual open_rica_report.py behavior
The script already auto-downloads the latest Rica from GitHub on every run. Update the docs and README to reflect the real workflow: - Just running the script is enough to get the latest version - --force-download bypasses the cache check - TEDANA_RICA_PATH env var pins a local/custom build - Falls back to cache automatically when offline Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent dfc911e commit 933833f

2 files changed

Lines changed: 78 additions & 81 deletions

File tree

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,28 +110,26 @@ npx gulp
110110

111111
## Updating Rica Without Rerunning Tedana
112112

113-
Tedana generates an `open_rica_report.py` script in its output directory that bundles a specific version of Rica. If a newer Rica release is available (with bug fixes or new features), you can update without rerunning tedana:
113+
Tedana generates an `open_rica_report.py` script in its output directory. This script **automatically downloads the latest Rica** from GitHub every time it runs — you usually don't need to do anything special:
114114

115-
### Option A: Use Rica Online (Easiest)
116-
117-
Visit **https://rica-fmri.netlify.app** — always up-to-date, no files to change.
115+
```bash
116+
python open_rica_report.py
117+
```
118118

119-
### Option B: Replace the Local Files
119+
To force a fresh download regardless of the cached version:
120120

121-
1. Download the latest `index.html` and `rica_server.py` from the [releases page](https://github.com/ME-ICA/rica/releases/latest)
121+
```bash
122+
python open_rica_report.py --force-download
123+
```
122124

123-
2. Copy them into your tedana output folder:
124-
```bash
125-
cp index.html rica_server.py /path/to/tedana/output/
126-
```
125+
To use a local or custom build, set the `TEDANA_RICA_PATH` environment variable to a directory containing `index.html` and `rica_server.py`:
127126

128-
3. Run the updated server instead of `open_rica_report.py`:
129-
```bash
130-
cd /path/to/tedana/output/
131-
python rica_server.py
132-
```
127+
```bash
128+
export TEDANA_RICA_PATH=/path/to/rica/build
129+
python open_rica_report.py
130+
```
133131

134-
`rica_server.py` is a drop-in replacement for `open_rica_report.py` — it serves the same data, just with the newer Rica version. See the [full guide](https://me-ica.github.io/rica/updating-rica/) for more details including bulk updates across multiple folders.
132+
See the [full guide](https://me-ica.github.io/rica/updating-rica/) for details on offline use, pinning versions, and building Rica from source.
135133

136134
## Required Files
137135

docs/updating-rica.md

Lines changed: 64 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,114 @@
11
# Updating Rica Without Rerunning Tedana
22

3-
When tedana runs, it generates an `open_rica_report.py` script in the output directory. This script bundles a specific version of Rica so you can view your results locally. However, Rica is updated independently from tedana — new releases bring bug fixes, new features, and improved visualizations.
3+
When tedana runs, it generates an `open_rica_report.py` script in the output directory. This script automatically downloads the latest Rica from GitHub every time it runs, so **you usually don't need to do anything special** — just run the script and it will self-update.
44

5-
This guide explains how to update the Rica version used to view your existing tedana output **without rerunning tedana**.
5+
This page explains how the update mechanism works and what to do in less common situations (offline use, pinning a specific version, or using a local build).
66

7-
## Why Update Rica Separately?
7+
## How `open_rica_report.py` Works
88

9-
Tedana analyses can take hours or days for large datasets. You should not need to rerun tedana just to get improvements to the visualization tool. Common reasons to update Rica independently:
9+
Each time you run `open_rica_report.py`, it:
1010

11-
- A bug was fixed in the brain viewer or plots
12-
- A new feature was added (e.g., new keyboard shortcut, improved table)
13-
- The online version behaves differently from your local `open_rica_report.py`
14-
- You want to match the Rica version used by collaborators
11+
1. Queries the GitHub API for the latest Rica release
12+
2. Compares it against the version cached at `~/Library/Caches/tedana/rica/` (macOS) or the platform equivalent
13+
3. Downloads `index.html` and `rica_server.py` if a newer version is available
14+
4. Copies the files into a `rica/` subdirectory of your tedana output folder
15+
5. Starts a local HTTP server and opens Rica at `http://localhost:8000/rica/index.html`
1516

16-
## The Simplest Option: Use Rica Online
17+
So to get the latest Rica, simply run:
1718

18-
The online version at **[rica-fmri.netlify.app](https://rica-fmri.netlify.app)** is always up-to-date with the latest release. You can use it with any tedana output folder — no files to update.
19-
20-
1. Visit [rica-fmri.netlify.app](https://rica-fmri.netlify.app)
21-
2. Click **Select Folder**
22-
3. Navigate to your tedana output directory and click **Upload**
23-
24-
!!! tip
25-
The online version is the easiest way to always have the latest Rica. Your data never leaves your machine — everything is processed in the browser.
19+
```bash
20+
python open_rica_report.py
21+
```
2622

27-
## Updating the Local Files
23+
## Forcing a Re-download
2824

29-
If you prefer to run Rica locally (e.g., for large datasets or offline use), you can replace the files that tedana placed in your output directory.
25+
If you suspect the cache is stale or want to guarantee a fresh download:
3026

31-
### Step 1: Download the Latest Release
27+
```bash
28+
python open_rica_report.py --force-download
29+
```
3230

33-
Go to the [Rica releases page](https://github.com/ME-ICA/rica/releases/latest) and download:
31+
This bypasses the version comparison and always downloads the latest release.
3432

35-
- `index.html` — the self-contained Rica application
36-
- `rica_server.py` — the local server script
33+
## Offline / Air-Gapped Use
3734

38-
### Step 2: Copy Files to Your Tedana Output Directory
35+
When there is no network access, the script falls back to the last cached version automatically. You will see a warning like:
3936

40-
```bash
41-
cp index.html rica_server.py /path/to/tedana/output/
37+
```
38+
[Rica] Warning: Could not check for updates (...)
39+
[Rica] Using cached version v2.1.5
4240
```
4341

44-
### Step 3: Run the New Server
42+
No action is needed — Rica continues to work with the cached files.
4543

46-
Instead of running `open_rica_report.py`, use `rica_server.py`:
44+
If you need to set up Rica on a machine that has never had network access, pre-populate the cache directory manually:
4745

48-
```bash
49-
cd /path/to/tedana/output/
50-
python rica_server.py
51-
```
46+
| Platform | Cache Path |
47+
|----------|-----------|
48+
| macOS | `~/Library/Caches/tedana/rica/` |
49+
| Linux | `~/.cache/tedana/rica/` |
50+
| Windows | `%LOCALAPPDATA%\tedana\rica\` |
5251

53-
Rica opens automatically in your browser with all your existing tedana data.
52+
Place `index.html`, `rica_server.py`, and a `VERSION` file (containing the version tag, e.g. `v2.1.5`) in that directory. Download these from the [Rica releases page](https://github.com/ME-ICA/rica/releases/latest).
5453

55-
!!! note
56-
`rica_server.py` is a drop-in replacement for `open_rica_report.py`. It serves the same tedana output files — only the Rica version changes.
54+
## Using a Local or Custom Build
5755

58-
## Checking Which Version You Are Running
56+
Set the `TEDANA_RICA_PATH` environment variable to a directory containing `index.html` and `rica_server.py`. The script will use those files directly and skip the GitHub download entirely.
5957

60-
The Rica version is shown in the **About** popup (the `(i)` button in the top-right corner of the interface). Compare this to the [latest release](https://github.com/ME-ICA/rica/releases/latest) to see if an update is available.
58+
```bash
59+
export TEDANA_RICA_PATH=/path/to/your/rica/build
60+
python open_rica_report.py
61+
```
6162

62-
## Updating Across Multiple Tedana Output Folders
63+
This is useful for:
6364

64-
If you have several tedana output directories and want to update them all:
65+
- Testing a development build of Rica against real tedana data
66+
- Pinning a specific version without auto-updates
67+
- Air-gapped environments where you manage files manually
68+
69+
To build Rica from source:
6570

6671
```bash
67-
# Download once
68-
curl -L -o index.html https://github.com/ME-ICA/rica/releases/latest/download/index.html
69-
curl -L -o rica_server.py https://github.com/ME-ICA/rica/releases/latest/download/rica_server.py
70-
71-
# Copy to each output folder
72-
cp index.html rica_server.py /path/to/subject01/tedana/
73-
cp index.html rica_server.py /path/to/subject02/tedana/
74-
# ... and so on
72+
git clone https://github.com/ME-ICA/rica.git
73+
cd rica
74+
npm install
75+
npm run build
76+
npx gulp
77+
# Built files are in build/
78+
export TEDANA_RICA_PATH=/path/to/rica/build
7579
```
7680

77-
## What `open_rica_report.py` Does
81+
## Checking the Current Version
7882

79-
`open_rica_report.py` is generated by tedana and bundles the version of Rica that was current at the time tedana was released. It:
83+
The Rica version is shown in the **About** popup (the `(i)` button in the top-right corner). The version of the files installed in your output directory is also stored in `rica/VERSION`:
8084

81-
1. Starts a local HTTP server in your tedana output directory
82-
2. Serves the bundled `index.html` (the Rica application)
83-
3. Exposes a `/api/files` endpoint so Rica can auto-discover your tedana files
84-
4. Opens your browser automatically
85+
```bash
86+
cat /path/to/tedana/output/rica/VERSION
87+
```
8588

86-
`rica_server.py` does exactly the same thing — it is the canonical Rica local server and is kept up-to-date with each Rica release.
89+
Compare this to the [latest release](https://github.com/ME-ICA/rica/releases/latest) to see if an update is available.
8790

8891
## Troubleshooting
8992

9093
### Port Already in Use
9194

92-
If port 8000 is occupied, specify a different one:
95+
If port 8000 is occupied, the script automatically tries the next available port. You can also specify one explicitly:
9396

9497
```bash
95-
python rica_server.py --port 9000
98+
python open_rica_report.py --port 9000
9699
```
97100

98101
### Browser Does Not Open Automatically
99102

100-
Navigate manually to `http://localhost:8000`, or suppress auto-open:
103+
Navigate manually to the URL printed in the terminal, or suppress auto-open and open it yourself:
101104

102105
```bash
103-
python rica_server.py --no-open
106+
python open_rica_report.py --no-open
107+
# Then open http://localhost:8000/rica/index.html
104108
```
105109

106-
### Files Not Found
107-
108-
Make sure you run the server from inside the tedana output directory (not a parent folder):
110+
### Script Can't Find tedana Output Files
109111

110-
```bash
111-
cd /path/to/tedana/output/
112-
python rica_server.py
113-
```
112+
Make sure `open_rica_report.py` is in the tedana output directory (where the `*_metrics.tsv` files are). The script uses its own location to find data.
114113

115114
See [Troubleshooting](troubleshooting.md) for more help.

0 commit comments

Comments
 (0)