Skip to content

Commit

Permalink
MNT: Install ANTs from conda-forge (#3061)
Browse files Browse the repository at this point in the history
Closes #2915. Again.
  • Loading branch information
effigies committed Jul 21, 2023
1 parent d1bd6f9 commit e1c4bac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _machine_defaults: &machine_defaults
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
SCRATCH: "/scratch"
machine:
image: ubuntu-2204:current
image: ubuntu-2204:2023.04.2
docker_layer_caching: true
working_directory: /tmp/src/fmriprep
resource_class: large
Expand Down Expand Up @@ -192,6 +192,8 @@ jobs:
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VERSION="${CIRCLE_TAG:-$THISVERSION}" .
- run:
command: docker images
- run:
name: Check Docker image
command: |
Expand Down
24 changes: 10 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ RUN python -m build /src/fmriprep

# Utilities for downloading packages
FROM ${BASE_IMAGE} as downloader
# Bump the date to current to refresh curl/certificates/etc
RUN echo "2023.07.20"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
binutils \
Expand All @@ -59,7 +61,7 @@ RUN curl -sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.2/frees
# AFNI
FROM downloader as afni
# Bump the date to current to update AFNI
RUN echo "2023.04.04"
RUN echo "2023.07.20"
RUN mkdir -p /opt/afni-latest \
&& curl -fsSL --retry 5 https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz \
| tar -xz -C /opt/afni-latest --strip-components 1 \
Expand All @@ -77,13 +79,6 @@ RUN mkdir -p /opt/afni-latest \
-name "3dAutomask" -or \
-name "3dvolreg" \) -delete

# ANTs 2.4.4
FROM downloader as ants
RUN mkdir -p /opt && \
curl -sSLO "https://github.com/ANTsX/ANTs/releases/download/v2.4.4/ants-2.4.4-ubuntu-22.04-X64-gcc.zip" && \
unzip ants-2.4.4-ubuntu-22.04-X64-gcc.zip -d /opt && \
rm ants-2.4.4-ubuntu-22.04-X64-gcc.zip

# Connectome Workbench 1.5.0
FROM downloader as workbench
RUN mkdir /opt/workbench && \
Expand All @@ -93,6 +88,12 @@ RUN mkdir /opt/workbench && \
rm -rf /opt/workbench/libs_linux64_software_opengl /opt/workbench/plugins_linux64 && \
strip --remove-section=.note.ABI-tag /opt/workbench/libs_linux64/libQt5Core.so.5

# Convert3d 1.4.0
FROM downloader as c3d
RUN mkdir /opt/convert3d && \
curl -fsSL --retry 5 https://sourceforge.net/projects/c3d/files/c3d/Experimental/c3d-1.4.0-Linux-gcc64.tar.gz/download \
| tar -xz -C /opt/convert3d --strip-components 1

# Micromamba
FROM downloader as micromamba
WORKDIR /
Expand Down Expand Up @@ -172,8 +173,8 @@ RUN apt-get update -qq \
# Install files from stages
COPY --from=freesurfer /opt/freesurfer /opt/freesurfer
COPY --from=afni /opt/afni-latest /opt/afni-latest
COPY --from=ants /opt/ants-2.4.4 /opt/ants
COPY --from=workbench /opt/workbench /opt/workbench
COPY --from=c3d /opt/convert3d/bin/c3d_affine_tool /usr/bin/c3d_affine_tool

# Simulate SetUpFreeSurfer.sh
ENV OS="Linux" \
Expand All @@ -197,11 +198,6 @@ ENV PATH="/opt/afni-latest:$PATH" \
AFNI_IMSAVE_WARNINGS="NO" \
AFNI_PLUGINPATH="/opt/afni-latest"

# ANTs config
ENV ANTSPATH="/opt/ants" \
PATH="/opt/ants/bin:$PATH" \
LD_LIBRARY_PATH="/opt/ants/lib:$LD_LIBRARY_PATH"

# Workbench config
ENV PATH="/opt/workbench/bin_linux64:$PATH" \
LD_LIBRARY_PATH="/opt/workbench/lib_linux64:$LD_LIBRARY_PATH"
Expand Down
5 changes: 2 additions & 3 deletions env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ dependencies:
# Utilities
- graphviz=6.0
- pandoc=3.1
# Workflow dependencies: Convert3D
- convert3d=1.3.0
- libitk=5.2 # 5.3 fails with c3d
# Workflow dependencies: ANTs
- ants=2.4.4
# Workflow dependencies: FSL (versions pinned in 6.0.6.2)
- fsl-bet2=2111.0
- fsl-flirt=2111.0
Expand Down

0 comments on commit e1c4bac

Please sign in to comment.