Local#
Run MEGPrep#
The example below runs the default full MEG workflow with an existing
FreeSurfer/DeepPrep SUBJECTS_DIR. Add --steps all if structural MRI
processing should run in the same command.
docker run --rm -it \
-v /data/datasets/SMN4Lang:/input \
-v /data/datasets/SMN4Lang/megprep_out:/output \
-v /data/datasets/SMN4Lang/smri:/smri \
-v /data/megprep/license.txt:/fs_license.txt \
-v /data/nextflow.config:/program/nextflow/nextflow.config \
cmrlab/megprep:0.0.3 \
-i /input \
-o /output \
--fs_license_file /fs_license.txt \
--fs_subjects_dir /smri \
--steps meg_all \
--resume
In this command:
-itRun in interactive mode, allowing users to interact within the container.
--rmThis option automatically removes the container after it exits, ensuring no residual containers remain.
- Output ownership
The container entrypoint starts as root only long enough to prepare mounted output permissions, then runs Nextflow as the host UID/GID inferred from
/input. Report-only runs that only mount/outputinfer ownership from/outputinstead. You do not need Docker’s--userflag or a pre-created output directory. If neither mount has the desired output owner, add-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)"to thedocker runcommand.
-v /data/datasets/SMN4Lang:/inputThis option creates a volume mount, mapping the host directory /data/datasets/SMN4Lang to the container’s /input directory, allowing the container to access input data.
-v /data/datasets/SMN4Lang/megprep_out:/outputThis maps the output directory in the host to the container’s /output directory for saving processed data.
-v /data/datasets/SMN4Lang/smri:/smriThis mounts a directory containing SMRI data(T1w, Freesurfer’s SUBJECTS_DIR) to the container’s /smri directory for application use.
-v /data/megprep/license.txt:/fs_license.txtThis mounts the FreeSurfer license file into the container, ensuring it has access to the necessary permissions.
-v /data/nextflow.config:/program/nextflow/nextflow.configThis mounts the Nextflow configuration file so the program inside the container can use it.
cmrlab/megprep:0.0.3This specifies the Docker image and version to run, where megprep is the image name, and 0.0.3 is the version.
-i /inputThis is a parameter passed to the program, specifying the input data directory as /input.
-o /outputThis parameter specifies the output data directory as /output.
--fs_license_file /fs_license.txtThis passes the path to the FreeSurfer license file to the program, ensuring it can be recognized correctly.
--fs_subjects_dir /smriThis specifies the separate SMRI data directory for use by the program.
--steps meg_allThis selects full MEG processing using the existing anatomy in
/smri. See Configuration Reference for all stage options.
--resumeThis flag allows the process to resume execution from the last completed step, which is useful for long-running tasks to avoid re-running completed steps.