forked from Donders-Institute/bidscoin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apptainer.def
66 lines (47 loc) · 2.6 KB
/
apptainer.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Bootstrap: docker
From: python:3.10-slim
Stage: builder
%post
# Install the latest dcm2niix release from the base repository (= typically outdated)
# apt update && apt -y install dcm2niix
# Install the latest dcm2niix from sources
apt update && apt -y install git build-essential cmake
git clone https://github.com/rordenlab/dcm2niix.git
cd dcm2niix; mkdir build && cd build
cmake -DZLIB_IMPLEMENTATION=Cloudflare -DUSE_JPEGLS=ON -DUSE_OPENJPEG=ON ..
make install
Bootstrap: docker
From: python:3.10-slim
Stage: final
%help
This BIDScoin Apptainer image includes:
* Debian stable,
* The latest version of dcm2niix (https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage)
* The latest stable release (v4.2.1+qt5) of BIDScoin and its plugins. The general form to run BIDScoin commands is:
apptainer exec bidscoin.sif <bidscoin_tool> <bidscoin_tool_args>
For more information run:
apptainer run bidscoin.sif
The current image does not include this (non-free) software needed for some bidsapps:
* FSL (needed for `deface` and `slicereport`)
* Freesurfer/synthstrip (needed for `skullstrip`)
NB: 1) To run GUI applications (such as the bidseditor) you probably need to run `xhost +` first
2) In the commands above, Singularity users should replace `apptainer` with `singularity`
%files from builder
# Install dcm2niix. NB: Obsolete with the new `pip install bidscoin[dcm2niix2bids]` extras option
/usr/local/bin/dcm2niix /usr/local/bin/dcm2niix
%environment
export PIP_NO_CACHE_DIR=off
%post
# Install curl (sometimes needed by dcm2niix) and pigz (to speed up dcm2niix)
apt update && apt -y --no-install-recommends install pigz curl
# Install the latest stable BIDScoin Qt5 release from Github (install the normal Qt6 branch from PyPi when using recent base images such as Ubuntu:22.04)
# NOTE: PyQt5 is installed as Debian package to solve dependencies issues occurring when installed with pip
apt -y --no-install-recommends install python3-pyqt5 python3-pyqt5.qtx11extras git && apt clean
pip install --upgrade pip
pip install bidscoin[spec2nii2bids,deface,pet2bids]@git+https://github.com/Donders-Institute/[email protected]+qt5
# Uncomment the line below if you get errors like: ImportError: libQt5Core.so.5: cannot open shared object file: No such file or directory
# strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
# Finally, create the necessary links and cache to the most recent shared libraries (= best practise)
ldconfig
%runscript
exec bidscoin --help