1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
7 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
9 ;;; Copyright © 2018 Lprndn <guix@lprndn.info>
10 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages image-processing)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix utils)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system gnu)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages algebra)
37 #:use-module (gnu packages bison)
38 #:use-module (gnu packages boost)
39 #:use-module (gnu packages check)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages curl)
42 #:use-module (gnu packages documentation)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages fontutils)
45 #:use-module (gnu packages geo)
46 #:use-module (gnu packages ghostscript)
47 #:use-module (gnu packages gl)
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages gnome)
50 #:use-module (gnu packages graphics)
51 #:use-module (gnu packages graphviz)
52 #:use-module (gnu packages gstreamer)
53 #:use-module (gnu packages gtk)
54 #:use-module (gnu packages image)
55 #:use-module (gnu packages imagemagick)
56 #:use-module (gnu packages maths)
57 #:use-module (gnu packages pdf)
58 #:use-module (gnu packages perl)
59 #:use-module (gnu packages photo)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages protobuf)
62 #:use-module (gnu packages python)
63 #:use-module (gnu packages python-xyz)
64 #:use-module (gnu packages qt)
65 #:use-module (gnu packages serialization)
66 #:use-module (gnu packages tbb)
67 #:use-module (gnu packages tls)
68 #:use-module (gnu packages video)
69 #:use-module (gnu packages xiph)
70 #:use-module (gnu packages xml)
71 #:use-module (gnu packages xorg)
72 #:use-module (ice-9 match)
73 #:use-module (srfi srfi-1))
83 (string-append "ftp://dicom.offis.de/pub/dicom/offis/software/dcmtk/"
84 "dcmtk" (string-join (string-split version #\.) "")
85 "/dcmtk-" version ".tar.gz"))
87 (base32 "1h22z8g0kmvhg8lgkbikyzyphhvxvq6018a00yd6i4g0z9ag6gx9"))))
88 (build-system cmake-build-system)
90 `(;; Our ICU is too recent: “error: ‘UChar’ does not name a type“.
99 `(("doxygen" ,doxygen))) ; for HTML documentation
100 (home-page "https://dcmtk.org")
101 (synopsis "Libraries and programs implementing parts of the DICOM standard")
102 (description "DCMTK is a collection of libraries and applications
103 implementing large parts the DICOM standard. It includes software for
104 examining, constructing and converting DICOM image files, handling offline
105 media, sending and receiving images over a network connection, as well as
106 demonstrative image storage and worklist servers.")
107 (license (license:fsf-free
109 "A union of the Apache 2.0 licence and various non-copyleft
110 licences similar to the Modified BSD licence."))))
118 (uri (string-append "mirror://sourceforge/mia/mia/"
119 (version-major+minor version)
120 "/mia-" version ".tar.xz"))
123 "0j4nd5z7i3v199jh7hqqhwd4g7snchizkc7rhzanpvngqg91m1pb"))))
124 (build-system cmake-build-system)
127 (list "-DMIA_CREATE_NIPYPE_INTERFACES=0"
128 "-DCMAKE_CXX_FLAGS=-fpermissive")))
144 ("libxml++" ,libxml++)
146 ("niftilib" ,niftilib)
149 ("python-lxml" ,python2-lxml)
152 `(("pkg-config" ,pkg-config)
153 ("python" ,python-2)))
154 (home-page "http://mia.sourceforge.net")
155 (synopsis "Toolkit for gray scale medical image analysis")
156 (description "MIA provides a combination of command line tools, plug-ins,
157 and libraries that make it possible run image processing tasks interactively
158 in a command shell and to prototype using the shell's scripting language. It
159 is built around a plug-in structure that makes it easy to add functionality
160 without compromising the original code base and it makes use of a wide variety
161 of external libraries that provide additional functionality.")
162 (license license:gpl3+)))
170 (uri (string-append "https://vtk.org/files/release/"
171 (version-major+minor version)
172 "/VTK-" version ".tar.gz"))
175 "1fspgp8k0myr6p2a6wkc21ldcswb4bvmb484m12mxgk1a9vxrhrl"))))
176 (build-system cmake-build-system)
178 '(#:build-type "Release" ;Build without '-g' to save space.
179 ;; -DVTK_USE_SYSTEM_NETCDF:BOOL=TRUE requires netcdf_cxx
180 #:configure-flags '("-DVTK_USE_SYSTEM_EXPAT:BOOL=TRUE"
181 "-DVTK_USE_SYSTEM_FREETYPE:BOOL=TRUE"
182 "-DVTK_USE_SYSTEM_HDF5:BOOL=TRUE"
183 "-DVTK_USE_SYSTEM_JPEG:BOOL=TRUE"
184 "-DVTK_USE_SYSTEM_JSONCPP:BOOL=TRUE"
185 "-DVTK_USE_SYSTEM_LIBXML2:BOOL=TRUE"
186 "-DVTK_USE_SYSTEM_OGGTHEORA:BOOL=TRUE"
187 "-DVTK_USE_SYSTEM_PNG:BOOL=TRUE"
188 "-DVTK_USE_SYSTEM_TIFF:BOOL=TRUE"
189 "-DVTK_USE_SYSTEM_ZLIB:BOOL=TRUE")
190 #:tests? #f)) ;XXX: no "test" target
193 ("xorgproto" ,xorgproto)
199 ("freetype" ,freetype)
204 ("libtheora" ,libtheora)
208 (home-page "https://vtk.org/")
209 (synopsis "Libraries for 3D computer graphics")
211 "The Visualization Toolkit (VTK) is a C++ library for 3D computer graphics,
212 image processing and visualization. It supports a wide variety of
213 visualization algorithms including: scalar, vector, tensor, texture, and
214 volumetric methods; and advanced modeling techniques such as: implicit
215 modeling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay
216 triangulation. VTK has an extensive information visualization framework, has
217 a suite of 3D interaction widgets, supports parallel processing, and
218 integrates with various databases on GUI toolkits such as Qt and Tk.")
219 (license license:bsd-3)))
221 ;; itksnap needs an older variant of VTK.
223 (package (inherit vtk)
227 (uri (string-append "https://vtk.org/files/release/"
228 (version-major+minor version)
229 "/VTK-" version ".tar.gz"))
232 "0pla1r5mvkgl4sl213gfdhzrypdgai0h3z5mfgm6p9jz9hsr794j"))))
234 `(("jsoncpp" ,jsoncpp-for-tensorflow)
235 ,@(alist-delete "jsoncpp" (package-inputs vtk))))))
237 (define-public opencv
244 (url "https://github.com/opencv/opencv")
246 (file-name (git-file-name name version))
249 "06bc61r8myym4s8im10brdjfg4wxkrvsbhhl7vr1msdan2xddzi3"))
250 (modules '((guix build utils)))
253 ;; Remove external libraries. We have all available in Guix:
254 (delete-file-recursively "3rdparty")
256 ;; Milky icon set is non-free:
257 (delete-file-recursively "modules/highgui/src/files_Qt/Milky")
260 (for-each delete-file
261 '("modules/java/test/pure_test/lib/junit-4.11.jar"
262 "samples/java/sbt/sbt/sbt-launch.jar"))
264 (build-system cmake-build-system)
267 (list "-DWITH_IPP=OFF"
269 "-DWITH_CAROTENE=OFF" ; only visible on arm/aarch64
270 "-DENABLE_PRECOMPILED_HEADERS=OFF"
272 ;; FIXME: OpenEXR requires C++11 or later. Remove this when
273 ;; the default compiler is GCC 7.
274 "-DCMAKE_CXX_FLAGS=-std=gnu++11"
277 ;; See cmake/OpenCVCompilerOptimizations.cmake
278 ;; (CPU_ALL_OPTIMIZATIONS) for a list of all optimizations
279 ;; BASELINE is the minimum optimization all CPUs must support
281 ;; DISPATCH is the list of optional dispatches.
282 "-DCPU_BASELINE=SSE2"
284 ,@(match (%current-system)
286 '("-DCPU_DISPATCH=NEON;VFPV3;FP16;SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;POPCNT;AVX;FP16;AVX2;FMA3;AVX_512F;AVX512_SKX"
287 "-DCPU_DISPATCH_REQUIRE=SSE3,SSSE3,SSE4_1,SSE4_2,AVX,AVX2"))
289 '("-DCPU_BASELINE_DISABLE=NEON")) ; causes build failures
291 '("-DCPU_BASELINE=NEON"
292 "-DCPU_DISPATCH=NEON;VFPV3;FP16"))
295 "-DBUILD_PERF_TESTS=OFF"
298 (string-append "-DOPENCV_EXTRA_MODULES_PATH=" (getcwd)
299 "/opencv-contrib/modules")
302 (string-append "-DOPENCV_TEST_DATA_PATH=" (getcwd)
303 "/opencv-extra/testdata")
305 ;; Is ON by default and would try to rebuild 3rd-party protobuf,
306 ;; which we had removed, which would lead to an error:
307 "-DBUILD_PROTOBUF=OFF"
309 ;; Rebuild protobuf files, because we have a slightly different
310 ;; version than the included one. If we would not update, we
311 ;; would get a compile error later:
312 "-DPROTOBUF_UPDATE_FILES=ON"
314 ;; xfeatures2d disabled, because it downloads extra binaries from
315 ;; https://github.com/opencv/opencv_3rdparty
316 ;; defined in xfeatures2d/cmake/download_{vgg|bootdesc}.cmake
317 ;; Cmp this bug entry:
318 ;; https://github.com/opencv/opencv_contrib/issues/1131
319 "-DBUILD_opencv_xfeatures2d=OFF")
321 (modify-phases %standard-phases
322 (add-after 'unpack 'disable-broken-tests
324 ;; These tests fails with:
325 ;; vtkXOpenGLRenderWindow (0x723990): Could not find a decent config
326 ;; I think we have no OpenGL support with the Xvfb.
327 (substitute* '("modules/viz/test/test_tutorial3.cpp"
328 "modules/viz/test/test_main.cpp"
329 "modules/viz/test/tests_simple.cpp"
330 "modules/viz/test/test_viz3d.cpp")
331 (("(TEST\\(Viz, )([a-z].*\\).*)" all pre post)
332 (string-append pre "DISABLED_" post)))
334 ;; This one fails with "unknown file: Failure"
335 ;; But I couldn't figure out which file was missing:
336 (substitute* "../opencv-contrib/modules/face/test/test_face_align.cpp"
337 (("(TEST\\(CV_Face_FacemarkKazemi, )(can_detect_landmarks\\).*)"
339 (string-append pre "DISABLED_" post)))
341 ;; Failure reason: Bad accuracy
342 ;; Incorrect count of accurate poses [2nd case]: 90.000000 / 94.000000
343 (substitute* "../opencv-contrib/modules/rgbd/test/test_odometry.cpp"
344 (("(TEST\\(RGBD_Odometry_Rgbd, )(algorithmic\\).*)" all pre post)
345 (string-append pre "DISABLED_" post)))
348 (add-after 'unpack 'unpack-submodule-sources
349 (lambda* (#:key inputs #:allow-other-keys)
350 (mkdir "../opencv-extra")
351 (mkdir "../opencv-contrib")
352 (copy-recursively (assoc-ref inputs "opencv-extra")
355 (assoc-ref inputs "opencv-contrib")
356 "--strip-components=1"
357 "-C" "../opencv-contrib")))
359 (add-after 'set-paths 'add-ilmbase-include-path
360 (lambda* (#:key inputs #:allow-other-keys)
361 ;; OpenEXR propagates ilmbase, but its include files do not appear
362 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
363 ;; the CPATH to satisfy the dependency on "ImathVec.h".
365 (string-append (assoc-ref inputs "ilmbase")
367 ":" (or (getenv "CPATH") "")))
369 (add-before 'check 'start-xserver
370 (lambda* (#:key inputs #:allow-other-keys)
371 (let ((xorg-server (assoc-ref inputs "xorg-server"))
373 (setenv "HOME" (getcwd))
374 (setenv "DISPLAY" disp)
375 ;; There must be a running X server and make check doesn't start one.
376 ;; Therefore we must do it.
377 (zero? (system (format #f "~a/bin/Xvfb ~a &" xorg-server disp)))))))))
379 `(("pkg-config" ,pkg-config)
380 ("xorg-server" ,xorg-server) ; For running the tests
385 (url "https://github.com/opencv/opencv_extra")
387 (file-name (git-file-name "opencv_extra" version))
389 (base32 "08p5xnq8n1jw8svvz0fnirfg7q8dm3p4a5dl7527s5xj0f9qn7lp"))))
394 (url "https://github.com/opencv/opencv_contrib")
396 (file-name (git-file-name "opencv_contrib" version))
397 (patches (search-patches "opencv-rgbd-aarch64-test-fix.patch"))
399 (base32 "1f334glf39nk42mpqq6j732h3ql2mpz89jd4mcl678s8n73nfjh2"))))))
400 (inputs `(("libjpeg" ,libjpeg)
403 ;; ffmpeg 4.0 causes core dumps in tests.
404 ("ffmpeg" ,ffmpeg-3.4)
407 ("libgphoto2" ,libgphoto2)
410 ("gtkglext" ,gtkglext)
414 ("python-numpy" ,python-numpy)
415 ("protobuf" ,protobuf)
418 ;; These three CVEs are not a problem of OpenCV, see:
419 ;; https://github.com/opencv/opencv/issues/10998
420 (properties '((lint-hidden-cve . ("CVE-2018-7712"
423 (synopsis "Computer vision library")
424 (description "OpenCV is a library aimed at
425 real-time computer vision, including several hundred computer
426 vision algorithms. It can be used to do things like:
429 @item image and video input and output
430 @item image and video processing
432 @item feature recognition
434 @item facial recognition
436 @item structure from motion
437 @item augmented reality
438 @item machine learning
440 (home-page "https://opencv.org/")
441 (license license:bsd-3)))
451 "https://github.com/libvips/libvips/releases/download/v"
452 version "/vips-" version ".tar.gz"))
454 (base32 "01gjhcrl6zj7mcj1al717v5jsniahplqhz1xkfh2j78vyfl1hxff"))))
455 (build-system gnu-build-system)
457 `(("pkg-config" ,pkg-config)
458 ("gobject-introspection" ,gobject-introspection)))
474 ("niftilib" ,niftilib)
477 ("imagemagick" ,imagemagick)
481 (home-page "https://libvips.github.io/libvips/")
482 (synopsis "Multithreaded image processing system with low memory needs")
484 "VIPS is a demand-driven, horizontally threaded image processing library.
485 It's particularly good at processing large images, working with colour,
486 scientific analysis, and general research & development.
488 Compared to most image processing libraries VIPS needs little RAM and runs
489 quickly, especially on machines with more than one CPU core. This is primarily
490 due to its architecture which automatically parallelises the image workflows.")
491 (license license:lgpl2.1+)))
500 (uri (string-append "https://github.com/libvips/nip2/releases/download/v"
501 version "/nip2-" version ".tar.gz" ))
503 (base32 "0l7n427njif53npqn02gfjjly8y3khbrkzqxp10j5vp9h97psgiw"))))
504 (build-system gnu-build-system)
507 (modify-phases %standard-phases
508 ;; test_conv.ws keep failing so disabling for now.
509 (add-after 'unpack 'disable-test-conv
511 (delete-file "test/workspaces/test_conv.ws")
513 (add-before 'check 'set-home
515 (setenv "HOME" "/tmp") #t)))))
523 ("libjpeg" ,libjpeg) ; required by vips.pc
527 ("imagemagick" ,imagemagick)
538 ("pkg-config" ,pkg-config)))
539 (home-page "https://github.com/libvips/nip2")
540 (synopsis "Spreadsheet-like GUI for libvips")
541 (description "This package provide a graphical user interface (GUI) for
542 the VIPS image processing library. It's a little like a spreadsheet: you
543 create a set of formula connecting your objects together, and on a change nip2
545 (license license:gpl2+)))
555 (url "https://github.com/vxl/vxl.git")
556 (commit (string-append "v" version))))
557 (file-name (git-file-name name version))
559 (base32 "0949hw57szq8943f1whwqaz591xjmb19kj803hcv74hdai2b0ycg"))
560 (modules '((guix build utils)))
561 ;; TODO: vxl includes an old version of dcmtk. It won't build with
565 (for-each delete-file-recursively
572 (substitute* "v3p/CMakeLists.txt"
573 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
576 (build-system cmake-build-system)
578 `(("libgeotiff" ,libgeotiff)
583 (home-page "https://github.com/vxl/vxl/")
584 (synopsis "Collection of C++ libraries for computer vision")
585 (description "VXL (the Vision-something-Libraries) is a collection of C++
586 libraries designed for computer vision research and implementation.")
587 (license license:bsd-3)))
590 (package (inherit vxl)
597 (url "https://github.com/vxl/vxl.git")
598 (commit (string-append "v" version))))
599 (file-name (git-file-name name version))
601 (base32 "1g4mr2cc58jwm0vasscbd4y5380wj3ahkvq121z4gs83fhavvxgz"))
602 (modules '((guix build utils)))
605 (for-each delete-file-recursively
611 (substitute* "v3p/CMakeLists.txt"
612 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
617 ;; Needed for itk-snap
618 (list "-DVNL_CONFIG_LEGACY_METHODS=ON")))))
620 (define-public insight-toolkit
622 (name "insight-toolkit")
627 (uri (string-append "https://github.com/InsightSoftwareConsortium/ITK/"
628 "releases/download/v" version "/InsightToolkit-"
631 (base32 "0bs63mk4q8jmx38f031jy5w5n9yy5ng9x8ijwinvjyvas8cichqi"))))
632 (build-system cmake-build-system)
634 `(#:tests? #f ; tests require network access and external data
637 "-DITK_USE_SYSTEM_LIBRARIES=ON"
638 "-DITK_USE_SYSTEM_GOOGLETEST=ON"
639 "-DITK_BUILD_SHARED=ON"
640 ;; This prevents "GTest::GTest" from being added to the ITK_LIBRARIES
641 ;; variable in the installed CMake files. This is necessary as other
642 ;; packages using insight-toolkit could not be configured otherwise.
643 "-DGTEST_ROOT=gtest")
645 (modify-phases %standard-phases
646 (add-after 'unpack 'do-not-tune
648 (substitute* "CMake/ITKSetStandardCompilerFlags.cmake"
649 (("-mute=native") ""))
660 ("mesa" ,mesa-opencl)
667 `(("googletest" ,googletest)
668 ("pkg-config" ,pkg-config)))
669 (home-page "https://github.com/InsightSoftwareConsortium/ITK/")
670 (synopsis "Scientific image processing, segmentation and registration")
671 (description "The Insight Toolkit (ITK) is a toolkit for N-dimensional
672 scientific image processing, segmentation, and registration. Segmentation is
673 the process of identifying and classifying data found in a digitally sampled
674 representation. Typically the sampled representation is an image acquired
675 from such medical instrumentation as CT or MRI scanners. Registration is the
676 task of aligning or developing correspondences between data. For example, in
677 the medical environment, a CT scan may be aligned with a MRI scan in order to
678 combine the information contained in both.")
679 (license license:asl2.0)))
681 (define-public insight-toolkit-4
682 (package (inherit insight-toolkit)
687 (uri (string-append "https://github.com/InsightSoftwareConsortium/ITK/"
688 "releases/download/v" version "/InsightToolkit-"
691 (base32 "19cgfpd63gqrvc3m27m394gy2d7w79g5y6lvznb5qqr49lihbgns"))))
693 `(#:tests? #f ; tests require network access and external data
695 '("-DITKV3_COMPATIBILITY=ON" ; needed for itk-snap
697 "-DITK_USE_SYSTEM_LIBRARIES=ON"
698 "-DITK_USE_SYSTEM_GOOGLETEST=ON"
699 "-DITK_USE_SYSTEM_VXL=ON")))))
701 (define-public insight-toolkit-4.12
702 (package (inherit insight-toolkit-4)
707 (uri (string-append "mirror://sourceforge/itk/itk/4.12/"
708 "InsightToolkit-" version ".tar.xz"))
710 (base32 "1qw9mxbh083siljygahl4gdfv91xvfd8hfl7ghwii19f60xrvn2w"))))))
712 (define-public itk-snap
720 (url "https://git.code.sf.net/p/itk-snap/src")
721 (commit (string-append "v" version))))
722 (file-name (git-file-name name version))
724 (base32 "15i5ixpryfrbf3vrrb5rici8fb585f25k0v1ljds16bp1f1msr4q"))))
725 (build-system cmake-build-system)
728 (list "-DSNAP_VERSION_GIT_SHA1=release"
729 "-DSNAP_VERSION_GIT_BRANCH=release"
730 "-DSNAP_VERSION_GIT_TIMESTAMP=0"
731 "-DSNAP_PACKAGE_QT_PLUGINS=OFF"
732 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
733 "-DCMAKE_CXX_FLAGS=-std=gnu++11 -fpermissive")
735 (modify-phases %standard-phases
736 ;; During the installation phase all libraries provided by all
737 ;; dependencies will be copied to the lib directory. That's insane,
738 ;; so we disable this.
739 (add-after 'unpack 'do-not-copy-dependencies
741 (substitute* "CMakeLists.txt"
742 (("install_qt5_executable\
743 \\(\\$\\{SNAP_MAIN_INSTALL_DIR\\}/\\$\\{SNAP_EXE\\}\\)")
746 (add-after 'unpack 'disable-gui-tests
748 ;; The GUI tests just time out.
749 (substitute* "CMakeLists.txt"
750 ((" (Workspace|DiffSpace|ProbeIntensity|RegionCompetition\
751 |RandomForest|RandomForestBailOut)")
754 (add-after 'unpack 'make-reproducible
756 (substitute* "CMakeLists.txt"
757 (("TODAY\\(SNAP_VERSION_COMPILE_DATE\\)")
758 "SET(SNAP_VERSION_COMPILE_DATE \"(removed for reproducibility)\")"))
760 (add-after 'unpack 'prepare-submodules
761 (lambda* (#:key inputs #:allow-other-keys)
762 (rmdir "Submodules/c3d")
763 (copy-recursively (assoc-ref inputs "c3d-src")
765 (substitute* '("Submodules/c3d/adapters/BiasFieldCorrectionN4.cxx"
766 "Submodules/c3d/adapters/ApplyMetric.cxx")
768 (rmdir "Submodules/greedy")
769 (symlink (assoc-ref inputs "greedy-src")
772 (add-after 'unpack 'fix-includes
774 (substitute* "GUI/Model/RegistrationModel.cxx"
775 (("<vnl_symmetric_eigensystem.h>")
776 "<vnl/algo/vnl_symmetric_eigensystem.h>"))
778 (add-before 'check 'prepare-tests
780 ;; Needed by at least one test.
781 (setenv "HOME" "/tmp")
783 (add-after 'install 'wrap-executable
784 (lambda* (#:key inputs outputs #:allow-other-keys)
785 (let ((out (assoc-ref outputs "out")))
786 (wrap-program (string-append out "/bin/itksnap")
787 `("QT_PLUGIN_PATH" ":" prefix
788 ,(map (lambda (label)
789 (string-append (assoc-ref inputs label)
791 '("qtbase" "qtdeclarative"))))
799 ("mesa" ,mesa-opencl)
800 ;; This package does not build with either insight-toolkit 5.0.0 and
801 ;; not with 4.13. It really needs to be 4.12.
802 ("itk" ,insight-toolkit-4.12)
805 ("qtdeclarative" ,qtdeclarative)
810 `(("googletest" ,googletest)
811 ("pkg-config" ,pkg-config)
813 ,(let* ((commit "f521358db26e00002c911cc47bf463b043942ad3")
815 (version (git-version "0" revision commit)))
819 (url "https://github.com/pyushkevich/c3d.git")
821 (file-name (git-file-name "c3d" version))
824 "0kyv3rxrxwr8c3sa9zv01lsnhk95b27gx1s870k3yi8qp52h7bx3")))))
825 ;; We are using an arbitrary commit from 2017 because the latest
826 ;; version breaks the build...
828 ,(let* ((commit "97e340f7e8e66597599144947775e6039e79a0d3")
830 (version (git-version "0" revision commit)))
834 (url "https://github.com/pyushkevich/greedy.git")
836 (file-name (git-file-name "greedy" version))
839 "0k5bc9za4jrc8z9dj08z1rkcp5xf0gnd1d2jmi1w9ny4vxh2q2ab")))))))
840 (home-page "https://sourceforge.net/p/itk-snap/")
841 (synopsis "Medical image segmentation")
842 (description "ITK-SNAP is a tool for segmenting anatomical structures in
843 medical images. It provides an automatic active contour segmentation
844 pipeline, along with supporting a manual segmentation toolbox. ITK-SNAP has a
845 full-featured UI aimed at clinical researchers.")
846 ;; This includes the submodules greedy and c3d.
847 (license license:gpl3+)))