Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into bval_clamp_zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Lestropie committed Feb 11, 2025
2 parents ba633f8 + 5c3d62d commit 4bcc570
Show file tree
Hide file tree
Showing 1,048 changed files with 2,227 additions and 2,419 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install clang libqt5opengl5-dev libqt5svg5-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev
sudo apt-get install clang libqt5opengl5-dev libqt5svg5-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev libpng-dev
- name: configure
run: ./configure -assert || { cat configure.log; false; }
Expand All @@ -41,6 +41,8 @@ jobs:
- name: binary tests
run: ./run_tests binaries || { cat testing_binaries.log; false; }

- name: check command documentation
run: ./docs/generate_user_docs.sh && git diff --exit-code docs/



Expand Down Expand Up @@ -103,9 +105,6 @@ jobs:
- name: binary tests
run: ./run_tests binaries || { cat testing_binaries.log; false; }

- name: check command documentation
run: ./docs/generate_user_docs.sh && git diff --exit-code docs/




Expand Down Expand Up @@ -183,13 +182,7 @@ jobs:
run: python3 -m sphinx -n -N -W -w sphinx.log docs/ tmp/

- name: install build dependencies
run: sudo apt-get install python2 clang libqt5opengl5-dev libqt5svg5-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev

- name: check configure with Python 2
run: python2 ./configure || { cat configure.log; false; }

- name: check build with Python 2
run: python2 ./build -dryrun || { cat build.log; false; }
run: sudo apt-get install clang libqt5opengl5-dev libqt5svg5-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev

- name: check configure with Python 3
run: python3 ./configure || { cat configure.log; false; }
Expand Down
137 changes: 137 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Releases

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to release from'
required: true
default: 'dev'

jobs:
linux-release:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}

- name: Set env vars
id: envs
run: |
commit_sha=$(git rev-parse HEAD)
date=$(date +%Y_%m_%d)
echo "commit_sha=$commit_sha" >> $GITHUB_OUTPUT
echo "date=$date" >> $GITHUB_OUTPUT
echo "output_name=mrtrix3-linux-$commit_sha-$date" >> $GITHUB_OUTPUT
- name: Install Eigen3
run: |
git clone https://gitlab.com/libeigen/eigen.git && cd eigen && git checkout 3.4.0
cmake -B build && cmake --build build
sudo cmake --install build
- name: Install Qt 6
uses: jurplel/install-qt-action@v3
with:
version: '6.7.0'
set-env: true

- name: Run build
run: |
./packaging/package-linux-tarball.sh .
mv mrtrix.tar.gz ${{ steps.envs.outputs.output_name }}.tar.gz
- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.envs.outputs.output_name }}
path: ${{ steps.envs.outputs.output_name }}.tar.gz

macos-release:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}

- name: Set env vars
id: envs
run: |
commit_sha=$(git rev-parse HEAD)
date=$(date +%Y_%m_%d)
echo "commit_sha=$commit_sha" >> $GITHUB_OUTPUT
echo "date=$date" >> $GITHUB_OUTPUT
echo "output_name=mrtrix3-macos-$commit_sha-$date" >> $GITHUB_OUTPUT
- name: Install deps
run: brew install numpy cmake qt eigen pkg-config fftw libpng ninja

- name: Run build
run: |
cd ./packaging/macos
./build ${{ github.event.inputs.branch }}
mv ./mrtrix3-macos-${{ github.event.inputs.branch }}.tar.xz ../../${{ steps.envs.outputs.output_name }}.tar.xz
- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.envs.outputs.output_name }}
path: ${{ steps.envs.outputs.output_name }}.tar.xz

windows-release:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}

env:
MINGW_PACKAGE_PREFIX: mingw-w64-ucrt-x86_64

steps:
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: |
git
python
${{env.MINGW_PACKAGE_PREFIX}}-bc
${{env.MINGW_PACKAGE_PREFIX}}-cmake
${{env.MINGW_PACKAGE_PREFIX}}-diffutils
${{env.MINGW_PACKAGE_PREFIX}}-eigen3
${{env.MINGW_PACKAGE_PREFIX}}-fftw
${{env.MINGW_PACKAGE_PREFIX}}-gcc
${{env.MINGW_PACKAGE_PREFIX}}-libtiff
${{env.MINGW_PACKAGE_PREFIX}}-ninja
${{env.MINGW_PACKAGE_PREFIX}}-pkg-config
${{env.MINGW_PACKAGE_PREFIX}}-qt6-base
${{env.MINGW_PACKAGE_PREFIX}}-qt6-svg
${{env.MINGW_PACKAGE_PREFIX}}-zlib
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}

- name: Set env vars
id: envs
run: |
commit_sha=$(git rev-parse HEAD)
date=$(date +%Y_%m_%d)
echo "commit_sha=$commit_sha" >> $GITHUB_OUTPUT
echo "date=$date" >> $GITHUB_OUTPUT
echo "output_name=mrtrix3-windows-$commit_sha-$date" >> $GITHUB_OUTPUT
- name: Run build
run: |
cd packaging/mingw
./run.sh ${{ steps.envs.outputs.commit_sha }} mrtrix3
mv mingw*.tar.zst ../../../${{ steps.envs.outputs.output_name }}.tar.zst
- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.envs.outputs.output_name }}
path: ${{ steps.envs.outputs.output_name }}.tar.zst
62 changes: 62 additions & 0 deletions .github/workflows/weekly_sanitizers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Sanitizers checks

on:
workflow_dispatch:
# Run this every Sunday at midnight
schedule:
- cron: "0 0 * * 0"

jobs:
linux-clang-build:
runs-on: ubuntu-latest

env:
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: "2G"

strategy:
fail-fast: false
matrix:
sanitizer: [address, thread, undefined]

steps:
- uses: actions/checkout@v1
with:
submodules: true
ref: dev

- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install clang llvm qt6-base-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev ninja-build python3-numpy
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3

- name: Get CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: '3.16.3'

- name: Print CMake version
run: cmake --version

- name: configure
run: >
cmake
-B build
-G Ninja
-D CMAKE_BUILD_TYPE=RelWithDebInfo
-D MRTRIX_BUILD_TESTS=ON
-D ECM_ENABLE_SANITIZERS=${{ matrix.sanitizer }}
-D CMAKE_C_COMPILER=clang
-D CMAKE_CXX_COMPILER=clang++
- name: build
run: cmake --build build

- name: binary tests
run: cd build && ctest -L binary --output-on-failure

- name: unit tests
run: cd build && ctest -L unittest --output-on-failure
8 changes: 7 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"


# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
Expand All @@ -20,6 +27,5 @@ formats:

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt
33 changes: 19 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG MAKE_JOBS="1"
ARG DEBIAN_FRONTEND="noninteractive"

FROM python:3.8-slim AS base
FROM buildpack-deps:buster AS base-builder
FROM buildpack-deps:bookworm AS base-builder

FROM base-builder AS mrtrix3-builder

Expand All @@ -22,39 +22,40 @@ RUN apt-get -qq update \
libqt5opengl5-dev \
libqt5svg5-dev \
libtiff5-dev \
qt5-default \
python3 \
qtbase5-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

# Clone, build, and install MRtrix3.
ARG MAKE_JOBS
WORKDIR /opt/mrtrix3
RUN git clone -b $MRTRIX3_GIT_COMMITISH --depth 1 https://github.com/MRtrix3/mrtrix3.git . \
&& ./configure $MRTRIX3_CONFIGURE_FLAGS \
&& NUMBER_OF_PROCESSORS=$MAKE_JOBS ./build $MRTRIX3_BUILD_FLAGS \
&& python3 ./configure $MRTRIX3_CONFIGURE_FLAGS \
&& NUMBER_OF_PROCESSORS=$MAKE_JOBS python3 ./build $MRTRIX3_BUILD_FLAGS \
&& rm -rf tmp

# Download minified ART ACPCdetect (V2.0).
FROM base-builder as acpcdetect-installer
FROM base-builder AS acpcdetect-installer
WORKDIR /opt/art
RUN curl -fsSL https://osf.io/73h5s/download \
| tar xz --strip-components 1

# Download minified ANTs (2.3.4-2).
FROM base-builder as ants-installer
FROM base-builder AS ants-installer
WORKDIR /opt/ants
RUN curl -fsSL https://osf.io/yswa4/download \
| tar xz --strip-components 1

# Download FreeSurfer files.
FROM base-builder as freesurfer-installer
FROM base-builder AS freesurfer-installer
WORKDIR /opt/freesurfer
RUN curl -fsSLO https://raw.githubusercontent.com/freesurfer/freesurfer/v7.1.1/distribution/FreeSurferColorLUT.txt

# Download minified FSL (6.0.4-2)
FROM base-builder as fsl-installer
# Download minified FSL (6.0.7.7)
FROM base-builder AS fsl-installer
WORKDIR /opt/fsl
RUN curl -fsSL https://osf.io/dtep4/download \
RUN curl -fsSL https://osf.io/ph9ex/download \
| tar xz --strip-components 1

# Build final image.
Expand All @@ -66,7 +67,8 @@ RUN apt-get -qq update \
binutils \
dc \
less \
libfftw3-3 \
libfftw3-single3 \
libfftw3-double3 \
libgl1-mesa-glx \
libgomp1 \
liblapack3 \
Expand All @@ -77,8 +79,10 @@ RUN apt-get -qq update \
libqt5svg5 \
libqt5widgets5 \
libquadmath0 \
libtiff5 \
libtiff5-dev \
python3 \
python3-distutils \
procps \
&& rm -rf /var/lib/apt/lists/*

COPY --from=acpcdetect-installer /opt/art /opt/art
Expand All @@ -95,12 +99,13 @@ ENV ANTSPATH="/opt/ants/bin" \
FSLMULTIFILEQUIT="TRUE" \
FSLTCLSH="/opt/fsl/bin/fsltclsh" \
FSLWISH="/opt/fsl/bin/fslwish" \
LD_LIBRARY_PATH="/opt/fsl/lib:$LD_LIBRARY_PATH" \
PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/bin:$PATH"
PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/share/fsl/bin:$PATH"

# Fix "Singularity container cannot load libQt5Core.so.5" on CentOS 7
RUN strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 \
&& ldconfig \
&& apt-get purge -yq binutils

RUN ln -s /usr/bin/python3 /usr/bin/python

CMD ["/bin/bash"]
8 changes: 4 additions & 4 deletions Singularity
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Include: apt
export FSLDIR FSLOUTPUTTYPE FSLMULTIFILEQUIT FSLTCLSH FSLWISH

# All
LD_LIBRARY_PATH="/.singularity.d/libs:/usr/lib:/opt/fsl/lib:$LD_LIBRARY_PATH"
PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/bin:$PATH"
LD_LIBRARY_PATH="/.singularity.d/libs:/usr/lib:$LD_LIBRARY_PATH"
PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/share/fsl/bin:$PATH"
export LD_LIBRARY_PATH PATH

%post
Expand All @@ -51,8 +51,8 @@ Include: apt
mkdir -p /opt/ants && curl -fsSL https://osf.io/yswa4/download | tar xz -C /opt/ants --strip-components 1
# Download FreeSurfer lookup table file (v7.1.1).
mkdir -p /opt/freesurfer && curl -fsSL -o /opt/freesurfer/FreeSurferColorLUT.txt https://raw.githubusercontent.com/freesurfer/freesurfer/v7.1.1/distribution/FreeSurferColorLUT.txt
# Download minified FSL (6.0.4-2).
mkdir -p /opt/fsl && curl -fsSL https://osf.io/dtep4/download | tar xz -C /opt/fsl --strip-components 1
# Download minified FSL (6.0.7.7).
mkdir -p /opt/fsl && curl -fsSL https://osf.io/ph9ex/download | tar xz -C /opt/fsl --strip-components 1

# Use Python3 for anything requesting Python, since Python2 is not installed
ln -s /usr/bin/python3 /usr/bin/python
Expand Down
2 changes: 1 addition & 1 deletion bin/5ttgen
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# Copyright (c) 2008-2023 the MRtrix3 contributors.
# Copyright (c) 2008-2025 the MRtrix3 contributors.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down
2 changes: 1 addition & 1 deletion bin/blend
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python2

# Copyright (c) 2008-2023 the MRtrix3 contributors.
# Copyright (c) 2008-2025 the MRtrix3 contributors.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down
Loading

0 comments on commit 4bcc570

Please sign in to comment.