Backend Overview
FORGE Studio supports five reconstruction backends. Each backend corresponds to a different runtime environment.
| Backend | Key | Runtime | Config format |
|---|---|---|---|
| Python | python | External Python 3 | JSON |
| Julia | julia | External Julia | JSON |
| MATLAB | matlab | External MATLAB | JSON |
| MATLAB Runtime | runmat | Bundled MCR (read-only) | JSON |
| FORGE (C++/CUDA) | forge | Bundled binaries | CLI flags |
How Backends Execute
Script Backends (Python, Julia, MATLAB)
Script backends use a persistent session model:
- On the first stage for a backend, FORGE Studio spawns the interpreter with the
forge_dispatcherscript. - The dispatcher signals
readyvia theFORGE_RESP:protocol on stdout. - For each step, FORGE Studio writes a JSON config file and sends a
runcommand to the session. - The dispatcher loads and calls your module's
run()function. - Progress, logs, convergence metrics, and image previews are streamed back in real time via
FORGE_RESP:events. - Subsequent stages on the same backend reuse the same session — cold-start latency only once per job.
FORGE Studio (Node.js)
│
│─── stdin: {"type":"run","module_path":"...","config_path":"..."} ───►
│ │
│◄── stdout: FORGE_RESP:{"type":"log","message":"starting"} ──────────│
│◄── stdout: FORGE_RESP:{"type":"progress_tick",...} ─────────────────│
│◄── stdout: FORGE_RESP:{"type":"ok","output_paths":["..."]} ─────────│
interpreter processFORGE Backend
FORGE binaries are invoked directly as child processes with CLI flags — no persistent session. Each stage spawns a new process. Progress and metrics are read from stderr as JSONL events.
Config File
For script backends, FORGE Studio writes a JSON config file to the stage output directory before calling run(). Your module receives the path as its only argument.
{
"job_id": "abc-123",
"step_id": "espirit_calib",
"stage_index": 0,
"input_paths": ["/data/scan.dat"],
"output_dir": "/output/stage_0_sensitivity_calibration",
"input_format": "twix",
"channels": 32,
"params": {
"calibration_size": 24,
"use_gpu": true
}
}See Config Format Reference → for the full field list.
Stage Chaining
Each stage receives the outputs of the previous stage as its input_paths. Stage 0 receives the original raw file. This enables multi-stage pipelines where, for example:
- Stage 0 (Python): reads TWIX, produces calibration maps →
.npy - Stage 1 (FORGE): reads calibration maps, produces reconstruction →
.nii - Stage 2 (Julia): reads NIfTI, applies post-processing →
.nii
input_format is detected from the file extension of input_paths[0]:
| Extension | Format value |
|---|---|
.dat | twix |
.h5, .hdf5 | ismrmrd |
.mat | mat |
.jld2 | jld2 |
.npy, .npz | npy / npz |
Configuring Backend Paths
Go to Settings → Backends to set or override the executable path for each backend. Paths are auto-detected at startup but can be overridden:
- Browse — opens a file picker to select the executable.
- Validate — checks the path and reports the detected version.
Detection order (macOS):
- MATLAB:
/Applications/MATLAB_*.app, thenPATH - Python:
python3onPATH, then common Homebrew/pyenv paths - Julia:
/Applications/Julia-*.app, thenPATH
Compute Backend (FORGE)
FORGE binaries are available in three variants, selected automatically based on hardware:
| Variant | Platform |
|---|---|
metal | Apple Silicon (macOS) |
cuda | NVIDIA GPU (Linux) |
cpu | Any (fallback) |
Override in Settings → Compute Backend.