Skip to content

Conversation

@eurunuela
Copy link
Collaborator

@eurunuela eurunuela commented Dec 19, 2025

Summary

Closes #1283.

This PR adds the ability to generate Rica interactive reports directly from tedana output directories. Rica is a web-based visualization tool for exploring ICA components.

New Features

  • Add tedana/rica.py module for Rica download and report generation
  • Add --rica-report flag to tedana and ica_reclassify workflows
  • Download Rica from GitHub releases and cache locally
  • Generate open_rica_report.py launcher script in output directory
  • Cross-platform support for Linux, macOS, and Windows

How It Works

When --rica-report is passed to tedana or ica_reclassify:

  1. Download & Cache: Rica files are downloaded from ME-ICA/rica GitHub releases and cached in a platform-specific directory:

    • Linux: ~/.cache/tedana/rica
    • macOS: ~/Library/Caches/tedana/rica
    • Windows: %LOCALAPPDATA%/tedana/rica
  2. Copy to Output: Rica files (index.html, rica_server.py, favicon.ico) are copied to output_dir/rica/

  3. Generate Launcher: A cross-platform launcher script (open_rica_report.py) is created in the output directory

  4. Visualize: Users run the launcher script to start a local server and open Rica in their browser

Usage

# Run tedana with Rica report generation
tedana -d echo*.nii.gz -e 14.5 29.0 43.5 --out-dir output --rica-report

# After workflow completes, visualize results
cd output
python open_rica_report.py

The launcher script:

  • Starts a local HTTP server with CORS support
  • Automatically finds an available port if the default (8000) is busy
  • Opens Rica in the default browser
  • Rica automatically loads the tedana output files

⚠️ Dependency: Rica v2.0.0 Required

This PR depends on Rica v2.0.0 being released with build assets.

The Rica repository needs to:

  1. Merge the modernize-app-performance branch (which includes the GitHub Actions workflow for creating releases with build assets)
  2. Create and push a v2.0.0 tag to trigger the release

Until then, the --rica-report flag will show a warning that Rica could not be downloaded. Users can still use the standard HTML report.

Testing

  • Successfully tested with OpenNeuro dataset ds005118 (5-echo resting-state fMRI)
  • All 18 unit tests pass
  • Verified on macOS (should work on Linux and Windows as well)

Test Plan

  • Wait for Rica v2.0.0 release
  • Run tedana with --rica-report flag and verify Rica files are downloaded
  • Verify open_rica_report.py opens Rica correctly
  • Test on Linux and Windows
  • Consider adding to integration tests

🤖 Generated with Claude Code

eurunuela and others added 3 commits December 19, 2025 16:47
This commit adds the ability to generate Rica interactive reports
directly from tedana output directories.

New features:
- Add tedana/rica.py module for Rica download and report generation
- Add --rica-report flag to tedana and ica_reclassify workflows
- Download Rica from GitHub releases and cache locally
- Generate open_rica_report.py launcher script in output directory
- Cross-platform support for Linux, macOS, and Windows

When --rica-report is used:
1. Rica files are downloaded from ME-ICA/rica GitHub releases (cached)
2. Files are copied to output_dir/rica/
3. A launcher script (open_rica_report.py) is created
4. Users can run the script to visualize ICA components in Rica

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document the --rica-report flag and explain how to use Rica
for interactive ICA component visualization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use typing module imports (Optional, Union, Tuple, Dict) instead of
Python 3.10+ syntax (str | None, str | Path) for type annotations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Dec 20, 2025

Codecov Report

❌ Patch coverage is 51.16279% with 63 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.63%. Comparing base (e093290) to head (0baa961).

Files with missing lines Patch % Lines
tedana/rica.py 55.17% 49 Missing and 3 partials ⚠️
tedana/workflows/ica_reclassify.py 14.28% 5 Missing and 1 partial ⚠️
tedana/workflows/tedana.py 16.66% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1288      +/-   ##
==========================================
- Coverage   89.73%   88.63%   -1.11%     
==========================================
  Files          29       30       +1     
  Lines        4403     4531     +128     
  Branches      730      751      +21     
==========================================
+ Hits         3951     4016      +65     
- Misses        299      357      +58     
- Partials      153      158       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Make Rica more accessible from tedana

1 participant