|
| 1 | +# Docker / Apptainer |
| 2 | + |
| 3 | +## Docker |
| 4 | + |
| 5 | +### Get image from docker hub |
| 6 | + |
| 7 | +```bash |
| 8 | +docker pull cpplab/bidspm:latest |
| 9 | +``` |
| 10 | + |
| 11 | +### Build the docker image locally |
| 12 | + |
| 13 | +If you want to build the docker image locally and not pull it from the docker hub: |
| 14 | + |
| 15 | +```bash |
| 16 | +docker build . -f docker/Dockerfile -t cpplab/bidspm:latest |
| 17 | +``` |
| 18 | + |
| 19 | +This will create an image with the tag name `bidspm:latest`. |
| 20 | + |
| 21 | +Running `make build_image` will also build the `stable` version |
| 22 | +and a version tagged image. |
| 23 | + |
| 24 | +### Run the docker image |
| 25 | + |
| 26 | +The following command would pull from our |
| 27 | +[docker hub](https://hub.docker.com/repository/docker/cpplab/bidspm) |
| 28 | +and start the docker image:: |
| 29 | + |
| 30 | +```bash |
| 31 | +docker run -it --rm cpplab/bidspm:latest |
| 32 | +``` |
| 33 | + |
| 34 | +The following command would do do the same, |
| 35 | +but it would also map 2 folders from your computer |
| 36 | +and run preprocessing on your dataset |
| 37 | +(assuming there is a task called `auditory`): |
| 38 | + |
| 39 | +```bash |
| 40 | +bids_dir=fullpath_to_bids_dataset |
| 41 | +output_dir=fullpath_to_your_output_folder |
| 42 | + |
| 43 | +docker run -it --rm \ |
| 44 | + -v $bids_dir:/raw \ |
| 45 | + -v $output_dir:/derivatives \ |
| 46 | + cpplab/bidspm:latest \ |
| 47 | + /raw \ |
| 48 | + /derivatives \ |
| 49 | + subject \ |
| 50 | + --task auditory \ |
| 51 | + --action preprocess \ |
| 52 | + --fwhm 8 |
| 53 | +``` |
| 54 | + |
| 55 | +Similarly this would run the statistics provided you give a bids stats model file |
| 56 | +and the path to the preprocessed data. |
| 57 | + |
| 58 | +```bash |
| 59 | +bids_dir=fullpath_to_bids_dataset |
| 60 | +output_dir=fullpath_to_your_output_folder |
| 61 | +model=fullpath_to_your_bids_stats_model |
| 62 | + |
| 63 | +docker run -it --rm \ |
| 64 | + -v $bids_dir:/raw \ |
| 65 | + -v $output_dir:/derivatives \ |
| 66 | + -v $model:/models/smdl.json \ |
| 67 | + cpplab/bidspm:latest \ |
| 68 | + /raw \ |
| 69 | + /derivatives \ |
| 70 | + subject \ |
| 71 | + --action stats \ |
| 72 | + --preproc_dir /derivatives/bidspm-preproc \ |
| 73 | + --model_file /models/smdl.json \ |
| 74 | + --fwhm 8 |
| 75 | +``` |
| 76 | + |
| 77 | +## Apptainer |
| 78 | + |
| 79 | +If you are plaaning to use [Apptainer](https://apptainer.org/) (formerly Singularity) to run bidspm, |
| 80 | +a definition file is provided in the repository. |
| 81 | + |
| 82 | +```bash |
| 83 | +apptainer build bidspm.sif bidspm.def |
| 84 | +``` |
0 commit comments