-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
Bootstrap: docker | ||
From: ubuntu:20.04 | ||
|
||
%help | ||
Registration of PET images. Info and usage: | ||
/opt/petreg/README.md | ||
|
||
|
||
%setup | ||
mkdir -p ${SINGULARITY_ROOTFS}/opt/petreg | ||
|
||
|
||
%files | ||
src /opt/petreg | ||
README.md /opt/petreg | ||
|
||
|
||
%labels | ||
Maintainer [email protected] | ||
|
||
|
||
%post | ||
apt-get update > /dev/null 2>&1 | ||
apt-get install -y wget unzip zip xvfb ghostscript imagemagick bc > /dev/null 2>&1 # Misc tools | ||
apt-get install -y libopenblas-base language-pack-en > /dev/null 2>&1 # FSL | ||
|
||
# Fix imagemagick policy to allow PDF output and text read. See https://usn.ubuntu.com/3785-1/ | ||
sed -i 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' \ | ||
/etc/ImageMagick-6/policy.xml | ||
sed -i 's/rights="none" pattern="@\*"/rights="read" pattern="@*"/' \ | ||
/etc/ImageMagick-6/policy.xml | ||
|
||
# FSL. We need 6.0.4 for the b02b01_1.sch topup schedule. See | ||
# https://fsl.fmrib.ox.ac.uk/fsldownloads/manifest.csv | ||
# And, the centos7 version suits for Ubuntu 14-20. | ||
fslver=6.0.4 | ||
cd /usr/local | ||
wget -nv https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-${fslver}-centos7_64.tar.gz | ||
tar -zxf fsl-${fslver}-centos7_64.tar.gz | ||
rm fsl-${fslver}-centos7_64.tar.gz | ||
|
||
# FSL setup | ||
export FSLDIR=/usr/local/fsl | ||
. ${FSLDIR}/etc/fslconf/fsl.sh | ||
export PATH=${FSLDIR}/bin:${PATH} | ||
|
||
# Run the FSL python installer. A clue that we forgot this is an imglob error at runtime | ||
${FSLDIR}/etc/fslconf/fslpython_install.sh | ||
|
||
# Create input/output directories for binding | ||
mkdir /INPUTS && mkdir /OUTPUTS && mkdir /wkdir | ||
|
||
|
||
%environment | ||
|
||
# FSL | ||
export FSLDIR=/usr/local/fsl | ||
|
||
# Path | ||
export PATH=/opt/petreg/src:/usr/local/fsl/bin:${PATH} | ||
|
||
|
||
%runscript | ||
xwrapper.sh "$@" | ||
|