gnu: gmic: Update to 2.9.7.
[jackhill/guix/guix.git] / gnu / packages / image-processing.scm
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, 2021 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–2021 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, 2021 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
12 ;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
13 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
14 ;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot>
15 ;;; Copyright © 2021 Oleh Malyi <astroclubzp@gmail.com>
16 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
17 ;;; Copyright © 2021 Andy Tai <atai@atai.org>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
25 ;;;
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
30 ;;;
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34 (define-module (gnu packages image-processing)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix packages)
37 #:use-module (guix utils)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system qt)
41 #:use-module (guix build-system cmake)
42 #:use-module (guix build-system gnu)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages algebra)
45 #:use-module (gnu packages bison)
46 #:use-module (gnu packages boost)
47 #:use-module (gnu packages check)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages curl)
50 #:use-module (gnu packages docbook)
51 #:use-module (gnu packages documentation)
52 #:use-module (gnu packages flex)
53 #:use-module (gnu packages fontutils)
54 #:use-module (gnu packages geo)
55 #:use-module (gnu packages ghostscript)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gnome)
59 #:use-module (gnu packages graphics)
60 #:use-module (gnu packages graphviz)
61 #:use-module (gnu packages gstreamer)
62 #:use-module (gnu packages gtk)
63 #:use-module (gnu packages icu4c)
64 #:use-module (gnu packages image)
65 #:use-module (gnu packages imagemagick)
66 #:use-module (gnu packages maths)
67 #:use-module (gnu packages pdf)
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages photo)
70 #:use-module (gnu packages pkg-config)
71 #:use-module (gnu packages protobuf)
72 #:use-module (gnu packages python)
73 #:use-module (gnu packages python-xyz)
74 #:use-module (gnu packages qt)
75 #:use-module (gnu packages serialization)
76 #:use-module (gnu packages sqlite)
77 #:use-module (gnu packages tbb)
78 #:use-module (gnu packages tls)
79 #:use-module (gnu packages version-control)
80 #:use-module (gnu packages video)
81 #:use-module (gnu packages xiph)
82 #:use-module (gnu packages xml)
83 #:use-module (gnu packages xorg)
84 #:use-module (ice-9 match)
85 #:use-module (srfi srfi-1))
86
87 (define-public dcmtk
88 (package
89 (name "dcmtk")
90 (version "3.6.6")
91 (source
92 (origin
93 (method url-fetch)
94 (uri
95 (string-append "ftp://dicom.offis.de/pub/dicom/offis/software/dcmtk/"
96 "dcmtk" (string-join (string-split version #\.) "")
97 "/dcmtk-" version ".tar.gz"))
98 (sha256
99 (base32 "13j5yf3p6qj3mr17d77r3kcqchf055hgvk1w15vmdr8f54mwcnb8"))))
100 (build-system cmake-build-system)
101 (inputs
102 `(("icu4c" ,icu4c)
103 ("libjpeg" ,libjpeg-turbo)
104 ("libpng" ,libpng)
105 ("libtiff" ,libtiff)
106 ("libxml2" ,libxml2)
107 ("openssl" ,openssl)
108 ("zlib" ,zlib)))
109 (native-inputs
110 `(("doxygen" ,doxygen))) ; for HTML documentation
111 (home-page "https://dcmtk.org")
112 (synopsis "Libraries and programs implementing parts of the DICOM standard")
113 (description "DCMTK is a collection of libraries and applications
114 implementing large parts the DICOM standard. It includes software for
115 examining, constructing and converting DICOM image files, handling offline
116 media, sending and receiving images over a network connection, as well as
117 demonstrative image storage and worklist servers.")
118 (license (license:fsf-free
119 "file://COPYRIGHT"
120 "A union of the Apache 2.0 licence and various non-copyleft
121 licences similar to the Modified BSD licence."))))
122
123 (define-public mia
124 (package
125 (name "mia")
126 (version "2.4.6")
127 (source (origin
128 (method url-fetch)
129 (uri (string-append "mirror://sourceforge/mia/mia/"
130 (version-major+minor version)
131 "/mia-" version ".tar.xz"))
132 (sha256
133 (base32
134 "0j4nd5z7i3v199jh7hqqhwd4g7snchizkc7rhzanpvngqg91m1pb"))))
135 (build-system cmake-build-system)
136 (arguments
137 `(#:configure-flags
138 (list "-DMIA_CREATE_NIPYPE_INTERFACES=0"
139 "-DCMAKE_CXX_FLAGS=-fpermissive")))
140 (inputs
141 `(("boost" ,boost)
142 ("dcmtk" ,dcmtk)
143 ("doxygen" ,doxygen)
144 ("eigen" ,eigen)
145 ("fftw" ,fftw)
146 ("fftwf" ,fftwf)
147 ("gsl" ,gsl)
148 ("gts" ,gts)
149 ("hdf5" ,hdf5)
150 ("itpp" ,itpp)
151 ("libjpeg" ,libjpeg-turbo)
152 ("libpng" ,libpng)
153 ("libtiff" ,libtiff)
154 ("libxml" ,libxml2)
155 ("libxml++" ,libxml++)
156 ("maxflow" ,maxflow)
157 ("niftilib" ,niftilib)
158 ("nlopt" ,nlopt)
159 ("openexr" ,openexr)
160 ("python-lxml" ,python2-lxml)
161 ("vtk" ,vtk)))
162 (native-inputs
163 `(("pkg-config" ,pkg-config)
164 ("python" ,python-2)))
165 (home-page "http://mia.sourceforge.net")
166 (synopsis "Toolkit for gray scale medical image analysis")
167 (description "MIA provides a combination of command line tools, plug-ins,
168 and libraries that make it possible run image processing tasks interactively
169 in a command shell and to prototype using the shell's scripting language. It
170 is built around a plug-in structure that makes it easy to add functionality
171 without compromising the original code base and it makes use of a wide variety
172 of external libraries that provide additional functionality.")
173 (license license:gpl3+)))
174
175 (define-public opencolorio
176 (package
177 (name "opencolorio")
178 (version "1.1.1")
179 (source
180 (origin
181 (method git-fetch)
182 (uri (git-reference
183 (url "https://github.com/AcademySoftwareFoundation/OpenColorIO")
184 (commit (string-append "v" version))))
185 (sha256
186 (base32 "12srvxca51czpfjl0gabpidj9n84mw78ivxy5w75qhq2mmc798sb"))
187 (file-name (git-file-name name version))
188 (modules '((guix build utils)))
189 (snippet
190 `(begin
191 ;; Remove bundled tarballs, patches, and .jars(!). XXX: Upstream
192 ;; claims to have fixed USE_EXTERNAL_YAML, but it still fails with:
193 ;; https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/517
194 ;; When removing it, also remove it from the licence field comment.
195 (for-each delete-file-recursively
196 (filter
197 (lambda (full-name)
198 (let ((file (basename full-name)))
199 (not (or (string-prefix? "yaml-cpp-0.3" file)
200 (string=? "unittest.h" file)))))
201 (find-files "ext" ".*")))
202
203 #t))))
204 (build-system cmake-build-system)
205 (arguments
206 `(#:configure-flags
207 (list (string-append "-DCMAKE_CXX_FLAGS="
208 "-Wno-error=deprecated-declarations "
209 "-Wno-error=unused-function")
210 "-DOCIO_BUILD_STATIC=OFF"
211 ;; "-DUSE_EXTERNAL_YAML=ON"
212 "-DUSE_EXTERNAL_TINYXML=ON"
213 "-DUSE_EXTERNAL_LCMS=ON")
214 #:phases
215 (modify-phases %standard-phases
216 (add-after 'unpack 'patch-test-suite
217 (lambda _
218 (substitute* "src/core_tests/CMakeLists.txt"
219 (("/bin/sh") (which "bash")))
220 #t)))))
221 (native-inputs
222 `(("git" ,git)
223 ("pkg-config" ,pkg-config)))
224 (inputs
225 ;; XXX Adding freeglut, glew, ilmbase, mesa, and openimageio for
226 ;; ocioconvert fails: error: conflicting declaration ?typedef void
227 ;; (* PFNGLGETFRAGMENTMATERIALFVSGIXPROC)(GLenum, GLenum, GLfloat*)
228 `(("lcms" ,lcms)
229 ("openexr" ,openexr)
230 ("tinyxml" ,tinyxml)))
231 (home-page "https://opencolorio.org")
232 (synopsis "Color management for visual effects and animation")
233 (description
234 "OpenColorIO, or OCIO, is a complete color management solution geared
235 towards motion picture production, with an emphasis on visual effects and
236 computer animation. It provides a straightforward and consistent user
237 experience across all supporting applications while allowing for sophisticated
238 back-end configuration options suitable for high-end production usage.
239
240 OCIO is compatible with the @acronym{ACES, Academy Color Encoding
241 Specification} and is @acronym{LUT, look-up table}-format agnostic, supporting
242 many popular formats.")
243 (license (list license:expat ; docs/ociotheme/static, ext/yaml-cpp-*
244 license:zlib ; src/core/md5
245 license:bsd-3)))) ; the rest
246
247 (define-public vtk
248 (package
249 (name "vtk")
250 (version "9.0.1")
251 (source (origin
252 (method url-fetch)
253 (uri (string-append "https://vtk.org/files/release/"
254 (version-major+minor version)
255 "/VTK-" version ".tar.gz"))
256 (sha256
257 (base32
258 "1ir2lq9i45ls374lcmjzw0nrm5l5hnm1w47lg8g8d0n2j7hsaf8v"))
259 (patches
260 (search-patches "vtk-fix-freetypetools-build-failure.patch"))
261 (modules '((guix build utils)))
262 (snippet
263 '(begin
264 (for-each
265 (lambda (dir)
266 (delete-file-recursively
267 (string-append "ThirdParty/" dir "/vtk" dir)))
268 ;; pugixml depended upon unconditionally
269 '("doubleconversion" "eigen" "expat" "freetype" "gl2ps"
270 "glew" "hdf5" "jpeg" "jsoncpp" "libproj" "libxml2" "lz4"
271 "netcdf" "ogg" "png" "sqlite" "theora" "tiff" "zlib"))
272 #t))))
273 (properties `((release-monitoring-url . "https://vtk.org/download/")))
274 (build-system cmake-build-system)
275 (arguments
276 '(#:build-type "Release" ;Build without '-g' to save space.
277 #:configure-flags '(;"-DBUILD_TESTING:BOOL=TRUE"
278 ; ; not honored
279 "-DVTK_USE_EXTERNAL=OFF" ;; default
280 "-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON"
281 "-DVTK_MODULE_USE_EXTERNAL_VTK_eigen=ON"
282 "-DVTK_MODULE_USE_EXTERNAL_VTK_expat=ON"
283 "-DVTK_MODULE_USE_EXTERNAL_VTK_freetype=ON"
284 "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=ON"
285 "-DVTK_MODULE_USE_EXTERNAL_VTK_glew=ON"
286 "-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=ON"
287 "-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg=ON"
288 "-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp=ON"
289 "-DVTK_MODULE_USE_EXTERNAL_VTK_libproj=ON"
290 "-DVTK_MODULE_USE_EXTERNAL_VTK_libxml2=ON"
291 "-DVTK_MODULE_USE_EXTERNAL_VTK_lz4=ON"
292 "-DVTK_MODULE_USE_EXTERNAL_VTK_netcdf=ON"
293 "-DVTK_MODULE_USE_EXTERNAL_VTK_ogg=ON"
294 "-DVTK_MODULE_USE_EXTERNAL_VTK_png=ON"
295 ;"-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=ON" ; breaks IO/CityGML
296 "-DVTK_MODULE_USE_EXTERNAL_VTK_sqlite=ON"
297 "-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON"
298 "-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON"
299 "-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON"
300 )
301 #:phases
302 (modify-phases %standard-phases
303 (add-after 'unpack 'patch-sources
304 (lambda _
305 (substitute* "Common/Core/vtkFloatingPointExceptions.cxx"
306 (("<fenv.h>") "<cfenv>"))
307 (substitute* "Common/Core/CMakeLists.txt"
308 (("fenv.h") "cfenv")))))
309 #:tests? #f)) ;XXX: test data not included
310 (inputs
311 `(("double-conversion" ,double-conversion)
312 ("eigen" ,eigen)
313 ("expat" ,expat)
314 ("freetype" ,freetype)
315 ("gl2ps" ,gl2ps)
316 ("glew" ,glew)
317 ("glu" ,glu)
318 ("hdf5" ,hdf5)
319 ("jpeg" ,libjpeg-turbo)
320 ("jsoncpp" ,jsoncpp)
321 ("libtheora" ,libtheora)
322 ("libX11" ,libx11)
323 ("libxml2" ,libxml2)
324 ("libXt" ,libxt)
325 ("lz4" ,lz4)
326 ("mesa" ,mesa)
327 ("netcdf" ,netcdf)
328 ("png" ,libpng)
329 ("proj" ,proj.4)
330 ;("pugixml" ,pugixml)
331 ("sqlite" ,sqlite)
332 ("tiff" ,libtiff)
333 ("xorgproto" ,xorgproto)
334 ("zlib" ,zlib)))
335 (propagated-inputs
336 ;; VTK's 'VTK-vtk-module-find-packages.cmake' calls
337 ;; 'find_package(THEORA)', which in turns looks for libogg.
338 `(("libogg" ,libogg)))
339 (home-page "https://vtk.org/")
340 (synopsis "Libraries for 3D computer graphics")
341 (description
342 "The Visualization Toolkit (VTK) is a C++ library for 3D computer graphics,
343 image processing and visualization. It supports a wide variety of
344 visualization algorithms including: scalar, vector, tensor, texture, and
345 volumetric methods; and advanced modeling techniques such as: implicit
346 modeling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay
347 triangulation. VTK has an extensive information visualization framework, has
348 a suite of 3D interaction widgets, supports parallel processing, and
349 integrates with various databases on GUI toolkits such as Qt and Tk.")
350 (license license:bsd-3)))
351
352 ;; itksnap needs an older variant of VTK.
353 (define-public vtk-6
354 (package (inherit vtk)
355 (version "6.3.0")
356 (source (origin
357 (method url-fetch)
358 (uri (string-append "https://vtk.org/files/release/"
359 (version-major+minor version)
360 "/VTK-" version ".tar.gz"))
361 (sha256
362 (base32
363 "0pla1r5mvkgl4sl213gfdhzrypdgai0h3z5mfgm6p9jz9hsr794j"))))
364 (inputs
365 `(("jsoncpp" ,jsoncpp-for-tensorflow)
366 ,@(alist-delete "jsoncpp" (package-inputs vtk))))))
367
368 (define-public opencv
369 (package
370 (name "opencv")
371 (version "3.4.3")
372 (source (origin
373 (method git-fetch)
374 (uri (git-reference
375 (url "https://github.com/opencv/opencv")
376 (commit version)))
377 (file-name (git-file-name name version))
378 (sha256
379 (base32
380 "06bc61r8myym4s8im10brdjfg4wxkrvsbhhl7vr1msdan2xddzi3"))
381 (patches
382 (search-patches "opencv-fix-build-of-grfmt_jpeg2000.cpp.patch"))
383 (modules '((guix build utils)))
384 (snippet
385 '(begin
386 ;; Remove external libraries. We have all available in Guix:
387 (delete-file-recursively "3rdparty")
388
389 ;; Milky icon set is non-free:
390 (delete-file-recursively "modules/highgui/src/files_Qt/Milky")
391
392 ;; Some jars found:
393 (for-each delete-file
394 '("modules/java/test/pure_test/lib/junit-4.11.jar"
395 "samples/java/sbt/sbt/sbt-launch.jar"))
396 #t))))
397 (build-system cmake-build-system)
398 (arguments
399 `(#:configure-flags
400 (list "-DWITH_IPP=OFF"
401 "-DWITH_ITT=OFF"
402 "-DWITH_CAROTENE=OFF" ; only visible on arm/aarch64
403 "-DENABLE_PRECOMPILED_HEADERS=OFF"
404
405 ;; CPU-Features:
406 ;; See cmake/OpenCVCompilerOptimizations.cmake
407 ;; (CPU_ALL_OPTIMIZATIONS) for a list of all optimizations
408 ;; BASELINE is the minimum optimization all CPUs must support
409 ;;
410 ;; DISPATCH is the list of optional dispatches.
411 "-DCPU_BASELINE=SSE2"
412
413 ,@(match (%current-system)
414 ("x86_64-linux"
415 '("-DCPU_DISPATCH=NEON;VFPV3;FP16;SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;POPCNT;AVX;FP16;AVX2;FMA3;AVX_512F;AVX512_SKX"
416 "-DCPU_DISPATCH_REQUIRE=SSE3,SSSE3,SSE4_1,SSE4_2,AVX,AVX2"))
417 ("armhf-linux"
418 '("-DCPU_BASELINE_DISABLE=NEON")) ; causes build failures
419 ("aarch64-linux"
420 '("-DCPU_BASELINE=NEON"
421 "-DCPU_DISPATCH=NEON;VFPV3;FP16"))
422 (_ '()))
423
424 "-DBUILD_PERF_TESTS=OFF"
425 "-DBUILD_TESTS=ON"
426
427 (string-append "-DOPENCV_EXTRA_MODULES_PATH=" (getcwd)
428 "/opencv-contrib/modules")
429
430 ;;Define test data:
431 (string-append "-DOPENCV_TEST_DATA_PATH=" (getcwd)
432 "/opencv-extra/testdata")
433
434 ;; Is ON by default and would try to rebuild 3rd-party protobuf,
435 ;; which we had removed, which would lead to an error:
436 "-DBUILD_PROTOBUF=OFF"
437
438 ;; Rebuild protobuf files, because we have a slightly different
439 ;; version than the included one. If we would not update, we
440 ;; would get a compile error later:
441 "-DPROTOBUF_UPDATE_FILES=ON"
442
443 ;; xfeatures2d disabled, because it downloads extra binaries from
444 ;; https://github.com/opencv/opencv_3rdparty
445 ;; defined in xfeatures2d/cmake/download_{vgg|bootdesc}.cmake
446 ;; Cmp this bug entry:
447 ;; https://github.com/opencv/opencv_contrib/issues/1131
448 "-DBUILD_opencv_xfeatures2d=OFF")
449 #:phases
450 (modify-phases %standard-phases
451 (add-after 'unpack 'disable-broken-tests
452 (lambda _
453 ;; These tests fails with:
454 ;; vtkXOpenGLRenderWindow (0x723990): Could not find a decent config
455 ;; I think we have no OpenGL support with the Xvfb.
456 (substitute* '("modules/viz/test/test_tutorial3.cpp"
457 "modules/viz/test/test_main.cpp"
458 "modules/viz/test/tests_simple.cpp"
459 "modules/viz/test/test_viz3d.cpp")
460 (("(TEST\\(Viz, )([a-z].*\\).*)" all pre post)
461 (string-append pre "DISABLED_" post)))
462
463 ;; This one fails with "unknown file: Failure"
464 ;; But I couldn't figure out which file was missing:
465 (substitute* "../opencv-contrib/modules/face/test/test_face_align.cpp"
466 (("(TEST\\(CV_Face_FacemarkKazemi, )(can_detect_landmarks\\).*)"
467 all pre post)
468 (string-append pre "DISABLED_" post)))
469
470 ;; Failure reason: Bad accuracy
471 ;; Incorrect count of accurate poses [2nd case]: 90.000000 / 94.000000
472 (substitute* "../opencv-contrib/modules/rgbd/test/test_odometry.cpp"
473 (("(TEST\\(RGBD_Odometry_Rgbd, )(algorithmic\\).*)" all pre post)
474 (string-append pre "DISABLED_" post)))
475 #t))
476
477 (add-after 'unpack 'unpack-submodule-sources
478 (lambda* (#:key inputs #:allow-other-keys)
479 (mkdir "../opencv-extra")
480 (mkdir "../opencv-contrib")
481 (copy-recursively (assoc-ref inputs "opencv-extra")
482 "../opencv-extra")
483 (invoke "tar" "xvf"
484 (assoc-ref inputs "opencv-contrib")
485 "--strip-components=1"
486 "-C" "../opencv-contrib")))
487
488 (add-after 'set-paths 'add-ilmbase-include-path
489 (lambda* (#:key inputs #:allow-other-keys)
490 ;; OpenEXR propagates ilmbase, but its include files do not appear
491 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
492 ;; the CPATH to satisfy the dependency on "ImathVec.h".
493 (setenv "CPATH"
494 (string-append (assoc-ref inputs "ilmbase")
495 "/include/OpenEXR"
496 ":" (or (getenv "CPATH") "")))
497 #t))
498 (add-before 'check 'start-xserver
499 (lambda* (#:key inputs #:allow-other-keys)
500 (let ((xorg-server (assoc-ref inputs "xorg-server"))
501 (disp ":1"))
502 (setenv "HOME" (getcwd))
503 (setenv "DISPLAY" disp)
504 ;; There must be a running X server and make check doesn't start one.
505 ;; Therefore we must do it.
506 (zero? (system (format #f "~a/bin/Xvfb ~a &" xorg-server disp)))))))))
507 (native-inputs
508 `(("pkg-config" ,pkg-config)
509 ("xorg-server" ,xorg-server-for-tests) ; For running the tests
510 ("opencv-extra"
511 ,(origin
512 (method git-fetch)
513 (uri (git-reference
514 (url "https://github.com/opencv/opencv_extra")
515 (commit version)))
516 (file-name (git-file-name "opencv_extra" version))
517 (sha256
518 (base32 "08p5xnq8n1jw8svvz0fnirfg7q8dm3p4a5dl7527s5xj0f9qn7lp"))))
519 ("opencv-contrib"
520 ,(origin
521 (method git-fetch)
522 (uri (git-reference
523 (url "https://github.com/opencv/opencv_contrib")
524 (commit version)))
525 (file-name (git-file-name "opencv_contrib" version))
526 (patches (search-patches "opencv-rgbd-aarch64-test-fix.patch"))
527 (sha256
528 (base32 "1f334glf39nk42mpqq6j732h3ql2mpz89jd4mcl678s8n73nfjh2"))))))
529 (inputs `(("libjpeg" ,libjpeg-turbo)
530 ("libpng" ,libpng)
531 ("jasper" ,jasper)
532 ;; ffmpeg 4.0 causes core dumps in tests.
533 ("ffmpeg" ,ffmpeg-3.4)
534 ("libtiff" ,libtiff)
535 ("hdf5" ,hdf5)
536 ("libgphoto2" ,libgphoto2)
537 ("libwebp" ,libwebp)
538 ("zlib" ,zlib)
539 ("gtkglext" ,gtkglext)
540 ("openexr" ,openexr)
541 ("ilmbase" ,ilmbase)
542 ("gtk+" ,gtk+-2)
543 ("python-numpy" ,python-numpy)
544 ("protobuf" ,protobuf)
545 ("vtk" ,vtk)
546 ("python" ,python)))
547 ;; These three CVEs are not a problem of OpenCV, see:
548 ;; https://github.com/opencv/opencv/issues/10998
549 (properties '((lint-hidden-cve . ("CVE-2018-7712"
550 "CVE-2018-7713"
551 "CVE-2018-7714"))))
552 (synopsis "Computer vision library")
553 (description "OpenCV is a library aimed at
554 real-time computer vision, including several hundred computer
555 vision algorithms. It can be used to do things like:
556
557 @itemize
558 @item image and video input and output
559 @item image and video processing
560 @item displaying
561 @item feature recognition
562 @item segmentation
563 @item facial recognition
564 @item stereo vision
565 @item structure from motion
566 @item augmented reality
567 @item machine learning
568 @end itemize\n")
569 (home-page "https://opencv.org/")
570 (license license:bsd-3)))
571
572 (define-public vips
573 (package
574 (name "vips")
575 (version "8.10.6")
576 (source
577 (origin
578 (method url-fetch)
579 (uri (string-append
580 "https://github.com/libvips/libvips/releases/download/v"
581 version "/vips-" version ".tar.gz"))
582 (sha256
583 (base32 "0vjsh3i0861f6h9as3bch956cidz824zz499pvhjs3lfjn6hhs14"))))
584 (build-system gnu-build-system)
585 (native-inputs
586 `(("gobject-introspection" ,gobject-introspection)
587 ("pkg-config" ,pkg-config)))
588 (inputs
589 `(("expat" ,expat)
590 ("fftw" ,fftw)
591 ("giflib" ,giflib)
592 ("glib" ,glib)
593 ("hdf5" ,hdf5)
594 ("imagemagick" ,imagemagick)
595 ("lcms" ,lcms)
596 ("libexif" ,libexif)
597 ("libgsf" ,libgsf)
598 ("libjpeg" ,libjpeg-turbo)
599 ("libpng" ,libpng)
600 ("librsvg" ,librsvg)
601 ("libtiff" ,libtiff)
602 ("libxml2" ,libxml2)
603 ("libwebp" ,libwebp)
604 ("matio" ,matio)
605 ("niftilib" ,niftilib)
606 ("openexr" ,openexr)
607 ("orc" ,orc)
608 ("pango" ,pango)
609 ("poppler" ,poppler)))
610 (home-page "https://libvips.github.io/libvips/")
611 (synopsis "Multithreaded image processing system with low memory needs")
612 (description
613 "VIPS is a demand-driven, horizontally threaded image processing library.
614 It's particularly good at processing large images, working with colour,
615 scientific analysis, and general research & development.
616
617 Compared to most image processing libraries VIPS needs little RAM and runs
618 quickly, especially on machines with more than one CPU core. This is primarily
619 due to its architecture which automatically parallelises the image workflows.")
620 (license license:lgpl2.1+)))
621
622 (define-public gmic
623 (package
624 (name "gmic")
625 (version "2.9.7")
626 (source
627 (origin
628 (method url-fetch)
629 (uri (string-append "https://gmic.eu/files/source/gmic_"
630 version ".tar.gz"))
631 (sha256
632 (base32 "05kzaplsl5qvxs7v6g73q0lq8dii8g6v77ap609188m7gr43f9cl"))))
633 (build-system cmake-build-system)
634 (arguments
635 `(#:tests? #f ;there are no tests
636 #:configure-flags '("-DBUILD_LIB_STATIC=OFF"
637 "-DENABLE_DYNAMIC_LINKING=ON"
638 "-DENABLE_LTO=ON")
639 #:phases
640 (modify-phases %standard-phases
641 (add-before 'configure 'set-LDFLAGS
642 (lambda* (#:key inputs outputs #:allow-other-keys)
643 (setenv "LDFLAGS"
644 (string-append
645 "-Wl,-rpath="
646 (assoc-ref outputs "out") "/lib")))))))
647 (native-inputs
648 `(("pkg-config" ,pkg-config)))
649 (inputs
650 `(("curl" ,curl)
651 ("fftw" ,fftw)
652 ("graphicsmagick" ,graphicsmagick)
653 ("libjpeg-turbo" ,libjpeg-turbo)
654 ("libpng" ,libpng)
655 ("libtiff" ,libtiff)
656 ("libx11" ,libx11)
657 ;;("opencv" ,opencv) ;OpenCV is currently broken in the CI
658 ("openexr" ,openexr)
659 ("zlib" ,zlib)))
660 (home-page "https://gmic.eu/")
661 (synopsis "Full-featured framework for digital image processing")
662 (description "G'MIC is a full-featured framework for digital image
663 processing. It provides several user interfaces to convert / manipulate
664 / filter / visualize generic image datasets, ranging from 1D scalar
665 signals to 3D+t sequences of multi-spectral volumetric images, hence
666 including 2D color images.")
667 ;; Dual-licensed, either license applies.
668 (license (list license:cecill license:cecill-c))))
669
670 (define-public gmic-qt
671 (package
672 (inherit gmic)
673 (name "gmic-qt")
674 (arguments
675 (substitute-keyword-arguments (package-arguments gmic)
676 ((#:configure-flags _)
677 `(list "-DGMIC_QT_HOST=none" "-DENABLE_DYNAMIC_LINKING=ON"
678 (string-append "-DGMIC_LIB_PATH="
679 (assoc-ref %build-inputs "gmic") "/lib")))
680 ((#:phases phases)
681 `(modify-phases ,phases
682 (add-after 'unpack 'qt-chdir
683 (lambda _ (chdir "gmic-qt") #t))))))
684 (native-inputs
685 `(("pkg-config" ,pkg-config)
686 ("qttools" ,qttools)))
687 (inputs
688 `(("gmic" ,gmic)
689 ("qtbase" ,qtbase)
690 ,@(package-inputs gmic)))
691 (synopsis "Qt frontend for the G'MIC image processing framework")
692 (license license:gpl3+)))
693
694 (define-public gmic-qt-krita
695 (package
696 (inherit gmic-qt)
697 (name "gmic-qt-krita")
698 (arguments
699 (substitute-keyword-arguments (package-arguments gmic-qt)
700 ((#:configure-flags flags)
701 '(list "-DGMIC_QT_HOST=krita" "-DENABLE_DYNAMIC_LINKING=ON"
702 (string-append "-DGMIC_LIB_PATH="
703 (assoc-ref %build-inputs "gmic") "/lib")))))
704 (synopsis "Krita plugin for the G'MIC image processing framework")))
705
706 (define-public nip2
707 (package
708 (name "nip2")
709 (version "8.7.1")
710 (source
711 (origin
712 (method url-fetch)
713 (uri (string-append "https://github.com/libvips/nip2/releases/download/v"
714 version "/nip2-" version ".tar.gz" ))
715 (sha256
716 (base32 "0l7n427njif53npqn02gfjjly8y3khbrkzqxp10j5vp9h97psgiw"))))
717 (build-system gnu-build-system)
718 (arguments
719 `(#:phases
720 (modify-phases %standard-phases
721 ;; test_conv.ws keep failing so disabling for now.
722 (add-after 'unpack 'disable-test-conv
723 (lambda _
724 (delete-file "test/workspaces/test_conv.ws")
725 #t))
726 (add-before 'check 'set-home
727 (lambda _
728 (setenv "HOME" "/tmp") #t)))))
729 (inputs
730 `(("vips" ,vips)
731 ("glib" ,glib)
732 ("libtiff" ,libtiff)
733 ("gtk+-2" ,gtk+-2)
734 ("libxml2" ,libxml2)
735 ("libexif" ,libexif)
736 ("libjpeg" ,libjpeg-turbo) ;required by vips.pc
737 ("librsvg" ,librsvg)
738 ("fftw" ,fftw)
739 ("libgsf" ,libgsf)
740 ("imagemagick" ,imagemagick)
741 ("orc" ,orc)
742 ("matio" ,matio)
743 ("lcms" ,lcms)
744 ("libwebp" ,libwebp)
745 ("openexr" ,openexr)
746 ("poppler" ,poppler)
747 ("gsl" ,gsl)))
748 (native-inputs
749 `(("flex" ,flex)
750 ("bison" ,bison)
751 ("pkg-config" ,pkg-config)))
752 (home-page "https://github.com/libvips/nip2")
753 (synopsis "Spreadsheet-like GUI for libvips")
754 (description "This package provide a graphical user interface (GUI) for
755 the VIPS image processing library. It's a little like a spreadsheet: you
756 create a set of formula connecting your objects together, and on a change nip2
757 recalculates.")
758 (license license:gpl2+)))
759
760 (define-public vxl
761 (package
762 (name "vxl")
763 (version "2.0.2")
764 (source
765 (origin
766 (method git-fetch)
767 (uri (git-reference
768 (url "https://github.com/vxl/vxl")
769 (commit (string-append "v" version))))
770 (file-name (git-file-name name version))
771 (sha256
772 (base32 "0949hw57szq8943f1whwqaz591xjmb19kj803hcv74hdai2b0ycg"))
773 (modules '((guix build utils)))
774 ;; TODO: vxl includes an old version of dcmtk. It won't build with
775 ;; version 3.6.x.
776 (snippet
777 '(begin
778 (for-each delete-file-recursively
779 '("v3p/bzlib/"
780 "v3p/geotiff/"
781 "v3p/jpeg/"
782 "v3p/png/"
783 "v3p/tiff/"
784 "v3p/zlib/"))
785 (substitute* "v3p/CMakeLists.txt"
786 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
787 ""))
788 #t))))
789 (build-system cmake-build-system)
790 (inputs
791 `(("libgeotiff" ,libgeotiff)
792 ("libtiff" ,libtiff)
793 ("libjpeg" ,libjpeg-turbo)
794 ("libpng" ,libpng)
795 ("zlib" ,zlib)))
796 (home-page "https://github.com/vxl/vxl/")
797 (synopsis "Collection of C++ libraries for computer vision")
798 (description "VXL (the Vision-something-Libraries) is a collection of C++
799 libraries designed for computer vision research and implementation.")
800 (license license:bsd-3)))
801
802 (define-public vxl-1
803 (package (inherit vxl)
804 (name "vxl")
805 (version "1.18.0")
806 (source
807 (origin
808 (method git-fetch)
809 (uri (git-reference
810 (url "https://github.com/vxl/vxl")
811 (commit (string-append "v" version))))
812 (file-name (git-file-name name version))
813 (sha256
814 (base32 "1g4mr2cc58jwm0vasscbd4y5380wj3ahkvq121z4gs83fhavvxgz"))
815 (modules '((guix build utils)))
816 (snippet
817 '(begin
818 (for-each delete-file-recursively
819 '("v3p/bzlib/"
820 "v3p/geotiff/"
821 "v3p/png/"
822 "v3p/tiff/"
823 "v3p/zlib/"))
824 (substitute* "v3p/CMakeLists.txt"
825 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
826 ""))
827 #t))))
828 (arguments
829 `(#:configure-flags
830 ;; Needed for itk-snap
831 (list "-DVNL_CONFIG_LEGACY_METHODS=ON")))))
832
833 (define-public insight-toolkit
834 (package
835 (name "insight-toolkit")
836 (version "5.0.0")
837 (source
838 (origin
839 (method url-fetch)
840 (uri (string-append "https://github.com/InsightSoftwareConsortium/ITK/"
841 "releases/download/v" version "/InsightToolkit-"
842 version ".tar.xz"))
843 (sha256
844 (base32 "0bs63mk4q8jmx38f031jy5w5n9yy5ng9x8ijwinvjyvas8cichqi"))))
845 (build-system cmake-build-system)
846 (arguments
847 `(#:tests? #f ; tests require network access and external data
848 #:configure-flags
849 '("-DITK_USE_GPU=ON"
850 "-DITK_USE_SYSTEM_LIBRARIES=ON"
851 "-DITK_USE_SYSTEM_GOOGLETEST=ON"
852 "-DITK_BUILD_SHARED=ON"
853 ;; This prevents "GTest::GTest" from being added to the ITK_LIBRARIES
854 ;; variable in the installed CMake files. This is necessary as other
855 ;; packages using insight-toolkit could not be configured otherwise.
856 "-DGTEST_ROOT=gtest")
857 #:phases
858 (modify-phases %standard-phases
859 (add-after 'unpack 'do-not-tune
860 (lambda _
861 (substitute* "CMake/ITKSetStandardCompilerFlags.cmake"
862 (("-mute=native") ""))
863 #t)))))
864 (inputs
865 `(("eigen" ,eigen)
866 ("expat" ,expat)
867 ("fftw" ,fftw)
868 ("fftwf" ,fftwf)
869 ("hdf5" ,hdf5)
870 ("libjpeg" ,libjpeg-turbo)
871 ("libpng" ,libpng)
872 ("libtiff" ,libtiff)
873 ("mesa" ,mesa-opencl)
874 ("perl" ,perl)
875 ("python" ,python)
876 ("tbb" ,tbb)
877 ("vxl" ,vxl-1)
878 ("zlib" ,zlib)))
879 (native-inputs
880 `(("googletest" ,googletest)
881 ("pkg-config" ,pkg-config)))
882 (home-page "https://github.com/InsightSoftwareConsortium/ITK/")
883 (synopsis "Scientific image processing, segmentation and registration")
884 (description "The Insight Toolkit (ITK) is a toolkit for N-dimensional
885 scientific image processing, segmentation, and registration. Segmentation is
886 the process of identifying and classifying data found in a digitally sampled
887 representation. Typically the sampled representation is an image acquired
888 from such medical instrumentation as CT or MRI scanners. Registration is the
889 task of aligning or developing correspondences between data. For example, in
890 the medical environment, a CT scan may be aligned with a MRI scan in order to
891 combine the information contained in both.")
892 (license license:asl2.0)))
893
894 (define-public insight-toolkit-4
895 (package (inherit insight-toolkit)
896 (version "4.13.2")
897 (source
898 (origin
899 (method url-fetch)
900 (uri (string-append "https://github.com/InsightSoftwareConsortium/ITK/"
901 "releases/download/v" version "/InsightToolkit-"
902 version ".tar.xz"))
903 (sha256
904 (base32 "19cgfpd63gqrvc3m27m394gy2d7w79g5y6lvznb5qqr49lihbgns"))))
905 (arguments
906 `(#:tests? #f ; tests require network access and external data
907 #:configure-flags
908 '("-DITKV3_COMPATIBILITY=ON" ; needed for itk-snap
909 "-DITK_USE_GPU=ON"
910 "-DITK_USE_SYSTEM_LIBRARIES=ON"
911 "-DITK_USE_SYSTEM_GOOGLETEST=ON"
912 "-DITK_USE_SYSTEM_VXL=ON")))))
913
914 (define-public insight-toolkit-4.12
915 (package (inherit insight-toolkit-4)
916 (version "4.12.2")
917 (source
918 (origin
919 (method url-fetch)
920 (uri (string-append "mirror://sourceforge/itk/itk/4.12/"
921 "InsightToolkit-" version ".tar.xz"))
922 (sha256
923 (base32 "1qw9mxbh083siljygahl4gdfv91xvfd8hfl7ghwii19f60xrvn2w"))))))
924
925 (define-public itk-snap
926 (package
927 (name "itk-snap")
928 (version "3.8.0")
929 (source
930 (origin
931 (method git-fetch)
932 (uri (git-reference
933 (url "https://git.code.sf.net/p/itk-snap/src")
934 (commit (string-append "v" version))))
935 (file-name (git-file-name name version))
936 (sha256
937 (base32 "15i5ixpryfrbf3vrrb5rici8fb585f25k0v1ljds16bp1f1msr4q"))))
938 (build-system cmake-build-system)
939 (arguments
940 `(#:configure-flags
941 (list "-DSNAP_VERSION_GIT_SHA1=release"
942 "-DSNAP_VERSION_GIT_BRANCH=release"
943 "-DSNAP_VERSION_GIT_TIMESTAMP=0"
944 "-DSNAP_PACKAGE_QT_PLUGINS=OFF"
945 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
946 #:phases
947 (modify-phases %standard-phases
948 ;; During the installation phase all libraries provided by all
949 ;; dependencies will be copied to the lib directory. That's insane,
950 ;; so we disable this.
951 (add-after 'unpack 'do-not-copy-dependencies
952 (lambda _
953 (substitute* "CMakeLists.txt"
954 (("install_qt5_executable\
955 \\(\\$\\{SNAP_MAIN_INSTALL_DIR\\}/\\$\\{SNAP_EXE\\}\\)")
956 ""))
957 #t))
958 (add-after 'unpack 'disable-gui-tests
959 (lambda _
960 ;; The GUI tests just time out.
961 (substitute* "CMakeLists.txt"
962 ((" (Workspace|DiffSpace|ProbeIntensity|RegionCompetition\
963 |RandomForest|RandomForestBailOut)")
964 ""))
965 #t))
966 (add-after 'unpack 'make-reproducible
967 (lambda _
968 (substitute* "CMakeLists.txt"
969 (("TODAY\\(SNAP_VERSION_COMPILE_DATE\\)")
970 "SET(SNAP_VERSION_COMPILE_DATE \"(removed for reproducibility)\")"))
971 #t))
972 (add-after 'unpack 'prepare-submodules
973 (lambda* (#:key inputs #:allow-other-keys)
974 (rmdir "Submodules/c3d")
975 (copy-recursively (assoc-ref inputs "c3d-src")
976 "Submodules/c3d")
977 (substitute* '("Submodules/c3d/adapters/BiasFieldCorrectionN4.cxx"
978 "Submodules/c3d/adapters/ApplyMetric.cxx")
979 (("vcl_") "std::"))
980 (rmdir "Submodules/greedy")
981 (symlink (assoc-ref inputs "greedy-src")
982 "Submodules/greedy")
983 #t))
984 (add-after 'unpack 'fix-includes
985 (lambda _
986 (substitute* "GUI/Model/RegistrationModel.cxx"
987 (("<vnl_symmetric_eigensystem.h>")
988 "<vnl/algo/vnl_symmetric_eigensystem.h>"))
989 #t))
990 (add-before 'check 'prepare-tests
991 (lambda _
992 ;; Needed by at least one test.
993 (setenv "HOME" "/tmp")
994 #t))
995 (add-after 'install 'wrap-executable
996 (lambda* (#:key inputs outputs #:allow-other-keys)
997 (let ((out (assoc-ref outputs "out")))
998 (wrap-program (string-append out "/bin/itksnap")
999 `("QT_PLUGIN_PATH" ":" prefix
1000 ,(map (lambda (label)
1001 (string-append (assoc-ref inputs label)
1002 "/lib/qt5/plugins"))
1003 '("qtbase" "qtdeclarative"))))
1004 #t))))))
1005 (inputs
1006 `(("curl" ,curl)
1007 ("fftw" ,fftw)
1008 ("fftwf" ,fftwf)
1009 ("glu" ,glu)
1010 ("hdf5" ,hdf5)
1011 ("mesa" ,mesa-opencl)
1012 ;; This package does not build with either insight-toolkit 5.0.0 and
1013 ;; not with 4.13. It really needs to be 4.12.
1014 ("itk" ,insight-toolkit-4.12)
1015 ("vtk" ,vtk-6)
1016 ("qtbase" ,qtbase)
1017 ("qtdeclarative" ,qtdeclarative)
1018 ("vxl" ,vxl-1)
1019 ("zlib" ,zlib)))
1020 (native-inputs
1021 `(("googletest" ,googletest)
1022 ("qttools" ,qttools)
1023 ("pkg-config" ,pkg-config)
1024 ("c3d-src"
1025 ,(let* ((commit "f521358db26e00002c911cc47bf463b043942ad3")
1026 (revision "1")
1027 (version (git-version "0" revision commit)))
1028 (origin
1029 (method git-fetch)
1030 (uri (git-reference
1031 (url "https://github.com/pyushkevich/c3d")
1032 (commit commit)))
1033 (file-name (git-file-name "c3d" version))
1034 (sha256
1035 (base32
1036 "0kyv3rxrxwr8c3sa9zv01lsnhk95b27gx1s870k3yi8qp52h7bx3")))))
1037 ;; We are using an arbitrary commit from 2017 because the latest
1038 ;; version breaks the build...
1039 ("greedy-src"
1040 ,(let* ((commit "97e340f7e8e66597599144947775e6039e79a0d3")
1041 (revision "1")
1042 (version (git-version "0" revision commit)))
1043 (origin
1044 (method git-fetch)
1045 (uri (git-reference
1046 (url "https://github.com/pyushkevich/greedy")
1047 (commit commit)))
1048 (file-name (git-file-name "greedy" version))
1049 (sha256
1050 (base32
1051 "0k5bc9za4jrc8z9dj08z1rkcp5xf0gnd1d2jmi1w9ny4vxh2q2ab")))))))
1052 (home-page "https://sourceforge.net/p/itk-snap/")
1053 (synopsis "Medical image segmentation")
1054 (description "ITK-SNAP is a tool for segmenting anatomical structures in
1055 medical images. It provides an automatic active contour segmentation
1056 pipeline, along with supporting a manual segmentation toolbox. ITK-SNAP has a
1057 full-featured UI aimed at clinical researchers.")
1058 ;; This includes the submodules greedy and c3d.
1059 (license license:gpl3+)))
1060
1061 (define-public metapixel
1062 ;; Follow stable branch.
1063 (let ((commit "98ee9daa093b6c334941242e63f90b1c2876eb4f"))
1064 (package
1065 (name "metapixel")
1066 (version (git-version "1.0.2" "1" commit))
1067 (source
1068 (origin
1069 (method git-fetch)
1070 (uri (git-reference
1071 (url "https://github.com/schani/metapixel")
1072 (commit commit)
1073 ;; TODO: Package rwimg and lispreader?
1074 (recursive? #t)))
1075 (file-name (git-file-name name version))
1076 (sha256
1077 (base32 "0r7n3a6bvcxkbpda4mwmrpicii09iql5z69nkjqygkwxw7ny3309"))))
1078 (build-system gnu-build-system)
1079 (inputs
1080 `(("giflib" ,giflib)
1081 ("libjpeg" ,libjpeg-turbo)
1082 ("libpng" ,libpng)
1083 ("perl" ,perl)))
1084 (native-inputs
1085 `(("pkg-config" ,pkg-config)
1086 ("docbook-xml" ,docbook-xml)
1087 ("docbook-xsl" ,docbook-xsl)
1088 ("xsltproc" ,libxslt)))
1089 (arguments
1090 `(#:tests? #f ; No tests.
1091 #:make-flags (list
1092 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1093 (string-append "MANPAGE_XSL="
1094 (assoc-ref %build-inputs "docbook-xsl")
1095 "/xml/xsl/docbook-xsl-*/manpages/docbook.xsl"))
1096 #:phases
1097 (modify-phases %standard-phases
1098 (delete 'configure)
1099 (add-before 'install 'make-local-docbook-xml
1100 (lambda* (#:key inputs #:allow-other-keys)
1101 (substitute* "metapixel.xml"
1102 (("http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd")
1103 (string-append (assoc-ref inputs "docbook-xml")
1104 "/xml/dtd/docbook/docbookx.dtd")))
1105 #t))
1106 (add-before 'install 'fix-directory-creation
1107 (lambda* (#:key outputs #:allow-other-keys)
1108 (mkdir-p (string-append (assoc-ref outputs "out") "/share/man/man1"))
1109 #t)))))
1110 (home-page "https://www.complang.tuwien.ac.at/schani/metapixel/")
1111 (synopsis "Photomosaics generator")
1112 (description "Metapixel is a program for generating photomosaics. It can
1113 generate classical photomosaics, in which the source image is viewed as a
1114 matrix of equally sized rectangles for each of which a matching image is
1115 substituted, as well as collage-style photomosaics, in which rectangular parts
1116 of the source image at arbitrary positions (i.e. not aligned to a matrix) are
1117 substituted by matching images.")
1118 (license license:gpl2))))
1119
1120 (define-public scantailor-advanced
1121 (let ((commit "3d1e74e6ace413733511086934a66f4e3f7a6027"))
1122 (package
1123 (name "scantailor-advanced")
1124 (version (string-append "1.0.16-" (string-take commit 7)))
1125 (source
1126 (origin
1127 (method git-fetch)
1128 (uri (git-reference
1129 (url "https://github.com/4lex4/scantailor-advanced")
1130 (commit commit)))
1131 (file-name (git-file-name name version))
1132 (sha256
1133 (base32
1134 "0kixwjb2x457dq7927hkh34c803p7yh1pmn6n61rk9shqrcg492h"))))
1135 (build-system qt-build-system)
1136 (native-inputs
1137 `(("qttools" ,qttools)))
1138 (inputs
1139 `(("boost" ,boost)
1140 ("libjpeg" ,libjpeg-turbo)
1141 ("libpng" ,libpng)
1142 ("libtiff" ,libtiff)
1143 ("qtbase" ,qtbase)
1144 ("qtsvg" ,qtsvg)
1145 ("zlib" ,zlib)))
1146 (arguments
1147 `(#:phases
1148 (modify-phases %standard-phases
1149 ;; Some tests require a display and fail with offscreen mode.
1150 (add-after 'unpack 'disable-failing-tests
1151 (lambda _
1152 (setenv "ARGS" "--exclude-regex \"imageproc_.*\"")
1153 #t)))))
1154 (home-page "https://github.com/4lex4/scantailor-advanced")
1155 (synopsis "Clean up scanned pages")
1156 (description "Scan Tailor is an interactive post-processing tool for
1157 scanned pages. It performs operations such as page splitting, deskewing,
1158 adding/removing borders, and others. You give it raw scans, and you get pages
1159 ready to be printed or assembled into a PDF or DJVU file. Scanning, optical
1160 character recognition, and assembling multi-page documents are out of scope of
1161 this project.
1162
1163 Scan Tailer Advanced is a fork of Scan Tailer that merges Scan Tailor Featured
1164 and Scan Tailor Enhanced versions as well as including many more bug fixes.")
1165 (license license:gpl3+))))
1166
1167 (define-public stiff
1168 (package
1169 (name "stiff")
1170 (version "2.4.0")
1171 (source
1172 (origin
1173 (method url-fetch)
1174 (uri (string-append "https://www.astromatic.net/download/stiff/stiff-"
1175 version ".tar.gz"))
1176 (sha256
1177 (base32 "14m92dskzw7bwsr64ha4p0mj3ndv13gwcbfic3qxrs3zq5353s7l"))))
1178 (build-system gnu-build-system)
1179 (inputs
1180 `(("libtiff" ,libtiff)
1181 ("zlib" ,zlib)
1182 ("libjpeg-turbo" ,libjpeg-turbo)))
1183 (home-page "https://www.astromatic.net/software/stiff")
1184 (synopsis "Convert scientific FITS images to TIFF format")
1185 (description
1186 "STIFF is a program that converts scientific @acronym{FITS, Flexible Image
1187 Transport System} images to the more popular TIFF format for illustration
1188 purposes.")
1189 (license license:gpl3+)))