Skip to documentation
PREPARE MY DATA

LMBC User Guide

0.1.0.dev0Development documentation

Installation

LMBC separates the Python interface from the neuroimaging runtime. Install the Python package to inspect inputs and generate plans. Image processing additionally requires the external software and reference resources associated with the selected workflow.

System requirements

Environment Intended use Additional requirements
Python ≥3.9 Input checks, workflow planning, and Python modules Dependencies declared in pyproject.toml
Linux AMD64 QuNex-derived runtime Adult QuNex/HCP processing FreeSurfer license and atlas, mesh, and template resources
Linux AMD64 ASLPrep 25.1.0 runtime Adult perfusion measurements BASIL, the versioned ASL atlas and tissue resources, and a FreeSurfer license
Infant runtime or an equivalently configured environment Import of iBEAT reconstructions and downstream processing Matched iBEAT outputs, infant resource configuration, and applicable tool licenses

The Python installation does not install QuNex, FreeSurfer, FSL, AFNI, or Connectome Workbench. Python 3.11 is used in an existing CI configuration. Runtime and memory requirements depend on the images and selected stages; a general minimum has not been established by the current validation runs.

Install from source

From the LifespanNormativeTools repository root:

python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[test]'
lmbc --version
lmbc --help

The current version command reports lmbc 0.1.0.dev0. These commands install a local source checkout; they do not imply an available PyPI release. To verify the planning interface without external neuroimaging tools, continue with the first dry run.

Build the adult runtime

The adult image is defined by containers/Dockerfile.qunex. Its base images are pinned by digest, and LMBC uses a separate Python environment within the QuNex runtime.

Before building, provision the versioned resource bundle from an external archive containing TianHe_Code. Its generated resources/adult/manifest.json records SHA256 hashes. The generated resource bundle stays outside Git.

.venv/bin/python tools/package_adult_resources.py resources/adult \
  --reference-root /path/to/reference-archives

The packager refuses to overwrite differing resources. It also builds a small, verified fsaverage5 source for annotation projection: vertex identity is checked against fsaverage and the required source geometry is sampled without interpolation. This source is not a new anatomical reconstruction or a morphometry template.

docker buildx build --platform linux/amd64 --load \
  -f containers/Dockerfile.qunex -t lmbc:struct-func -t lmbc:qunex-0.93.6 .
docker run --rm --platform linux/amd64 lmbc:qunex-0.93.6 --version

lmbc:struct-func is the adult launcher image. The second tag supports the existing infant build and advanced QuNex examples. Record the resulting image digest or exported archive checksum with the analysis. Configure a valid FreeSurfer license in the runtime and mount the resources required by your selected pipeline.

Build the ASL runtime

For asl and struct-func-asl, build the adult image above first, then package the ASL resources and build the ASL image. The build uses the pinned ASLPrep 25.1.0 base and copies the LMBC application environment from lmbc:struct-func.

.venv/bin/python tools/package_asl_resources.py /path/to/ASLcode resources/asl
docker buildx build --platform linux/amd64 --load -f containers/Dockerfile.asl -t lmbc:asl-25.1.0 .
docker run --rm --platform linux/amd64 lmbc:asl-25.1.0 run-asl --help

The launcher mounts your FreeSurfer license read-only. First use can download registration templates to the Docker volume lmbc-aslprep-25-1-templateflow. For redistribution, build from a base whose layers are free of private licenses. For an existing provisioned QuNex base, see containers/Dockerfile.adult-release and containers/README.md in the source repository.

Build the infant runtime

The infant Dockerfile extends the local adult runtime and adds the infant Python implementation and plotting dependencies. Build or provide lmbc:qunex-0.93.6 first, then run:

docker build --platform linux/amd64 \
  -f containers/Dockerfile.infant -t lmbc:infant .
docker run --rm --platform linux/amd64 lmbc:infant --help

Input images and the infant resource configuration are mounted at runtime. The image reuses the installed neuroimaging tools; it does not run iBEAT or invoke the adult structural workflow. See the infant workflow for resource roles and execution examples.

Execution environment

Use separate locations for input data and generated outputs. Mount source data read-only where possible. Ensure that symbolic-link targets remain accessible inside the container; copying a directory of links does not copy their target images.

Linux AMD64 is the image target. Apple Silicon emulation is useful for development but does not establish production performance or numerical equivalence. The offline SingularityCE guide covers the local SIF artifact, transfer, and adult/infant commands. Full processing on the target server still requires environment-specific verification.

Build the documentation

The documentation has a separate, lightweight environment:

python3 -m venv .venv-docs
.venv-docs/bin/python -m pip install -r requirements/docs.txt
.venv-docs/bin/python -m mkdocs build --strict
.venv-docs/bin/python -m mkdocs serve -a 127.0.0.1:8000

The local preview uses port 8000, and the static build is written to build/documentation/. Building the documentation does not publish it.