-
Notifications
You must be signed in to change notification settings - Fork 2
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
3 changed files
with
606 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,185 @@ | ||
# Generated by Neurodocker and Reproenv. | ||
|
||
FROM pyushkevich/itksnap:v3.8.2 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update -qq \ | ||
&& apt-get install -y -q --no-install-recommends \ | ||
emacs-nox \ | ||
g++ \ | ||
gcc \ | ||
graphviz \ | ||
less \ | ||
nano \ | ||
ncdu \ | ||
netbase \ | ||
tig \ | ||
tree \ | ||
vim \ | ||
make \ | ||
cmake \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# install ANTs | ||
|
||
RUN curl -o installANTs.sh https://raw.githubusercontent.com/cookpa/antsInstallExample/master/installANTs.sh | ||
|
||
RUN bash installANTs.sh | ||
|
||
# RUN export PATH=/app/install/bin:$PATH | ||
|
||
ENV PATH /app/install/bin:$PATH | ||
|
||
# Update other required stuff | ||
|
||
RUN export TMPDIR="$(mktemp -d)" \ | ||
&& apt-get update -qq \ | ||
&& apt-get install -y -q --no-install-recommends \ | ||
bc \ | ||
ca-certificates \ | ||
curl \ | ||
libncurses5 \ | ||
libxext6 \ | ||
libxmu6 \ | ||
libxpm-dev \ | ||
libxt6 \ | ||
unzip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
|
||
RUN apt-get update -qq \ | ||
&& apt-get install -y -q --no-install-recommends \ | ||
bc \ | ||
ca-certificates \ | ||
curl \ | ||
dc \ | ||
file \ | ||
libfontconfig1 \ | ||
libfreetype6 \ | ||
libgl1-mesa-dev \ | ||
libgl1-mesa-dri \ | ||
libglu1-mesa-dev \ | ||
libgomp1 \ | ||
libice6 \ | ||
libopenblas-base \ | ||
libxcursor1 \ | ||
libxft2 \ | ||
libxinerama1 \ | ||
libxrandr2 \ | ||
libxrender1 \ | ||
libxt6 \ | ||
nano \ | ||
sudo \ | ||
wget \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# Set up anaconda | ||
ENV CONDA_DIR="/opt/miniconda-4.7.12" \ | ||
PATH="/opt/miniconda-4.7.12/bin:$PATH" | ||
RUN apt-get update -qq \ | ||
&& apt-get install -y -q --no-install-recommends \ | ||
bzip2 \ | ||
ca-certificates \ | ||
curl \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
# Install dependencies. | ||
&& export PATH="/opt/miniconda-4.7.12/bin:$PATH" \ | ||
&& echo "Downloading Miniconda installer ..." \ | ||
&& conda_installer="/tmp/miniconda.sh" \ | ||
&& curl -fsSL -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-4.7.12-Linux-x86_64.sh \ | ||
&& bash "$conda_installer" -b -p /opt/miniconda-4.7.12 \ | ||
&& rm -f "$conda_installer" \ | ||
# Prefer packages in conda-forge | ||
&& conda config --system --prepend channels conda-forge \ | ||
# Packages in lower-priority channels not considered if a package with the same | ||
# name exists in a higher priority channel. Can dramatically speed up installations. | ||
# Conda recommends this as a default | ||
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html | ||
&& conda config --set channel_priority strict \ | ||
&& conda config --system --set auto_update_conda false \ | ||
&& conda config --system --set show_channel_urls true \ | ||
# Enable `conda activate` | ||
&& conda init bash | ||
|
||
|
||
|
||
# install FSL | ||
|
||
|
||
# store the FSL public conda channel | ||
ENV FSL_CONDA_CHANNEL="https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public" | ||
|
||
# install tini into base conda environment | ||
RUN /opt/miniconda-4.7.12/bin/conda install -n base -c conda-forge tini | ||
# as a demonstration, install ONLY FSL's bet (brain extraction) tool. This is an example of a minimal, yet usable container without the rest of FSL being installed | ||
# to see all packages available use a browser to navigate to: https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/ | ||
# note the channel priority. The FSL conda channel must be first, then condaforge | ||
RUN /opt/miniconda-4.7.12/bin/conda install -n base -c $FSL_CONDA_CHANNEL fsl-flirt fsl-bet2 -c conda-forge | ||
# set FSLDIR so FSL tools can use it, in this minimal case, the FSLDIR will be the root conda directory | ||
ENV FSLDIR="/opt/miniconda-4.7.12" | ||
ENV FSLOUTPUTTYPE="NIFTI_GZ" | ||
|
||
# install the python requirements for iEEG-recon | ||
RUN pip install --upgrade pip | ||
|
||
# Install any dependencies specified in requirements.txt | ||
RUN pip install --no-cache-dir ipython\ | ||
nibabel\ | ||
numpy\ | ||
pandas\ | ||
plotly\ | ||
nipype\ | ||
niworkflows\ | ||
antspyx\ | ||
antspynet\ | ||
pyqt5\ | ||
pydeface | ||
|
||
# RUN git clone https://github.com/ANTsX/ANTsPy && cd ANTsPy && python3 setup.py install | ||
|
||
|
||
RUN mkdir /code && chmod 777 /code && chmod a+rwx /code | ||
|
||
RUN mkdir /code/voxtool && chmod 777 /code/voxtool && chmod a+rwx /code/voxtool | ||
|
||
# Create placeholder files | ||
RUN mkdir /atlas_files && chmod 777 /atlas_files && chmod a+rwx /atlas_files | ||
RUN touch /atlas_files/labels.txt | ||
RUN touch /atlas_files/indices.txt | ||
RUN touch /atlas_files/atlas.nii.gz | ||
RUN touch /atlas_files/lut.txt | ||
|
||
|
||
RUN mkdir /freesurfer && chmod 777 /freesurfer && chmod a+rwx /freesurfer | ||
|
||
RUN mkdir /source_data && chmod 777 /source_data && chmod a+rwx /source_data | ||
RUN mkdir /outputs && chmod 777 /outputs && chmod a+rwx /outputs | ||
|
||
|
||
ENV PATH="${PATH}:/code" | ||
#ENV PATH="/code:$PATH" | ||
|
||
RUN test "$(getent passwd neuro)" \ | ||
|| useradd --no-user-group --create-home --shell /bin/bash neuro | ||
|
||
|
||
# Download the ieeg-recon repository and then copy the appropriate scripts/files to the appropriate folders | ||
RUN mkdir /opt/ieeg_recon \ | ||
&& cd /opt/ieeg_recon \ | ||
&& git clone https://github.com/penn-cnt/ieeg-recon.git | ||
|
||
# Copy the main scripts from the repository folder to the code folder | ||
|
||
RUN cp /opt/ieeg_recon/ieeg_recon/python/docker/ieeg_recon_main_docker.py /code/ieeg_recon_v2.py \ | ||
&& cp /opt/ieeg_recon/ieeg_recon/python/pipeline/* /code \ | ||
&& cp /opt/ieeg_recon/ieeg_recon/python/reports/* /code \ | ||
&& cp /opt/ieeg_recon/ieeg_recon/python/source_data/* /code \ | ||
&& cp /opt/ieeg_recon/ieeg_recon/python/docker/brain_shift.py /code | ||
# the brain shift code is different | ||
|
||
RUN chmod +x /code/ieeg_recon_v2.py | ||
|
||
ENTRYPOINT ["python","/code/ieeg_recon_v2.py"] | ||
|
||
|
Oops, something went wrong.