The secure, semi-automated mapping of neuroscience data (neurophysiology, neuroimaging and microscopy) to the Brain Imaging Data Structure (BIDS) standard.
| What it is | Where your data goes | Status | |
|---|---|---|---|
| ezBIDS on the web | brainlife.io/ezbids: guided conversion of MRI, PET and MEG in the browser | uploaded to the ezBIDS server for conversion (security FAQ) | in service |
ezBIDS desktop (electron/) |
the same converter as an app, plus AI import (beta): aimport inside, no Docker; no CZI (its reader is GPL-licensed: export to OME-TIFF) | stays on your computer: local store, no telemetry, no AI model | beta: build from source (tested on Mac); signed installers coming |
aimport via bl aimport (aimport/, Python CLI) |
a local importer with an optional AI agent, for neurophysiology (EEG, MEG, iEEG, NIRS, EMG), neuroimaging (MRI, PET) and microscopy | stays on your computer until you approve the upload of the validated, de-identified dataset to brainlife.io | beta: run it from source today; packaged release coming |
Privacy first. With ezBIDS desktop and aimport, raw data never leaves your computer. Identifiers are stripped
from headers, tables and text, faces are removed, dates shifted and event names coded; the output must pass a final
check and the BIDS validator before anything can be uploaded, and you review every decision. The AI model is
optional: it sees only de-identified plan text (identifiers replaced by [x]), never headers, file paths or
pixels, and without one the built-in heuristics do the work. Try it on public sample data first:
aimport/EXAMPLES.md has three low-stakes walkthroughs (MRI, EEG, microscopy) that upload
nothing.
ezBIDS desktop (electron/) is built from the same code as the web service: the converter (a local
store instead of MongoDB) and aimport run on your own computer, with no Docker and no telemetry. Its AI import
(beta) runs the aimport engine bundled in the app (Python, the BIDS validator and the QA viewer included), with no
AI model, so nothing leaves the machine; uploading from the app comes in a later version. Status: beta, build from
source (tested end to end on Mac arm64; Windows and Linux not yet); signed installers coming. To build it, see
Building the Electron app below (run
./fetch-aimport.sh <platform> <arch> too) and docs/aimport-electron.md.
This is the repository for ezBIDS, which converts neuroscience data files (neurophysiology, neuroimaging and microscopy) to BIDS. It has three parts:
- The ezBIDS web service, securely hosted at brainlife.io/ezbids, a semi-supervised conversion of MRI, PET and MEG data in the browser. For additional details on security features, please see here.
- aimport (
aimport/, beta), a local importer that runs on your own computer with an optional AI agent and de-identifies data before anything is uploaded. Besides MRI and PET it imports microscopy (OME-TIFF, CZI, ND2, LIF, SVS, PS-OCT, light-sheet; OME-Zarr datasets read in place; CZI in the Docker engine andbl aimportonly, not in the desktop app) and EEG, MEG, iEEG, NIRS and EMG recordings (BrainVision, EDF, BDF, FIF, SNIRF, NWB and more), with viewers to check the result (Neuroglancer for images, a trace viewer for recordings). - ezBIDS desktop (
electron/, beta), built from the same code: the converter (local store instead of MongoDB) and aimport run on your own computer, with no Docker and no telemetry.
Unlike other BIDS converters, ezBIDS eliminates the need for coding and command line interfaces (CLI), doing the bulk of the work behind the scenes to save users time. Importantly, ezBIDS does not require an organizational structure for uploaded data.
A series of inferenial heuritics analyze the uploaded data to provide a first guess BIDS structure, which is presented to users through the web-browser user interface. Users verify the first guess and modify the information provided as needed so as to best match the final BIDS structure.
Data from all major scanner vendors are accepted by ezBIDS. ezBIDS enables pseudo-anonymization by providing options for the defacing of anatomical sequences, and removes all identifying metadata information (e.g. PatientName) before final conversion to BIDS.
The BIDS output can then be downloaded back to the user's computer, or uploaded to open repositories such as brainlife.io or OpenNeuro.org.
Helpful links:
- ezBIDS website (Chrome or Firefox browsers preferred)
- ezBIDS user documentation
- ezBIDS tutorial
- ezBIDS tutorial video
To access the ezBIDS web service, please visit https://brainlife.io/ezbids. If you do not have a brainlife.io account, you will be prompted to create one for authentication purposes.
Users do not need to organize their uploaded data in any specific manner, and users may choose to compress (e.g. zip, tar) their uploaded data.
Should users feel the need to anonymize data before uploading, we strongly recommend that subjects (and sessions, if applicable) be organized into subject (and session) folders, with explicit labeling of the preferred subjects (and sessions) IDs (e.g. MRI_data/sub-01/ses-01/DICOMS). Failure to do so for non-anonymized data may result in an inaccurate first guess and require additional edits in the web browser.
If users wish to install ezBIDS locally, to ensure that data do not leave their institution site, please see here.
The raw JSON debug panels on the Subjects, Series and Objects pages show DICOM header values such as PatientName, PatientID and PatientBirthDate, so they are off by default, including in a local docker compose install. Developers can turn them on with VITE_DEBUG=true docker compose up.
aimport (aimport/, brainlife.io/aimport) is the local, agentic alternative, in beta: run it from source today; packaged release coming. Its engine (a Docker image with a loopback API, built from this repository) scans a folder on your own computer, proposes the BIDS mapping (with an optional language model that only sees de-identified metadata), de-identifies and defaces the data, validates it against BIDS v1.11.2 and leaves a reviewed output folder ready to upload. bl aimport from the brainlife Python CLI (pybrainlife, branch enh/cli; pip install "git+https://github.com/brainlife/pybrainlife@enh/cli") drives it and uploads the result; it is not yet in a published release. Nothing identifying leaves your machine. Start with the low-stakes walkthroughs in aimport/EXAMPLES.md; the engine's README has the details.
ezBIDS is developed as a monorepo with npm workspaces at the repository root. A single package-lock.json ties versions together; npm install is always run from the repo root (not inside ui/ or electron/ alone). Workspace packages are ui (Vite + Vue) and ezbids-electron (Electron shell under electron/). The Node API lives under api/, the conversion worker under handler/, and both are consumed by the root package and by the Electron bundling scripts.
- Node.js (project targets Node 20; align local and CI versions).
- Docker and Docker Compose for the containerized stack.
- Git submodules (run
git submodule update --init --recursivebefore first build;dev.shdoes this for you).
ezBIDS can be started up in two different ways.
| Area | How it is configured |
|---|---|
| Docker stack | docker-compose.yml: services, ports, bind mounts, and environment: blocks (e.g. MONGO_CONNECTION_STRING, BRAINLIFE_AUTHENTICATION, VITE_APIHOST). Values can reference a .env file in the project directory (Compose variable substitution, e.g. ${BRAINLIFE_AUTHENTICATION}). |
| Electron | electron/main.ts builds an env object (Record<string, string>) that is passed to spawned backend and handler processes and merged with process.env. A smaller rendererEnv subset (IS_ELECTRON, API_HOST, BRAINLIFE_AUTHENTICATION) is assigned onto process.env for the main process and preload. Adjust behavior by changing env before launch or extending that object—not by expecting Compose env vars unless you export them into the shell before starting Electron. |
The API chooses storage based on IS_ELECTRON (see api/config.ts and api/store/index.ts):
- Docker / web-style run:
IS_ELECTRONis unset or nottrue. Session and ezBIDS state use MongoDB viaMONGO_CONNECTION_STRING(Compose wires this to themongodbservice). - Electron: Main sets
IS_ELECTRON: 'true'and clears Mongo for the desktop path (MONGO_CONNECTION_STRING: ''in the spawned env). The API then useselectron-storeon disk instead of Mongo.
So “which database” is really MongoDB vs local electron-store, keyed off Electron mode.
This runs MongoDB, the API (TypeScript via api/dev.sh + tsc-watch inside the container), the handler (handler/handler.ts run with ts-node-dev; it runs the TypeScript steps preprocess.ts, bids.ts, deface.ts the same way), and the UI (Vite dev server) together.
- Start the stack, either:
./dev.sh— updates submodules, runsnpm install(workspaces), Husky prep,./generate_keys.sh, thendocker compose --profile development up(ordocker-composeif that is the binary you have), or- Manually:
docker compose --profile development up(add-dfor detached). Runnpm installat the repo root first if you skippeddev.shand need host-side tooling (Husky, scripts, etc.).
Useful defaults from docker-compose.yml:
- API:
http://localhost:8082(health check on/health).MONGO_CONNECTION_STRINGpoints at themongodbservice.BRAINLIFE_AUTHENTICATIONcomes from your host env /.env. - UI:
http://localhost:3000/ezbids/;ui/docker-entrypoint.shwritesAPI_HOSTandBRAINLIFE_AUTHENTICATIONintopublic/runtime-env.js. A static web build served without that file falls back to the build-timeVITE_APIHOST/VITE_BRAINLIFE_AUTHENTICATION(ui/src/runtimeEnv.ts). Google Analytics loads only in the web UI, never in the desktop app. - Handler: repo is bind-mounted at
/app(it uses the host's rootnode_modules, so runnpm installfirst); MongoDB store, no Electron code is loaded. The image provides the tools in the desktop bundle layout (EZBIDS_BIN_DIR=/opt/ezbids-bin: dcm2niix pinned, 7z, allineate) and its ownpython3. Telemetry is off unlessEZBIDS_TELEMETRY_URLis set (never in the desktop app).
API and UI images are built with context: . at the repo root; see .dockerignore for what is excluded from the build context. The handler image uses build: ./handler (its own context).
Desktop dev uses the Electron main process to spawn the API and handler as child processes and opens a window.
- Install (from repo root):
npm install. - UI in dev: Electron’s main window loads
http://localhost:3000in development. Start Vite in a separate terminal:npm run ui:dev(ornpm run dev -w ui). - Electron: In another terminal from the repo root:
npm run electron:start-dev(runs thestart-devscript in theezbids-electronworkspace).
start-dev (see electron/package.json) runs build:electron-preload and build:electron-main (esbuild bundles preload/preload.ts and electron/main.ts), then starts electron .. Those two entry files are not run through ts-node-dev; after you edit main.ts or preload.ts, rerun npm run electron:start-dev (or the individual build:electron-main / build:electron-preload scripts) so the bundles under electron/dist / preload output stay in sync.
Hot reload applies to almost everything else in dev: main.ts spawns ts-node-dev for api/ezbids.ts and handler/handler.ts with --watch on those directories, so changes under api/ and handler/ reload without restarting Electron (see startBackend / startHandler in electron/main.ts).
Packaged / production-style Electron uses pre-bundled .cjs files and the built UI; that path is heavier—see npm run electron:pack and fetch-binaries.sh when you need native binaries under handler/bin.
For local Electron development, local RSA private/public keys and signing/notarization keys are not utilized. You can run npm run electron:start-dev without them.
Electron build and packaging logic is split between root workspace scripts (package.json) and Electron-local scripts (electron/package.json).
Root helper scripts (run from repo root):
npm run fetch-binaries:macos->./fetch-binaries.sh darwin arm64npm run fetch-binaries:linux->./fetch-binaries.sh linux amd64npm run fetch-binaries:windows->./fetch-binaries.sh windows amd64npm run electron:pack-test-> run Electron build, thenelectron-builder --dir(unsigned/unpacked app output for testing packaging contents; run afetch-binaries:*script first ifhandler/binis missing)npm run electron:pack-> full build +electron-builderdistributables (DMG/EXE/AppImage/DEB depending on platform/target)
Note: packaging/signing keys (for example Apple certificate/API key variables) are only needed for signed release workflows, not for local desktop development.
Electron workspace scripts (in electron/package.json):
build:electron-apibundlesapi/ezbids.ts->electron/dist/ezbids.cjsbuild:electron-handlerandbuild:electron-handler-scriptsbundlehandler/*.tsentry points ->electron/dist/handler/*.cjsbuild:electron-python,build:electron-templates,build:electron-bids-speccopy runtime resources intoelectron/distbuild:electron-frontendtriggers the UI workspace build for Electron outputbuild:electron-mainandbuild:electron-preloadbuild desktop entry filesbuild:electronruns the full chain aboveapp:dirandapp:distinvokeelectron-builder;app:build-distruns full build then dist
About fetch-binaries.sh:
- Fetches native/runtime assets from
brainlife/ezbids-binariesreleasevX.X.Xand extracts tohandler/bin(0.0.5 at the time of writing this). - Usage:
./fetch-binaries.sh <platform> [arch], whereplatformis one ofdarwin|linux|windowsandarchisamd64|arm64. - Requires
curl,jq,tar,unzip; for private repo access setGITHUB_TOKEN. - Run this before packaging whenever
handler/binis missing/outdated for your target platform.
- API only (no Docker):
npm run devrunsts-node-devon./api/ezbids.ts(you must provide Mongo and paths yourself, e.g.MONGO_CONNECTION_STRING, upload/workdir env vars as inapi/config.ts). - Transpile / production API:
npm run prod(TypeScript compile then Node on./build/ezbids.js). - Tests / style:
npm test,npm run lint-check,npm run style-checkat the root; Husky is set up vianpm run prepare-husky(also invoked fromdev.sh). - Desktop release builds: CI and local packaging use scripts under
electron/package.json(e.g.build:electron,app:dist); see.github/workflows/build-desktop.yml.
- Daniel Levitas*
- Soichi Hayashi*
- Sophia Vinci-Booher
- Anibal Heinsfeld
- Dheeraj Bhatia
- Nicholas Lee
- Anthony Galassi
- Guiomar Niso
- Franco Pestilli
- Both authors contributed equally to this project
brainlife.io is publicly funded, and for the sustainability of the project it is helpful to acknowledge the use of the platform. We kindly ask that you acknowledge the funding below in your code and publications. Copy and past the following lines into your repository when using this code.
ezBIDS and aimport are developed by the Pestilli Lab at The University of Texas at Austin; please also acknowledge The University of Texas at Austin.
Please cite the ezBIDS paper when you publish data converted with ezBIDS or aimport:
Levitas, D., Hayashi, S., Vinci-Booher, S., Heinsfeld, A., Bhatia, D., Lee, N., Galassi, A., Niso, G. & Pestilli, F. (2024). ezBIDS: Guided standardization of neuroimaging data interoperable with major data archives and platforms. Scientific Data, 11, 179. doi:10.1038/s41597-024-02959-0
ezBIDS and aimport are developed by the Pestilli Lab at The University of Texas at Austin and built on many open-source tools. CREDITS.md lists the BIDS papers to cite for your data type and every tool we build on, with its licence and citation (CITATION.cff is the machine-readable version).
Copyright © 2022 brainlife.io at The University of Texas at Austin
