|
1 | 1 | # Updating Rica Without Rerunning Tedana |
2 | 2 |
|
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. |
4 | 4 |
|
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). |
6 | 6 |
|
7 | | -## Why Update Rica Separately? |
| 7 | +## How `open_rica_report.py` Works |
8 | 8 |
|
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: |
10 | 10 |
|
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` |
15 | 16 |
|
16 | | -## The Simplest Option: Use Rica Online |
| 17 | +So to get the latest Rica, simply run: |
17 | 18 |
|
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 | +``` |
26 | 22 |
|
27 | | -## Updating the Local Files |
| 23 | +## Forcing a Re-download |
28 | 24 |
|
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: |
30 | 26 |
|
31 | | -### Step 1: Download the Latest Release |
| 27 | +```bash |
| 28 | +python open_rica_report.py --force-download |
| 29 | +``` |
32 | 30 |
|
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. |
34 | 32 |
|
35 | | -- `index.html` — the self-contained Rica application |
36 | | -- `rica_server.py` — the local server script |
| 33 | +## Offline / Air-Gapped Use |
37 | 34 |
|
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: |
39 | 36 |
|
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 |
42 | 40 | ``` |
43 | 41 |
|
44 | | -### Step 3: Run the New Server |
| 42 | +No action is needed — Rica continues to work with the cached files. |
45 | 43 |
|
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: |
47 | 45 |
|
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\` | |
52 | 51 |
|
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). |
54 | 53 |
|
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 |
57 | 55 |
|
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. |
59 | 57 |
|
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 | +``` |
61 | 62 |
|
62 | | -## Updating Across Multiple Tedana Output Folders |
| 63 | +This is useful for: |
63 | 64 |
|
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: |
65 | 70 |
|
66 | 71 | ```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 |
75 | 79 | ``` |
76 | 80 |
|
77 | | -## What `open_rica_report.py` Does |
| 81 | +## Checking the Current Version |
78 | 82 |
|
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`: |
80 | 84 |
|
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 | +``` |
85 | 88 |
|
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. |
87 | 90 |
|
88 | 91 | ## Troubleshooting |
89 | 92 |
|
90 | 93 | ### Port Already in Use |
91 | 94 |
|
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: |
93 | 96 |
|
94 | 97 | ```bash |
95 | | -python rica_server.py --port 9000 |
| 98 | +python open_rica_report.py --port 9000 |
96 | 99 | ``` |
97 | 100 |
|
98 | 101 | ### Browser Does Not Open Automatically |
99 | 102 |
|
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: |
101 | 104 |
|
102 | 105 | ```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 |
104 | 108 | ``` |
105 | 109 |
|
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 |
109 | 111 |
|
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. |
114 | 113 |
|
115 | 114 | See [Troubleshooting](troubleshooting.md) for more help. |
0 commit comments