Skip to content

Commit

Permalink
Merge pull request #32 from CoBrALab/updates
Browse files Browse the repository at this point in the history
BIDS data structure available, single shot commonspace resampling, more specific datasink outputs, introduction of logs
  • Loading branch information
Gab-D-G authored Nov 17, 2019
2 parents f0bebf0 + eb694f6 commit 9a5aa98
Show file tree
Hide file tree
Showing 18 changed files with 502 additions and 523 deletions.
112 changes: 3 additions & 109 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,9 @@ RUN wget afni.nimh.nih.gov/pub/dist/tgz/linux_ubuntu_16_64.tgz \
&& tar -xzf linux_ubuntu_16_64.tgz -C $HOME/afni \
&& rm -rf linux_ubuntu_16_64.tgz

ENV AFNIPATH="$HOME/ants-v2.3.1/bin" \
ENV AFNIPATH="$HOME/afni/linux_ubuntu_16_64/" \
PATH="$HOME/afni/linux_ubuntu_16_64:$PATH"


### Local CIC VM from https://github.com/CobraLab/MINC-VM/blob/master/provision.sh

RUN apt-get update && \
apt-get install -y --no-install-recommends htop nano wget imagemagick parallel zram-config debconf

Expand All @@ -111,6 +108,8 @@ RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula selec
zenity libcurl4-openssl-dev bc gawk libxkbcommon-x11-0 \
ttf-mscorefonts-installer bc

#Install python environment

ENV CONDA_DIR="$HOME/miniconda-latest" \
PATH="$HOME/miniconda-latest/bin:$PATH" \
ND_ENTRYPOINT="$HOME/startup.sh"
Expand All @@ -131,111 +130,6 @@ RUN export PATH="$HOME/miniconda-latest/bin:$PATH" \
&& rm -rf ~/.cache/pip/* \
&& sync

# set paths
ENV minc_toolkit_v2=https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.17-20190313-Ubuntu_18.04-x86_64.deb \
minc_toolkit_v1=https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.0.09-20170529-Ubuntu_18.04-x86_64.deb \
bic_mni_models=http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/bic-mni-models-0.1.1-20120421.deb \
beast_library=http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/beast-library-1.1.0-20121212.deb \
pyminc=https://github.com/Mouse-Imaging-Centre/pyminc/archive/v0.52.tar.gz \
minc_stuffs=https://github.com/Mouse-Imaging-Centre/minc-stuffs/archive/v0.1.24.tar.gz \
pyezminc=https://github.com/BIC-MNI/pyezminc/archive/release-1.2.01.tar.gz \
quarter=https://github.com/Alexpux/Quarter/archive/master.tar.gz \
bicinventor=https://github.com/BIC-MNI/bicInventor/archive/master.tar.gz \
brain_view2=https://github.com/Mouse-Imaging-Centre/brain-view2/archive/master.tar.gz \
itksnap_minc=http://www.bic.mni.mcgill.ca/~vfonov/temp/itksnap-3.4.0-20151130-Linux-x86_64-qt4.tar.gz \
mni_cortical_statistics=https://github.com/BIC-MNI/mni.cortical.statistics/archive/ver-0_9_5.tar.gz \
generate_deformation_fields=https://github.com/Mouse-Imaging-Centre/generate_deformation_fields/archive/1.0.1.tar.gz \
pydpiper=https://github.com/Mouse-Imaging-Centre/pydpiper/archive/v2.0.13.tar.gz \
bpipe=https://github.com/ssadedin/bpipe/releases/download/0.9.9.6/bpipe-0.9.9.6.tar.gz


#Download and install external debs
RUN wget --progress=dot:mega $minc_toolkit_v2 && \
wget --progress=dot:mega $minc_toolkit_v1 && \
wget --progress=dot:mega $bic_mni_models && \
wget --progress=dot:mega $beast_library && \
for file in *.deb; do gdebi --n $file; done && \
rm -f *.deb


RUN echo '. /opt/minc/1.9.17/minc-toolkit-config.sh' >> $HOME/.bashrc && \
echo 'export LD_LIBRARY_PATH=/opt/minc/1.9.17/lib' >> $HOME/.bashrc && \
echo 'export PATH=/opt/minc-toolkit-extras/:$PATH' >> $HOME/.bashrc

#Enable minc-toolkit in this script, need to escape error checking
RUN set +u && \
. /opt/minc/1.9.17/minc-toolkit-config.sh && \
set -u

#Download other packages
RUN wget --progress=dot:mega $pyminc -O pyminc.tar.gz && \
wget --progress=dot:mega $minc_stuffs -O minc-stuffs.tar.gz && \
wget --progress=dot:mega $pyezminc -O pyezminc.tar.gz && \
wget --progress=dot:mega $generate_deformation_fields -O generate_deformation_fields.tar.gz && \
wget --progress=dot:mega $pydpiper -O pydpiper.tar.gz && \
wget --progress=dot:mega $bpipe -O bpipe.tar.gz && \
wget https://raw.githubusercontent.com/andrewjanke/volgenmodel/master/volgenmodel -O /usr/local/bin/volgenmodel && \
git clone https://github.com/CobraLab/minc-toolkit-extras.git /opt/minc-toolkit-extras


#Do this so that we don't need to keep track of version numbers for build
RUN mkdir -p pyminc && tar xzvf pyminc.tar.gz -C pyminc --strip-components 1 && \
mkdir -p minc-stuffs && tar xzvf minc-stuffs.tar.gz -C minc-stuffs --strip-components 1 && \
mkdir -p generate_deformation_fields && tar xzvf generate_deformation_fields.tar.gz -C generate_deformation_fields --strip-components 1 && \
mkdir -p pyezminc && tar xzvf pyezminc.tar.gz -C pyezminc --strip-components 1 && \
mkdir -p pydpiper && tar xzvf pydpiper.tar.gz -C pydpiper --strip-components 1 && \
mkdir -p /opt/bpipe && tar xzvf bpipe.tar.gz -C /opt/bpipe --strip-components 1 && ln -s /opt/bpipe/bin/bpipe /usr/local/bin/bpipe


#Build and install packages
RUN ( cd pyezminc && python setup.py install --mincdir /opt/minc/1.9.17 ) && \
( cd pyminc && python setup.py install ) && \
( cd minc-stuffs && ./autogen.sh && ./configure --with-build-path=/opt/minc/1.9.17 && make && make install && python setup.py install ) && \
( cd generate_deformation_fields && ./autogen.sh && ./configure --with-minc2 --with-build-path=/opt/minc/1.9.17 && make && make install) && \
( cd generate_deformation_fields/scripts && python setup.py build_ext --inplace && python setup.py install) && \
( cd pydpiper && python setup.py install)

RUN pip install -U qbatch==2.1.5 && \
rm -rf pyezminc* pyminc* minc-stuffs* generate_deformation_fields* pydpiper* bpipe*

#Installing brain-view2
RUN apt install -y --no-install-recommends libcoin80-dev libpcre++-dev qt4-default libqt4-opengl-dev libtool && \
wget $quarter -O quarter.tar.gz && \
wget $bicinventor -O bicinventor.tar.gz && \
wget $brain_view2 -O brain-view2.tar.gz && \
mkdir quarter && tar xzvf quarter.tar.gz -C quarter --strip-components 1 && \
mkdir bicinventor && tar xzvf bicinventor.tar.gz -C bicinventor --strip-components 1 && \
mkdir brain-view2 && tar xzvf brain-view2.tar.gz -C brain-view2 --strip-components 1 && \
( cd quarter && cmake . && make && make install ) && \
( cd bicinventor && ./autogen.sh && ./configure --with-build-path=/opt/minc/1.9.17 --prefix=/opt/minc/1.9.17 --with-minc2 && make && make install ) && \
( cd brain-view2 && /usr/bin/qmake-qt4 MINCDIR=/opt/minc/1.9.17 HDF5DIR=/opt/minc/1.9.17 INVENTORDIR=/opt/minc/1.9.17 && make && cp brain-view2 /opt/minc/1.9.17/bin ) && \
rm -rf quarter* bicinventor* brain-view2*

#Install itksnap-MINC
RUN wget $itksnap_minc -O itksnap_minc.tar.gz && \
tar xzvf itksnap_minc.tar.gz -C /usr/local --strip-components 1 && \
rm -f itksnap_minc.tar.gz

ENV export MINC_PATH=/opt/minc/1.9.17 \
export PATH=${OLDPATH}

#Purge unneeded packages
RUN apt-get purge $(dpkg -l | tr -s ' ' | cut -d" " -f2 | sed 's/:amd64//g' | grep -e -E '(-dev|-doc)$')

#Remove a hunk of useless packages which seem to be safe to remove
RUN apt-get -y purge printer-driver.* xserver-xorg-video.* xscreensaver.* wpasupplicant wireless-tools .*vdpau.* \
bluez-cups cups-browsed cups-bsd cups-client cups-common cups-core-drivers cups-daemon cups-filters \
cups-filters-core-drivers cups-ppdc cups-server-common linux-headers.* snapd bluez linux-firmware .*sane.* .*ppds.* && \
apt-get -y clean && \
apt-get -y --purge autoremove

#Cleanup to ensure extra files aren't packed into VM
RUN cd ~ && \
rm -rf /tmp/provision && \
rm -f /var/cache/apt/archives/*.deb && \
rm -rf /var/lib/apt/lists/*


#### install RABIES

ENV export LD_LIBRARY_PATH=/opt/minc/1.9.17/lib \
Expand Down
Loading

0 comments on commit 9a5aa98

Please sign in to comment.