Skip to content

Commit

Permalink
sing
Browse files Browse the repository at this point in the history
  • Loading branch information
baxpr committed May 8, 2021
1 parent aa44c1d commit 14e081a
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions Singularity.v0.0.1
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 "$@"

0 comments on commit 14e081a

Please sign in to comment.