aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/image-processing.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/image-processing.scm')
-rw-r--r--gnu/packages/image-processing.scm244
1 files changed, 152 insertions, 92 deletions
diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm
index 272f400f67..f4bf1724b4 100644
--- a/gnu/packages/image-processing.scm
+++ b/gnu/packages/image-processing.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 John Darrington <jmd@gnu.org>
-;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2014, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2019, 2022 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2014, 2021-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -19,6 +19,7 @@
;;; Copyright © 2021 Paul Garlick <pgarlick@tourbillion-technology.com>
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
+;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -38,6 +39,7 @@
(define-module (gnu packages image-processing)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
+ #:use-module (guix gexp)
#:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix git-download)
@@ -69,6 +71,7 @@
#:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
#:use-module (gnu packages imagemagick)
+ #:use-module (gnu packages linux)
#:use-module (gnu packages maths)
#:use-module (gnu packages pdf)
#:use-module (gnu packages perl)
@@ -91,10 +94,59 @@
#:use-module (ice-9 match)
#:use-module (srfi srfi-1))
+;; TODO: this is not reproducible.
+(define-public bart
+ (package
+ (name "bart")
+ (version "0.7.00")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mrirecon/bart")
+ (commit "d1b0e576c3f759089915565d5bf57832acf7b03e")))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "159rj3agr9pb9lg38b56rnw3d8wcbkmb2n718z26zpy4c6a6d9rn"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:test-target "utest"
+ #:make-flags #~(list
+ (string-append "PREFIX=" #$output)
+ "OPENBLAS=1"
+ "SCALAPACK=1"
+ (string-append "BLAS_BASE=" #$(this-package-input "openblas"))
+ (string-append "FFTW_BASE=" #$(this-package-input "fftw")))
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'patch-/bin/bash
+ (lambda _
+ (substitute* "tests/pics.mk"
+ (("/bin/bash") (which "bash"))))))))
+ (inputs
+ (list fftw
+ fftwf
+ libpng
+ openblas
+ python
+ scalapack))
+ (native-inputs
+ (list doxygen
+ util-linux)) ;for flock
+ (home-page "https://mrirecon.github.io/bart/")
+ (synopsis "Toolbox for computational magnetic resonance imaging")
+ (description "The Berkeley Advanced Reconstruction Toolbox (BART) is an
+image-reconstruction framework for Computational Magnetic Resonance Imaging.
+The tools in this software implement various reconstruction algorithms for
+Magnetic Resonance Imaging.")
+ (license license:bsd-3)))
+
(define-public dcmtk
(package
(name "dcmtk")
- (version "3.6.6")
+ (version "3.6.7")
(source
(origin
(method url-fetch)
@@ -103,8 +155,11 @@
"dcmtk" (string-join (string-split version #\.) "")
"/dcmtk-" version ".tar.gz"))
(sha256
- (base32 "13j5yf3p6qj3mr17d77r3kcqchf055hgvk1w15vmdr8f54mwcnb8"))))
+ (base32 "02kix73qhndgb56cmi5327666i6imp7hi17wwqp26q4d7s72jn3w"))))
(build-system cmake-build-system)
+ (arguments
+ ;; By default, only static archives are built.
+ (list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON")))
(inputs
(list icu4c
libjpeg-turbo
@@ -130,7 +185,7 @@ licences similar to the Modified BSD licence."))))
(define-public mia
(package
(name "mia")
- (version "2.4.6")
+ (version "2.4.7")
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/mia/mia/"
@@ -138,37 +193,41 @@ licences similar to the Modified BSD licence."))))
"/mia-" version ".tar.xz"))
(sha256
(base32
- "0j4nd5z7i3v199jh7hqqhwd4g7snchizkc7rhzanpvngqg91m1pb"))))
+ "0qpcd3n26q52dpyibm11f5l6cgscdr54p2jish39gc3p1f5h3ws1"))
+ (patches (search-patches "mia-fix-boost-headers.patch"))))
(build-system cmake-build-system)
(arguments
`(#:configure-flags
- (list "-DMIA_CREATE_NIPYPE_INTERFACES=0"
+ (list "-DMIA_CREATE_NIPYPE_INTERFACES=OFF"
"-DCMAKE_CXX_FLAGS=-fpermissive")))
(inputs
- `(("boost" ,boost)
- ("dcmtk" ,dcmtk)
- ("doxygen" ,doxygen)
- ("eigen" ,eigen)
- ("fftw" ,fftw)
- ("fftwf" ,fftwf)
- ("gsl" ,gsl)
- ("gts" ,gts)
- ("hdf5" ,hdf5)
- ("itpp" ,itpp)
- ("libjpeg" ,libjpeg-turbo)
- ("libpng" ,libpng)
- ("libtiff" ,libtiff)
- ("libxml" ,libxml2)
- ("libxml++" ,libxml++)
- ("maxflow" ,maxflow)
- ("niftilib" ,niftilib)
- ("nlopt" ,nlopt)
- ("openexr" ,openexr-2)
- ("python-lxml" ,python2-lxml)
- ("vtk" ,vtk)))
+ (list boost
+ dcmtk
+ doxygen
+ eigen
+ fftw
+ fftwf
+ gsl
+ gts
+ hdf5
+ itpp
+ libjpeg-turbo
+ libpng
+ libtiff
+ libxml2
+ libxml++
+ maxflow
+ niftilib
+ nlopt
+ openexr-2
+ python-lxml
+ ;; The build fails when using the regular VTK (currently at version
+ ;; 9), with error "addons/vtk/vtkvf.cc:23:10: fatal error:
+ ;; vtkStructuredPointsReader.h: No such file or directory".
+ vtk-7))
(native-inputs
- `(("pkg-config" ,pkg-config)
- ("python" ,python-2)))
+ (list pkg-config
+ python-wrapper))
(home-page "http://mia.sourceforge.net")
(synopsis "Toolkit for gray scale medical image analysis")
(description "MIA provides a combination of command line tools, plug-ins,
@@ -314,31 +373,31 @@ many popular formats.")
(("fenv.h") "cfenv")))))
#:tests? #f)) ;XXX: test data not included
(inputs
- `(("double-conversion" ,double-conversion)
- ("eigen" ,eigen)
- ("expat" ,expat)
- ("freetype" ,freetype)
- ("gl2ps" ,gl2ps)
- ("glew" ,glew)
- ("glu" ,glu)
- ("hdf5" ,hdf5)
- ("jpeg" ,libjpeg-turbo)
- ("jsoncpp" ,jsoncpp)
- ("libtheora" ,libtheora)
- ("libX11" ,libx11)
- ("libxml2" ,libxml2)
- ("libXt" ,libxt)
- ("lz4" ,lz4)
- ("mesa" ,mesa)
- ("netcdf" ,netcdf)
- ("png" ,libpng)
- ("proj" ,proj)
- ("python", python)
- ;("pugixml" ,pugixml)
- ("sqlite" ,sqlite)
- ("tiff" ,libtiff)
- ("xorgproto" ,xorgproto)
- ("zlib" ,zlib)))
+ (list double-conversion
+ eigen
+ expat
+ freetype
+ gl2ps
+ glew
+ glu
+ hdf5
+ libjpeg-turbo
+ jsoncpp
+ libtheora
+ libx11
+ libxml2
+ libxt
+ lz4
+ mesa
+ netcdf
+ libpng
+ proj
+ python
+ ;("pugixml" ,pugixml)
+ sqlite
+ libtiff
+ xorgproto
+ zlib))
(propagated-inputs
;; VTK's 'VTK-vtk-module-find-packages.cmake' calls
;; 'find_package(THEORA)', which in turns looks for libogg.
@@ -356,10 +415,10 @@ a suite of 3D interaction widgets, supports parallel processing, and
integrates with various databases on GUI toolkits such as Qt and Tk.")
(license license:bsd-3)))
-;; itksnap needs an older variant of VTK.
-(define-public vtk-6
- (package (inherit vtk)
- (version "6.3.0")
+(define-public vtk-7
+ (package
+ (inherit vtk)
+ (version "7.1.1")
(source (origin
(method url-fetch)
(uri (string-append "https://vtk.org/files/release/"
@@ -367,10 +426,16 @@ integrates with various databases on GUI toolkits such as Qt and Tk.")
"/VTK-" version ".tar.gz"))
(sha256
(base32
- "0pla1r5mvkgl4sl213gfdhzrypdgai0h3z5mfgm6p9jz9hsr794j"))))
- (inputs
- (modify-inputs (package-inputs vtk)
- (replace "jsoncpp" jsoncpp-for-tensorflow)))))
+ "0nm7xwwj7rnsxjdv2ssviys8nhci4n9iiiqm2y14s520hl2dsp1d"))
+ (patches (search-patches "vtk-7-python-compat.patch"
+ "vtk-7-hdf5-compat.patch"
+ "vtk-7-gcc-10-compat.patch"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments vtk)
+ ((#:configure-flags flags)
+ ;; Otherwise, the build would fail with: "error: invalid conversion
+ ;; from ‘const char*’ to ‘char*’ [-fpermissive]".
+ `(cons "-DCMAKE_CXX_FLAGS=-fpermissive" ,flags))))))
(define-public opencv
(package
@@ -428,6 +493,7 @@ integrates with various databases on GUI toolkits such as Qt and Tk.")
"-DWITH_ITT=OFF"
"-DWITH_CAROTENE=OFF" ; only visible on arm/aarch64
"-DENABLE_PRECOMPILED_HEADERS=OFF"
+ "-DOPENCV_GENERATE_PKGCONFIG=ON"
;; CPU-Features:
;; See cmake/OpenCVCompilerOptimizations.cmake
@@ -957,7 +1023,8 @@ combine the information contained in both.")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "15i5ixpryfrbf3vrrb5rici8fb585f25k0v1ljds16bp1f1msr4q"))))
+ (base32 "15i5ixpryfrbf3vrrb5rici8fb585f25k0v1ljds16bp1f1msr4q"))
+ (patches (search-patches "itk-snap-alt-glibc-compat.patch"))))
(build-system cmake-build-system)
(arguments
`(#:configure-flags
@@ -976,22 +1043,19 @@ combine the information contained in both.")
(substitute* "CMakeLists.txt"
(("install_qt5_executable\
\\(\\$\\{SNAP_MAIN_INSTALL_DIR\\}/\\$\\{SNAP_EXE\\}\\)")
- ""))
- #t))
+ ""))))
(add-after 'unpack 'disable-gui-tests
(lambda _
;; The GUI tests just time out.
(substitute* "CMakeLists.txt"
((" (Workspace|DiffSpace|ProbeIntensity|RegionCompetition\
|RandomForest|RandomForestBailOut)")
- ""))
- #t))
+ ""))))
(add-after 'unpack 'make-reproducible
(lambda _
(substitute* "CMakeLists.txt"
(("TODAY\\(SNAP_VERSION_COMPILE_DATE\\)")
- "SET(SNAP_VERSION_COMPILE_DATE \"(removed for reproducibility)\")"))
- #t))
+ "SET(SNAP_VERSION_COMPILE_DATE \"(removed for reproducibility)\")"))))
(add-after 'unpack 'prepare-submodules
(lambda* (#:key inputs #:allow-other-keys)
(rmdir "Submodules/c3d")
@@ -1002,19 +1066,16 @@ combine the information contained in both.")
(("vcl_") "std::"))
(rmdir "Submodules/greedy")
(symlink (assoc-ref inputs "greedy-src")
- "Submodules/greedy")
- #t))
+ "Submodules/greedy")))
(add-after 'unpack 'fix-includes
(lambda _
(substitute* "GUI/Model/RegistrationModel.cxx"
(("<vnl_symmetric_eigensystem.h>")
- "<vnl/algo/vnl_symmetric_eigensystem.h>"))
- #t))
+ "<vnl/algo/vnl_symmetric_eigensystem.h>"))))
(add-before 'check 'prepare-tests
(lambda _
;; Needed by at least one test.
- (setenv "HOME" "/tmp")
- #t))
+ (setenv "HOME" "/tmp")))
(add-after 'install 'wrap-executable
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
@@ -1023,23 +1084,22 @@ combine the information contained in both.")
,(map (lambda (label)
(string-append (assoc-ref inputs label)
"/lib/qt5/plugins"))
- '("qtbase" "qtdeclarative"))))
- #t))))))
+ '("qtbase" "qtdeclarative"))))))))))
(inputs
- `(("curl" ,curl)
- ("fftw" ,fftw)
- ("fftwf" ,fftwf)
- ("glu" ,glu)
- ("hdf5" ,hdf5)
- ("mesa" ,mesa-opencl)
- ;; This package does not build with either insight-toolkit 5.0.0 and
- ;; not with 4.13. It really needs to be 4.12.
- ("itk" ,insight-toolkit-4.12)
- ("vtk" ,vtk-6)
- ("qtbase" ,qtbase-5)
- ("qtdeclarative" ,qtdeclarative)
- ("vxl" ,vxl-1)
- ("zlib" ,zlib)))
+ (list curl
+ fftw
+ fftwf
+ glu
+ hdf5
+ mesa-opencl
+ ;; This package does not build with either insight-toolkit 5.0.0
+ ;; and not with 4.13. It really needs to be 4.12.
+ insight-toolkit-4.12
+ vtk-7
+ qtbase-5
+ qtdeclarative
+ vxl-1
+ zlib))
(native-inputs
`(("googletest" ,googletest)
("qttools" ,qttools)