Skip to documentation
PREPARE MY DATA

LMBC User Guide

0.1.0.dev0Development documentation

Run adult MRI and export website CSVs

Use Python 3, Docker and a valid FreeSurfer license. Run the commands from the LMBC source directory containing tools/run_multimodal.py. Your installation needs the local image for the selected workflow. See installation and image builds.

Set the paths

Use an existing BIDS dataset and a separate writable results directory. In the same terminal, set:

BIDS=/path/to/study/bids
OUT=/path/to/study/results
LICENSE=/path/to/license.txt

Place the scan table in the BIDS root or add --demographics /path/to/table.csv. Website export requires both Group (HC/DX) and QC_Passed (Yes/No). Record the research team's QC decision. A successful processing run or a high QEI alone cannot establish a pass.

Choose one command below. Add --dry-run to check the selected inputs before processing. By default the command selects all participants and sessions. Use --participant-label 001 --session-label baseline to select one visit.

Structural only

T1w provides anatomy, regional morphometry and MIND. An available T2w can also be used. This profile selects anatomical images even in a dataset containing BOLD or ASL.

python3 tools/run_multimodal.py struct "$BIDS" "$OUT" --fs-license-file "$LICENSE"

Structural and functional

Use T1w and resting-state BOLD from the same visit for structural measures, FC and MIND–FC coupling. Each selected resting-state acquisition needs at least 80 volumes. The minimum applies separately to each run.

python3 tools/run_multimodal.py struct-func "$BIDS" "$OUT" --fs-license-file "$LICENSE"

ASL perfusion

Use T1w and raw ASL from the same visit. T1w provides the anatomical reference for CBF. This command exports perfusion measurements. To also obtain structural phenotypes from a visit with T1w and ASL, run struct and asl using the same BIDS and output directories.

python3 tools/run_multimodal.py asl "$BIDS" "$OUT" --fs-license-file "$LICENSE"

Structural, functional and ASL

Use all three inputs. The launcher checks both sets of inputs, then runs QuNex/HCP and ASLPrep in an isolated visit directory. It publishes the visit for group export only when both branches succeed.

python3 tools/run_multimodal.py struct-func-asl "$BIDS" "$OUT" --fs-license-file "$LICENSE"

Check errors and repeat a visit

The adult dataset command lists the participant, session and reason for each failed intake check. Open the reported logs/dataset/<run>/preflight.csv for the table. Individual processing failures have a worker log and run summary. ASL prints its selected-visit errors and saves a failed processing preflight to .lmbc-diagnostics/asl-preflight-*.json. Its dry run prints the checks to the terminal. In a combined run, a failed container preflight also saves the diagnostic output to .lmbc-diagnostics/combined-*.log. Read the filename, measured value and expected input before editing your submission.

Example What to do
A resting-state BOLD has 40 volumes Check the original series and export. Select a complete run with at least 80 volumes.
An ASL scan has more volumes than context rows Recover the acquisition-order context from the scanner record and check the M0 association.
Two rows claim the same visit, or the visit lacks a required value Correct the scan table using the original study record. Keep one unambiguous row per visit.
The group command names a missing, failed or outdated visit Correct or run that visit, or explicitly select the intended smaller cohort, then repeat the group command.

Repeat the original command after correcting inputs. Unchanged inputs with verified outputs return the existing visit. A change to the selected images, acquisition metadata, demographics (including sex or QC), processing settings or runtime starts that workflow from scratch. Use --overwrite to force a clean run with identical inputs, or after a failed, interrupted or damaged run with identical inputs. Older results without a verified input record also require --overwrite. Running only struct after struct-func publishes the new structural scope and records the withdrawn FC and coupling tables. Select struct-func again when those families are required. Earlier results remain on disk. A failed attempt cannot enter a new cohort export. Use a separate results directory for a different dataset.

Review the ASL outputs

ASLPrep 25.1.0 runs BASIL and SCORE/SCRUB. The launcher selects the standard-space BASIL CBF map in MNI152NLin2009cAsym and reads qei_cbf_basil from the same acquisition. For calibration, the default M0 multiplier is 1. Use --m0-scale only with the multiplier established for the protocol. The historical UKB and ADNI4 recipes used 10. Run protocols requiring different multipliers separately.

Within the participant/session directory under Results_PostPre, open asl/. Review the ASLPrep HTML report, CBF image alignment to anatomy, the QC TSV and regional coverage in roi/<scan>/qc.json. The automatic QC measurements accompany the team's separate QC_Passed decision.

CBF means use positive finite voxels. Global gray and white matter use standard TemplateFlow probability maps thresholded at 0.7. Each acquisition can produce six website CSVs: gray matter, white matter, 14 subcortical regions, and DK68, DK219 and DK448 cortex. The 38-atlas research tables also include Schaefer200 seven- and seventeen-network summaries.

A normal ASL rerun starts from the original data. For an explicit external derivative import, run-asl --derivatives /derivatives also requires the LMBC verification record, matching raw inputs, visit, calibration, configuration and derivative file hashes. An older ASLPrep TOML alone is insufficient. When provenance is missing, use the raw ASL command above.

Find participant files and merge the cohort

In each participant/session directory, website/struct-func/current.json lists the latest structural or structural/functional CSVs. website/asl/current.json lists ASL CSVs. Follow each manifest's relative paths. Each file holds one observation and one measurement type at one level or atlas, such as DK68 cortical thickness. CSV columns follow the matching chart template.

Structural TotalSurfArea and TotalFoldInd are the sums of both hemispheres, in the same units as the current website fits. Retain CSV provenance sidecars alongside the participant files.

Run the group command on the same dataset and results paths:

python3 tools/run_multimodal.py group "$BIDS" "$OUT"

Use --participant-label 001 002 --session-label baseline to select a smaller cohort. Add --require-profile struct-func-asl if every selected visit must have both branches. The other allowed values are struct, struct-func and asl. Without a required profile, the merge includes the available current adult and ASL publications for each selected visit. Add --dry-run to validate the selection without publishing. A missing or stale expected visit stops the merge and identifies the visit to repair.

Open $OUT/group-csv/current/manifest.json to check the roster, source counts and recorded measurement skips. Choose the matching CSV from $OUT/group-csv/current/. After a successful smaller merge, this directory contains only the new selection. Older batches remain under history/. If a merge fails, the previous successful batch is still visible. Check the command exit status and roster before uploading. The merge keeps visits and runs distinct and writes one file per template, metric and processing recipe. The group step uses the structural/functional image, including for an ASL-only cohort. Upload the file to the matching chart, then select Validate CSV and Estimate deviation. See same-site healthy control requirements.