baxpr/fsl-base:latest

$ singularity pull shub://baxpr/fsl-base:latest

Singularity Recipe

Bootstrap: docker
From: ubuntu:18.04

%post

  fsl_version=6.0.2

  apt-get update

  # Workaround for filename case collision in linux-libc-dev
  # https://stackoverflow.com/questions/15599592/compiling-linux-kernel-error-xt-connmark-h
  # https://superuser.com/questions/1238903/cant-install-linux-libc-dev-in-ubuntu-on-windows
  apt-get install -y binutils xz-utils 
  mkdir pkgtemp && cd pkgtemp
  apt-get download linux-libc-dev
  ar x linux-libc-dev*deb
  tar xJf data.tar.xz
  tar cJf data.tar.xz ./usr
  ar rcs linux-libc-dev*.deb debian-binary control.tar.xz data.tar.xz
  dpkg -i linux-libc-dev*.deb
  cd .. && rm -r pkgtemp

  # FSL dependencies, h/t https://github.com/MPIB/singularity-fsl
  #    debian vs ubuntu:
  #            libjpeg62-turbo ->  libjpeg-turbo8
  #            libmng1         ->  libmng2
  apt-get -y install wget python-minimal libgomp1 ca-certificates \
          libglu1-mesa libgl1-mesa-glx libsm6 libice6 libxt6 \
          libjpeg-turbo8 libpng16-16 libxrender1 libxcursor1 \
          libxinerama1 libfreetype6 libxft2 libxrandr2 libmng2 \
          libgtk2.0-0 libpulse0 libasound2 libcaca0 libopenblas-base \
          bzip2 dc bc

  # Get and install main FSL package
  cd /usr/local
  wget https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-${fsl_version}-centos7_64.tar.gz
  tar zxf fsl-${fsl_version}-centos7_64.tar.gz
  rm fsl-${fsl_version}-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
  ${FSLDIR}/etc/fslconf/fslpython_install.sh

  # Headless X11 support
  apt-get install -y xvfb
  
  # PNG and PDF tools
  apt-get install -y ghostscript imagemagick
  
  # Fix imagemagick policy to allow PDF output. See https://usn.ubuntu.com/3785-1/
  sed -i 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' \
    /etc/ImageMagick-6/policy.xml

  # Python libraries for assessor code
  apt-get install -y python3 python3-pip
  pip3 install nibabel pandas
  
  # Clean up
  apt-get clean && apt-get -y autoremove


%environment

  # FSL
  export FSLDIR=/usr/local/fsl
  . ${FSLDIR}/etc/fslconf/fsl.sh
  export PATH=${FSLDIR}/bin:${PATH}


%runscript
  bash "$@"

Collection


View on Datalad

Metrics

key value
id /containers/baxpr-fsl-base-latest
collection name baxpr/fsl-base
branch master
tag latest
commit 925494b58cb1a933e634cfa4485a493356726d21
version (container hash) 30445db9a1ace3fcfa7d5cfdfbc52c0f
build date 2020-06-02T17:25:46.952Z
size (MB) 13747.0
size (bytes) 5814251551
SIF Download URL (please use pull with shub://)
Datalad URL View on Datalad
Singularity Recipe Singularity Recipe on Datalad
We cannot guarantee that all containers will still exist on GitHub.