Skip to documentation
PREPARE MY DATA

LMBC User Guide

0.1.0.dev0Development documentation

Offline SingularityCE execution

This archived SIF predates the unified adult launcher and the ASLPrep extension. Use the Docker run guide for the current four profiles and website exports.

The local lmbc-0.1.0.dev0-qunex-infant-linux-amd64.sif image targets an x86_64 Linux server running SingularityCE 3.9.2. It contains LMBC source a213300d, QuNex 0.93.6 and its HCP neuroimaging tools, the adult resource bundle, and the infant resource bundle. No registry, Python installation, or network connection is needed on the server. Input data, a writable output directory, and a valid FreeSurfer license remain site-specific.

The SIF is generated locally in dist/ and is excluded from Git. The maintained recipe is containers/Singularity.def; containers/build_singularity.sh checks the pinned local OCI image and infant manifest before conversion. On a build machine with Docker and the pinned OCI image present, run from the repository root:

bash containers/build_singularity.sh

The build machine downloads the Apptainer builder image if it is not cached. The resulting SIF and its .sha256 file are in dist/. Copy both to the server. Verify the transfer there:

cd /path/to/images
sha256sum -c lmbc-0.1.0.dev0-qunex-infant-linux-amd64.sif.sha256
SIF="$PWD/lmbc-0.1.0.dev0-qunex-infant-linux-amd64.sif"
singularity inspect "$SIF"
singularity run --cleanenv "$SIF" --version-json
singularity run --cleanenv "$SIF" inventory --require-qunex
singularity run --cleanenv "$SIF" run-infant --help
singularity exec --cleanenv "$SIF" \
  /opt/ANTs/ANTs/bin/antsRegistration --version

Use paths that are visible on the server; the following examples do not require the source checkout. --cleanenv keeps unrelated host Conda, Python and tool settings out of the run. The image is read-only. Source data are mounted read-only, while LMBC writes to the bound output directory.

Adult BIDS data

Prepare a BIDS dataset and demographics table beforehand. The demographics table can be in the BIDS root; an external table must also be bound and passed with --demographics. Set these paths to your server locations:

SIF=/path/to/images/lmbc-0.1.0.dev0-qunex-infant-linux-amd64.sif
BIDS=/path/to/study/bids
OUT=/path/to/study/lmbc-output
LICENSE=/path/to/license.txt
mkdir -p "$OUT"

singularity run --cleanenv \
  --bind "$BIDS:/data:ro" \
  --bind "$OUT:/output" \
  --bind "$LICENSE:/opt/freesurfer/freesurfer-6.0/license.txt:ro" \
  "$SIF" run-qunex /data /output \
  --dataset StudyName --n-cpus 16 --jobs 4 --dry-run

Review the preflight.csv and plan.json under $OUT/logs/dataset/<run-id>/, then run the same command without --dry-run. Omit --participant-label to select the entire cohort, or add --participant-label 001 --session-label baseline for one session. Size --n-cpus, --jobs, memory, and wall time to the allocation supplied by your server or scheduler. The container does not reserve resources itself.

After processing, regenerate QC with the same BIDS and output mounts:

singularity run --cleanenv \
  --bind "$BIDS:/data:ro" --bind "$OUT:/output" \
  "$SIF" qc /output

For an external demographics file, bind its parent directory read-only (for example --bind /host/metadata:/metadata:ro) and pass --demographics /metadata/demographics.tsv to the run command. Reuse those mounts for QC, because the processing metadata records container-visible paths. See Adult processing for sharding, resume, and QC review.

Infant iBEAT data

The infant workflow expects prepared iBEAT VTK reconstructions and its batch TXT; it does not create missing iBEAT reconstructions from raw MRI. The versioned resource roles and manifest are already inside the SIF at /opt/lmbc/infant-resources/resources.json.

SIF=/path/to/images/lmbc-0.1.0.dev0-qunex-infant-linux-amd64.sif
INPUT=/path/to/infant/Input
OUT=/path/to/infant/Output
LICENSE=/path/to/license.txt
mkdir -p "$OUT"

singularity run --cleanenv \
  --bind "$INPUT:/input:ro" --bind "$OUT:/output" \
  --bind "$LICENSE:/opt/freesurfer/freesurfer-6.0/license.txt:ro" \
  "$SIF" run-infant /input /output \
  --batch /input/study_batch.txt \
  --resources /opt/lmbc/infant-resources/resources.json \
  --stage all --dry-run

Check /output/infant-plan.json and any reported missing input or resource paths. Remove --dry-run to process; add --resume when continuing a prior run. See iBEAT infant processing for batch fields and stage behavior.

Operational notes

  • A SIF is a single immutable file; keep the .sha256 alongside it and record its digest, LMBC source commit, command, and input metadata with each study. Copying the SIF does not copy the study data or FreeSurfer license.
  • The image is linux/amd64; an ARM server cannot run it natively. This build was exercised under SingularityCE 3.9.2 in a Linux AMD64 container. Adult and infant dry runs passed. On the Apple Silicon build host, antsRegistration --version exits with an illegal instruction under AMD64 emulation in both the source OCI image and the SIF. Run the explicit ANTs command above on the native x86_64 server before full preprocessing. An end-to-end run on the target Ubuntu 16.04 server remains to be checked.
  • Symlinks in BIDS or infant input must resolve inside the container. Bind their target directories as well, or materialize the links before running.
  • The adult package resources and infant resources are frozen in this image. Updating source code, resources, or Docker images requires a new SIF and a new checksum. Keep the old SIF for reproducible resumes and comparisons.