diff options
| author | Ricardo Wurmus <rekado@elephly.net> | 2026-03-13 21:31:17 +0100 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2026-03-17 09:08:08 +0100 |
| commit | f53b641f701d015ffd3aa6e552d067e24b82539e (patch) | |
| tree | 730de853c219be20f5d395354ad86abe78fcb3f0 | |
| parent | d47f5ac311cb7dc1b7c96a15a1acb8db3334fcde (diff) | |
gnu: Add elastix.
* gnu/packages/image-processing.scm (elastix): New variable.
* gnu/packages/patches/elastix-1404.patch: New file.
* gnu/local.mk (dist_patch_DATA): Record it.
Change-Id: Ic3b76c70afe2fc7ddb0f2516204f76e5690143a9
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/image-processing.scm | 52 | ||||
| -rw-r--r-- | gnu/packages/patches/elastix-1404.patch | 32 |
3 files changed, 84 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index e8e144294e2..a348b2916f1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -1220,6 +1220,7 @@ dist_patch_DATA = \ | |||
| 1220 | %D%/packages/patches/dwarves-threading-reproducibility.patch \ | 1220 | %D%/packages/patches/dwarves-threading-reproducibility.patch \ |
| 1221 | %D%/packages/patches/efitools-riscv64-support.patch \ | 1221 | %D%/packages/patches/efitools-riscv64-support.patch \ |
| 1222 | %D%/packages/patches/efivar-fix-fprint-format.patch \ | 1222 | %D%/packages/patches/efivar-fix-fprint-format.patch \ |
| 1223 | %D%/packages/patches/elastix-1404.patch \ | ||
| 1223 | %D%/packages/patches/eigen-fix-strict-aliasing-bug.patch \ | 1224 | %D%/packages/patches/eigen-fix-strict-aliasing-bug.patch \ |
| 1224 | %D%/packages/patches/einstein-build.patch \ | 1225 | %D%/packages/patches/einstein-build.patch \ |
| 1225 | %D%/packages/patches/elfutils-tests-ptrace.patch \ | 1226 | %D%/packages/patches/elfutils-tests-ptrace.patch \ |
diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index 01d829e72ac..06452038dba 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2017 John Darrington <jmd@gnu.org> | 2 | ;;; Copyright © 2017 John Darrington <jmd@gnu.org> |
| 3 | ;;; Copyright © 2017, 2019, 2022, 2024 Ricardo Wurmus <rekado@elephly.net> | 3 | ;;; Copyright © 2017, 2019, 2021-2026 Ricardo Wurmus <rekado@elephly.net> |
| 4 | ;;; Copyright © 2014, 2021-2023, 2026 Ludovic Courtès <ludo@gnu.org> | 4 | ;;; Copyright © 2014, 2021-2023, 2026 Ludovic Courtès <ludo@gnu.org> |
| 5 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> | 5 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> |
| 6 | ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org> | 6 | ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org> |
| @@ -1771,6 +1771,56 @@ full-featured UI aimed at clinical researchers.") | |||
| 1771 | ;; This includes the submodules greedy, c3d and digestible. | 1771 | ;; This includes the submodules greedy, c3d and digestible. |
| 1772 | (license license:gpl3+)))) | 1772 | (license license:gpl3+)))) |
| 1773 | 1773 | ||
| 1774 | (define-public elastix | ||
| 1775 | (package | ||
| 1776 | (name "elastix") | ||
| 1777 | (version "5.3.0") | ||
| 1778 | (source | ||
| 1779 | (origin | ||
| 1780 | (method git-fetch) | ||
| 1781 | (uri (git-reference | ||
| 1782 | (url "https://github.com/SuperElastix/elastix") | ||
| 1783 | (commit version))) | ||
| 1784 | (file-name (git-file-name name version)) | ||
| 1785 | (sha256 | ||
| 1786 | (base32 "0sgw4cz4x6f78n6iqn87ll6wad32y67lmzvqfdfw1pzjkxbwzwyr")) | ||
| 1787 | (patches | ||
| 1788 | (search-patches "elastix-1404.patch")))) | ||
| 1789 | (properties '((tunable? . #t))) | ||
| 1790 | (build-system cmake-build-system) | ||
| 1791 | (arguments | ||
| 1792 | (list | ||
| 1793 | #:configure-flags | ||
| 1794 | #~(list "-DELASTIX_USE_EIGEN=ON" | ||
| 1795 | "-DELASTIX_ENABLE_PACKAGER:BOOL=OFF" | ||
| 1796 | "-DELASTIX_BUILD_EXECUTABLE:BOOL=ON" | ||
| 1797 | "-DCMAKE_CXX_FLAGS=-fPIC" | ||
| 1798 | "-DCMAKE_CXX_STANDARD=17" | ||
| 1799 | "-DBUILD_TESTING:BOOL=ON") | ||
| 1800 | ;; These tests fail and are skipped in upstream CI. | ||
| 1801 | #:test-exclude (string-join | ||
| 1802 | (list "elastix_run_example_COMPARE_IM" | ||
| 1803 | (string-append "elastix_run_3DCT_lung.MI.bspline." | ||
| 1804 | "ASGD.001_COMPARE_TP")) | ||
| 1805 | "|"))) | ||
| 1806 | (inputs (list charls | ||
| 1807 | dcmtk | ||
| 1808 | eigen | ||
| 1809 | fftw | ||
| 1810 | insight-toolkit | ||
| 1811 | libpng | ||
| 1812 | libtiff | ||
| 1813 | zlib)) | ||
| 1814 | (home-page "https://elastix.dev/") | ||
| 1815 | (synopsis "Image registration toolbox") | ||
| 1816 | (description | ||
| 1817 | "Elastix is a toolbox for rigid and nonrigid registration of images. The | ||
| 1818 | software consists of a collection of algorithms that are commonly used to | ||
| 1819 | perform (medical) image registration: the task of finding a spatial | ||
| 1820 | transformation, mapping one image (the fixed image) to another (the moving | ||
| 1821 | image), by optimizing relevant image similarity metrics.") | ||
| 1822 | (license license:asl2.0))) | ||
| 1823 | |||
| 1774 | (define-public metapixel | 1824 | (define-public metapixel |
| 1775 | ;; Follow stable branch. | 1825 | ;; Follow stable branch. |
| 1776 | (let ((commit "98ee9daa093b6c334941242e63f90b1c2876eb4f")) | 1826 | (let ((commit "98ee9daa093b6c334941242e63f90b1c2876eb4f")) |
diff --git a/gnu/packages/patches/elastix-1404.patch b/gnu/packages/patches/elastix-1404.patch new file mode 100644 index 00000000000..c98940c05fc --- /dev/null +++ b/gnu/packages/patches/elastix-1404.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | From b54984063cd61636c57add80522bad23f70bb00a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Niels Dekker <N.Dekker@lumc.nl> | ||
| 3 | Date: Tue, 3 Feb 2026 14:03:06 +0100 | ||
| 4 | Subject: [PATCH] ENH: Add relative path to lib directory to RPATH on Linux and | ||
| 5 | MacOS | ||
| 6 | |||
| 7 | Addresses issue #1402, Avoid "error while loading shared libraries" on Linux | ||
| 8 | --- | ||
| 9 | Core/CMakeLists.txt | 10 ++++++++-- | ||
| 10 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
| 11 | |||
| 12 | diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt | ||
| 13 | index 3b70abf12..204782b29 100644 | ||
| 14 | --- a/Core/CMakeLists.txt | ||
| 15 | +++ b/Core/CMakeLists.txt | ||
| 16 | @@ -277,8 +277,14 @@ set(ELASTIX_LIBRARIES elastix_lib transformix_lib PARENT_SCOPE) | ||
| 17 | |||
| 18 | if(ELASTIX_BUILD_EXECUTABLE AND NOT WIN32) | ||
| 19 | # Tell the executables where to find the required .so files. | ||
| 20 | - set_target_properties(elastix_exe transformix_exe | ||
| 21 | - PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:${ITK_DIR}") | ||
| 22 | + # Supports having the executables in bin, and the .so files in the lib directory next to the bin. | ||
| 23 | + if (APPLE) | ||
| 24 | + set_target_properties(elastix_exe transformix_exe | ||
| 25 | + PROPERTIES BUILD_RPATH "@executable_path/../lib" INSTALL_RPATH "@executable_path/../lib:${CMAKE_INSTALL_PREFIX}/lib:${ITK_DIR}") | ||
| 26 | + else() | ||
| 27 | + set_target_properties(elastix_exe transformix_exe | ||
| 28 | + PROPERTIES BUILD_RPATH "\$ORIGIN/../lib" INSTALL_RPATH "\$ORIGIN/../lib:${CMAKE_INSTALL_PREFIX}/lib:${ITK_DIR}") | ||
| 29 | + endif() | ||
| 30 | endif() | ||
| 31 | |||
| 32 | if(ELASTIX_BUILD_EXECUTABLE AND NOT ELASTIX_NO_INSTALL_EXECUTABLES) | ||
