Skip to content

[3/3] feat(gallery): bidsvue-ingest, BIDSvue's import without the window - #14

Merged
cdrake merged 6 commits into
mainfrom
nf/3-bidsvue-ingest
Oct 16, 2026
Merged

cdrake merged 6 commits into
mainfrom
nf/3-bidsvue-ingest

Conversation

@cdrake

@cdrake cdrake commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Stack

  1. [1/3] test(mcp): TMPDIR-safe default_checkout test #12 test(mcp): TMPDIR-safe default_checkout test
  2. [2/3] feat(gallery): app-cli adapter for an app's headless entry point #13 app-cli adapter for an app's headless entry point
  3. [3/3] feat(gallery): bidsvue-ingest, BIDSvue's import without the window #14 bidsvue-ingest, BIDSvue's import without the window ← this PR

What

gallery/tools/bidsvue-ingest.tool.json: BIDSvue's DICOM to BIDS import as a non-interactive step over the app-cli adapter (#13). It runs bun run neuroflow-ingest --neuroflow-session <dir> in the BIDSvue checkout, the same import the BIDSvue app runs. That is BIDSvue's package script, which runs svelte-kit sync first, so the checkout needs bun install; the probe reports needsSetup when it hasn't been run.

  • Inputs: dicom_dir, importer (default dcm2niix-reproin), subject, session, anonymize, shift_dates, save_derivatives.
  • Output: bids_dir.
  • MCP: title "DICOM to BIDS (BIDSvue, headless)", maxWaitMs 15 min.

BIDSvue branches, replacing the old neuroflow-aware:

  • bidsvue-ingest names neuroflow/window-ingest for now, since that branch has the CLI. Switch it to main once feat(neuroflow): headless DICOM ingest CLI niivue/BIDSvue#18 merges.
  • bidsvue (the interactive window tool) names neuroflow/window-ingest. The window's NeuroFlow mode isn't going to main for now, and that branch carries both the window mode and the CLI. The crlab-ingest demo, which uses the window, names it too.

NeuroVue's branch is unchanged.

Readiness probe and checkout lookup (audit fixes)

  • Probe: neuroflow/app-cli takes an optional probe, a readiness check the app defines. bidsvue-ingest runs BIDSvue's neuroflow-ingest --check (added in Neurodesk wiring: name-aware auto-binding and a WASM validator with tools #18), which checks dcm2niix. The probe runs in the checkout. check_tool (the Environment panel) and app_cli.mjs (before a run) both use one helper, resolveAppCli. When the check fails, they show the app's own problems and the tool's advice. Before this, the panel could show the tool as ready even with no usable dcm2niix.
  • Checkout lookup: the JS lookup now matches the runtime's default_checkout.
    • An override that isn't a directory falls through to the sibling.
    • The walk starts at the registry root.
    • A same-named sibling without the entry file is skipped, and the message names it.
  • Smaller changes:
    • app_cli.mjs checks that its inputs exist.
    • The description now matches the args.
    • Three MATLAB session tests skip where ps -A isn't available. They failed on main too.
  • Record: audit_response.md has the full audit response, the deferred items and the merge order.

Merge order

Merge after niivue/BIDSvue#18, which adds scripts/neuroflow-ingest.ts. Until then the tool needs a BIDSvue checkout of neuroflow/window-ingest. On any other branch, check_tool reports "has no scripts/neuroflow-ingest.ts; check out neuroflow/window-ingest there".

Test

  • npm run validate:gallery (19 documents conform).
  • npm run test:gallery: 68 pass, 0 fail, 1 skipped. New tests cover the sibling lookup, the override fallthrough, a missing runner and the probe. npm run test:ui and cargo test -p neuroflow-mcp pass too.
  • check_tool --tools-dir gallery/tools: bidsvue-ingest is ready (adapter app-cli, dcm2niix v1.0.20260724 from the probe) against a BIDSvue checkout of neuroflow/window-ingest. With DCM2NIIX=/nonexistent it reports needsSetup with BIDSvue's message.
  • Earlier end-to-end run on a real Siemens scan, via the CLI and via MCP neuroflow_run: about 55 s, a valid BIDS dataset, and a handoff plus provenance line.

🤖 Generated with Claude Code

cdrake and others added 6 commits October 13, 2026 15:36
… the window

A script tool over the app-cli adapter: app_cli.mjs runs
`bun run scripts/neuroflow-ingest.ts --neuroflow-session <dir>` in the
BIDSvue checkout, which runs the same import pipeline as the window and
writes the BIDS dataset, handoff and provenance. Its settings (importer,
subject, session, anonymize, shift_dates, save_derivatives) come from the
step inputs, so it runs non-interactively, including over MCP.

The BIDSvue NeuroFlow support lands on niivue/BIDSvue main, so the
bidsvue and bidsvue-ingest tools and the docs now name `main` instead of
the old `neuroflow-aware` branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndow-ingest

BIDSvue's NeuroFlow work is now one PR (niivue/BIDSvue#18), the headless
ingest that bidsvue-ingest runs; it is headed for main. The window's
NeuroFlow mode, which the bidsvue tool and the crlab-ingest demo need, stays
on the neuroflow/window-ingest branch for now. That branch carries both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he checkout as the runtime does

The Environment panel could mark bidsvue-ingest ready while BIDSvue had no
usable dcm2niix. neuroflow/app-cli now takes an optional probe that the app
defines (BIDSvue: neuroflow-ingest --check, which prints { ready, problems[] }),
run in the checkout by both app_cli.mjs and check_tool.mjs through a shared
resolveAppCli. runProbe is shared with cli_tool.mjs.

The JS checkout lookup now matches registry.rs default_checkout: a bad
override falls through to the sibling, and the walk starts at the registry
root. A sibling only counts when it holds the entry file, so BIDSvue's
$TMPDIR/bidsui cache is skipped, and the message names such directories.

bidsvue-ingest declares branch neuroflow/window-ingest (main once
BIDSvue#18 merges), its probe, and a description that matches its args.
app_cli.mjs also checks that inputs exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The online-license session check reads the process list; in a sandbox that
forbids ps it cannot see sessions, and these three tests failed on main too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t response

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BIDSvue#18's review made `neuroflow-ingest` run `svelte-kit sync` before the
script, so `$lib` resolves in a fresh clone. bidsvue-ingest's job and probe
now call `bun run neuroflow-ingest` instead of the script file, so they get
that step. The probe now also fails (exit 127, needsSetup with the
`bun install` advice) when the checkout has no node_modules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant