Skip to content

Add createMosaic mutation and related functionality - #4012

Merged
nellh merged 9 commits into
OpenNeuroOrg:masterfrom
jbwexler:feat/mosaic
Sep 16, 2026
Merged

nellh merged 9 commits into
OpenNeuroOrg:masterfrom
jbwexler:feat/mosaic

Conversation

@jbwexler

@jbwexler jbwexler commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

This sets up the basics for incorporating the bids-mosaic tool into openneuro:

  1. Adds a createMosaic mutation that runs bids-mosaic on a particular dataset/snapshot, saves the output pdf to /datalad/mosaics/<dataset>/<dataset>-<hexsha>_mosaic.pdf, and then triggers the updateMosaic mutation to update the database.
  2. Adds a boolean mosaic query within snapshot, indicating whether bids-mosaic has been run.

I haven't added any tests yet but happy to do so once everything else is ready to go.

I thought I would start with the basics here and then we can discuss whether we want to incorporate it within the UI and/or have it be auto-triggered. Another idea from @effigies was to keep the 2D images annexed in a separate branch so unchanged images don't have to be regenerated when running on a future snapshot (currently they get created in /tmp and then deleted).

@nellh nellh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments. This looks pretty good, if we're keeping the mosaics in the datasets volume we'd just need an endpoint to serve them (on_get for the mosaic handler would work) and a resolver for that. The advantage of moving them into a branch is we could reuse the git object endpoint to stream them but that might not be worth the added complexity.

Let's start with an admin tab button to trigger mosaic creation and automate if that seems to be working well?

Comment thread services/datalad/datalad_service/tasks/mosaic.py Outdated
Comment thread services/datalad/datalad_service/tasks/mosaic.py Outdated
Comment thread packages/openneuro-server/src/graphql/resolvers/mosaic.ts Outdated
@codecov

codecov Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.93358% with 114 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.32%. Comparing base (f58c1f1) to head (1577c20).

Files with missing lines Patch % Lines
...s/openneuro-server/src/graphql/resolvers/mosaic.ts 15.38% 55 Missing ⚠️
...pp/src/scripts/dataset/mutations/create-mosaic.jsx 44.00% 28 Missing ⚠️
packages/openneuro-server/src/handlers/datalad.ts 0.00% 13 Missing ⚠️
...o-app/src/scripts/dataset/routes/admin-datalad.jsx 12.50% 7 Missing ⚠️
packages/openneuro-server/src/routes.ts 0.00% 6 Missing ⚠️
...ervices/datalad/datalad_service/handlers/mosaic.py 94.28% 2 Missing ⚠️
...es/openneuro-server/src/graphql/schema/mutation.ts 92.85% 1 Missing ⚠️
...es/openneuro-server/src/graphql/schema/snapshot.ts 75.00% 1 Missing ⚠️
services/datalad/datalad_service/tasks/mosaic.py 98.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4012      +/-   ##
==========================================
+ Coverage   50.27%   50.32%   +0.05%     
==========================================
  Files         696      701       +5     
  Lines       38930    39201     +271     
  Branches     2122     2123       +1     
==========================================
+ Hits        19571    19728     +157     
- Misses      19189    19303     +114     
  Partials      170      170              

☔ View full report in Codecov by Harness.
📢 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.

@nellh
nellh merged commit 20cce3b into OpenNeuroOrg:master Sep 16, 2026
18 checks passed
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.

2 participants