gnu: vtk: Update to 9.0.1.
[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 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 (build-system cmake-build-system)
274 (arguments
275 '(#:build-type "Release" ;Build without '-g' to save space.
276 #:configure-flags '(;"-DBUILD_TESTING:BOOL=TRUE"
277 ; ; not honored
278 "-DVTK_USE_EXTERNAL=OFF" ;; default
279 "-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON"
280 "-DVTK_MODULE_USE_EXTERNAL_VTK_eigen=ON"
281 "-DVTK_MODULE_USE_EXTERNAL_VTK_expat=ON"
282 "-DVTK_MODULE_USE_EXTERNAL_VTK_freetype=ON"
283 "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=ON"
284 "-DVTK_MODULE_USE_EXTERNAL_VTK_glew=ON"
285 "-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=ON"
286 "-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg=ON"
287 "-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp=ON"
288 "-DVTK_MODULE_USE_EXTERNAL_VTK_libproj=ON"
289 "-DVTK_MODULE_USE_EXTERNAL_VTK_libxml2=ON"
290 "-DVTK_MODULE_USE_EXTERNAL_VTK_lz4=ON"
291 "-DVTK_MODULE_USE_EXTERNAL_VTK_netcdf=ON"
292 "-DVTK_MODULE_USE_EXTERNAL_VTK_ogg=ON"
293 "-DVTK_MODULE_USE_EXTERNAL_VTK_png=ON"
294 ;"-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=ON" ; breaks IO/CityGML
295 "-DVTK_MODULE_USE_EXTERNAL_VTK_sqlite=ON"
296 "-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON"
297 "-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON"
298 "-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON"
299 )
300 #:phases
301 (modify-phases %standard-phases
302 (add-after 'unpack 'patch-sources
303 (lambda _
304 (substitute* "Common/Core/vtkFloatingPointExceptions.cxx"
305 (("<fenv.h>") "<cfenv>"))
306 (substitute* "Common/Core/CMakeLists.txt"
307 (("fenv.h") "cfenv")))))
308 #:tests? #f)) ;XXX: test data not included
309 (inputs
310 `(("double-conversion" ,double-conversion)
311 ("eigen" ,eigen)
312 ("expat" ,expat)
313 ("freetype" ,freetype)
314 ("gl2ps" ,gl2ps)
315 ("glew" ,glew)
316 ("glu" ,glu)
317 ("hdf5" ,hdf5)
318 ("jpeg" ,libjpeg-turbo)
319 ("jsoncpp" ,jsoncpp)
320 ("libtheora" ,libtheora)
321 ("libX11" ,libx11)
322 ("libxml2" ,libxml2)
323 ("libXt" ,libxt)
324 ("lz4" ,lz4)
325 ("mesa" ,mesa)
326 ("netcdf" ,netcdf)
327 ("png" ,libpng)
328 ("proj" ,proj.4)
329 ;("pugixml" ,pugixml)
330 ("sqlite" ,sqlite)
331 ("tiff" ,libtiff)
332 ("xorgproto" ,xorgproto)
333 ("zlib" ,zlib)))
334 (propagated-inputs
335 ;; VTK's 'VTK-vtk-module-find-packages.cmake' calls
336 ;; 'find_package(THEORA)', which in turns looks for libogg.
337 `(("libogg" ,libogg)))
338 (home-page "https://vtk.org/")
339 (synopsis "Libraries for 3D computer graphics")
340 (description
341 "The Visualization Toolkit (VTK) is a C++ library for 3D computer graphics,
342 image processing and visualization. It supports a wide variety of
343 visualization algorithms including: scalar, vector, tensor, texture, and
344 volumetric methods; and advanced modeling techniques such as: implicit
345 modeling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay
346 triangulation. VTK has an extensive information visualization framework, has
347 a suite of 3D interaction widgets, supports parallel processing, and
348 integrates with various databases on GUI toolkits such as Qt and Tk.")
349 (license license:bsd-3)))
350
351 ;; itksnap needs an older variant of VTK.
352 (define-public vtk-6
353 (package (inherit vtk)
354 (version "6.3.0")
355 (source (origin
356 (method url-fetch)
357 (uri (string-append "https://vtk.org/files/release/"
358 (version-major+minor version)
359 "/VTK-" version ".tar.gz"))
360 (sha256
361 (base32
362 "0pla1r5mvkgl4sl213gfdhzrypdgai0h3z5mfgm6p9jz9hsr794j"))))
363 (inputs
364 `(("jsoncpp" ,jsoncpp-for-tensorflow)
365 ,@(alist-delete "jsoncpp" (package-inputs vtk))))))
366
367 (define-public opencv
368 (package
369 (name "opencv")
370 (version "3.4.3")
371 (source (origin
372 (method git-fetch)
373 (uri (git-reference
374 (url "https://github.com/opencv/opencv")
375 (commit version)))
376 (file-name (git-file-name name version))
377 (sha256
378 (base32
379 "06bc61r8myym4s8im10brdjfg4wxkrvsbhhl7vr1msdan2xddzi3"))
380 (patches
381 (search-patches "opencv-fix-build-of-grfmt_jpeg2000.cpp.patch"))
382 (modules '((guix build utils)))
383 (snippet
384 '(begin
385 ;; Remove external libraries. We have all available in Guix:
386 (delete-file-recursively "3rdparty")
387
388 ;; Milky icon set is non-free:
389 (delete-file-recursively "modules/highgui/src/files_Qt/Milky")
390
391 ;; Some jars found:
392 (for-each delete-file
393 '("modules/java/test/pure_test/lib/junit-4.11.jar"
394 "samples/java/sbt/sbt/sbt-launch.jar"))
395 #t))))
396 (build-system cmake-build-system)
397 (arguments
398 `(#:configure-flags
399 (list "-DWITH_IPP=OFF"
400 "-DWITH_ITT=OFF"
401 "-DWITH_CAROTENE=OFF" ; only visible on arm/aarch64
402 "-DENABLE_PRECOMPILED_HEADERS=OFF"
403
404 ;; CPU-Features:
405 ;; See cmake/OpenCVCompilerOptimizations.cmake
406 ;; (CPU_ALL_OPTIMIZATIONS) for a list of all optimizations
407 ;; BASELINE is the minimum optimization all CPUs must support
408 ;;
409 ;; DISPATCH is the list of optional dispatches.
410 "-DCPU_BASELINE=SSE2"
411
412 ,@(match (%current-system)
413 ("x86_64-linux"
414 '("-DCPU_DISPATCH=NEON;VFPV3;FP16;SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;POPCNT;AVX;FP16;AVX2;FMA3;AVX_512F;AVX512_SKX"
415 "-DCPU_DISPATCH_REQUIRE=SSE3,SSSE3,SSE4_1,SSE4_2,AVX,AVX2"))
416 ("armhf-linux"
417 '("-DCPU_BASELINE_DISABLE=NEON")) ; causes build failures
418 ("aarch64-linux"
419 '("-DCPU_BASELINE=NEON"
420 "-DCPU_DISPATCH=NEON;VFPV3;FP16"))
421 (_ '()))
422
423 "-DBUILD_PERF_TESTS=OFF"
424 "-DBUILD_TESTS=ON"
425
426 (string-append "-DOPENCV_EXTRA_MODULES_PATH=" (getcwd)
427 "/opencv-contrib/modules")
428
429 ;;Define test data:
430 (string-append "-DOPENCV_TEST_DATA_PATH=" (getcwd)
431 "/opencv-extra/testdata")
432
433 ;; Is ON by default and would try to rebuild 3rd-party protobuf,
434 ;; which we had removed, which would lead to an error:
435 "-DBUILD_PROTOBUF=OFF"
436
437 ;; Rebuild protobuf files, because we have a slightly different
438 ;; version than the included one. If we would not update, we
439 ;; would get a compile error later:
440 "-DPROTOBUF_UPDATE_FILES=ON"
441
442 ;; xfeatures2d disabled, because it downloads extra binaries from
443 ;; https://github.com/opencv/opencv_3rdparty
444 ;; defined in xfeatures2d/cmake/download_{vgg|bootdesc}.cmake
445 ;; Cmp this bug entry:
446 ;; https://github.com/opencv/opencv_contrib/issues/1131
447 "-DBUILD_opencv_xfeatures2d=OFF")
448 #:phases
449 (modify-phases %standard-phases
450 (add-after 'unpack 'disable-broken-tests
451 (lambda _
452 ;; These tests fails with:
453 ;; vtkXOpenGLRenderWindow (0x723990): Could not find a decent config
454 ;; I think we have no OpenGL support with the Xvfb.
455 (substitute* '("modules/viz/test/test_tutorial3.cpp"
456 "modules/viz/test/test_main.cpp"
457 "modules/viz/test/tests_simple.cpp"
458 "modules/viz/test/test_viz3d.cpp")
459 (("(TEST\\(Viz, )([a-z].*\\).*)" all pre post)
460 (string-append pre "DISABLED_" post)))
461
462 ;; This one fails with "unknown file: Failure"
463 ;; But I couldn't figure out which file was missing:
464 (substitute* "../opencv-contrib/modules/face/test/test_face_align.cpp"
465 (("(TEST\\(CV_Face_FacemarkKazemi, )(can_detect_landmarks\\).*)"
466 all pre post)
467 (string-append pre "DISABLED_" post)))
468
469 ;; Failure reason: Bad accuracy
470 ;; Incorrect count of accurate poses [2nd case]: 90.000000 / 94.000000
471 (substitute* "../opencv-contrib/modules/rgbd/test/test_odometry.cpp"
472 (("(TEST\\(RGBD_Odometry_Rgbd, )(algorithmic\\).*)" all pre post)
473 (string-append pre "DISABLED_" post)))
474 #t))
475
476 (add-after 'unpack 'unpack-submodule-sources
477 (lambda* (#:key inputs #:allow-other-keys)
478 (mkdir "../opencv-extra")
479 (mkdir "../opencv-contrib")
480 (copy-recursively (assoc-ref inputs "opencv-extra")
481 "../opencv-extra")
482 (invoke "tar" "xvf"
483 (assoc-ref inputs "opencv-contrib")
484 "--strip-components=1"
485 "-C" "../opencv-contrib")))
486
487 (add-after 'set-paths 'add-ilmbase-include-path
488 (lambda* (#:key inputs #:allow-other-keys)
489 ;; OpenEXR propagates ilmbase, but its include files do not appear
490 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
491 ;; the CPATH to satisfy the dependency on "ImathVec.h".
492 (setenv "CPATH"
493 (string-append (assoc-ref inputs "ilmbase")
494 "/include/OpenEXR"
495 ":" (or (getenv "CPATH") "")))
496 #t))
497 (add-before 'check 'start-xserver
498 (lambda* (#:key inputs #:allow-other-keys)
499 (let ((xorg-server (assoc-ref inputs "xorg-server"))
500 (disp ":1"))
501 (setenv "HOME" (getcwd))
502 (setenv "DISPLAY" disp)
503 ;; There must be a running X server and make check doesn't start one.
504 ;; Therefore we must do it.
505 (zero? (system (format #f "~a/bin/Xvfb ~a &" xorg-server disp)))))))))
506 (native-inputs
507 `(("pkg-config" ,pkg-config)
508 ("xorg-server" ,xorg-server-for-tests) ; For running the tests
509 ("opencv-extra"
510 ,(origin
511 (method git-fetch)
512 (uri (git-reference
513 (url "https://github.com/opencv/opencv_extra")
514 (commit version)))
515 (file-name (git-file-name "opencv_extra" version))
516 (sha256
517 (base32 "08p5xnq8n1jw8svvz0fnirfg7q8dm3p4a5dl7527s5xj0f9qn7lp"))))
518 ("opencv-contrib"
519 ,(origin
520 (method git-fetch)
521 (uri (git-reference
522 (url "https://github.com/opencv/opencv_contrib")
523 (commit version)))
524 (file-name (git-file-name "opencv_contrib" version))
525 (patches (search-patches "opencv-rgbd-aarch64-test-fix.patch"))
526 (sha256
527 (base32 "1f334glf39nk42mpqq6j732h3ql2mpz89jd4mcl678s8n73nfjh2"))))))
528 (inputs `(("libjpeg" ,libjpeg-turbo)
529 ("libpng" ,libpng)
530 ("jasper" ,jasper)
531 ;; ffmpeg 4.0 causes core dumps in tests.
532 ("ffmpeg" ,ffmpeg-3.4)
533 ("libtiff" ,libtiff)
534 ("hdf5" ,hdf5)
535 ("libgphoto2" ,libgphoto2)
536 ("libwebp" ,libwebp)
537 ("zlib" ,zlib)
538 ("gtkglext" ,gtkglext)
539 ("openexr" ,openexr)
540 ("ilmbase" ,ilmbase)
541 ("gtk+" ,gtk+-2)
542 ("python-numpy" ,python-numpy)
543 ("protobuf" ,protobuf)
544 ("vtk" ,vtk)
545 ("python" ,python)))
546 ;; These three CVEs are not a problem of OpenCV, see:
547 ;; https://github.com/opencv/opencv/issues/10998
548 (properties '((lint-hidden-cve . ("CVE-2018-7712"
549 "CVE-2018-7713"
550 "CVE-2018-7714"))))
551 (synopsis "Computer vision library")
552 (description "OpenCV is a library aimed at
553 real-time computer vision, including several hundred computer
554 vision algorithms. It can be used to do things like:
555
556 @itemize
557 @item image and video input and output
558 @item image and video processing
559 @item displaying
560 @item feature recognition
561 @item segmentation
562 @item facial recognition
563 @item stereo vision
564 @item structure from motion
565 @item augmented reality
566 @item machine learning
567 @end itemize\n")
568 (home-page "https://opencv.org/")
569 (license license:bsd-3)))
570
571 (define-public vips
572 (package
573 (name "vips")
574 (version "8.10.6")
575 (source
576 (origin
577 (method url-fetch)
578 (uri (string-append
579 "https://github.com/libvips/libvips/releases/download/v"
580 version "/vips-" version ".tar.gz"))
581 (sha256
582 (base32 "0vjsh3i0861f6h9as3bch956cidz824zz499pvhjs3lfjn6hhs14"))))
583 (build-system gnu-build-system)
584 (native-inputs
585 `(("gobject-introspection" ,gobject-introspection)
586 ("pkg-config" ,pkg-config)))
587 (inputs
588 `(("expat" ,expat)
589 ("fftw" ,fftw)
590 ("giflib" ,giflib)
591 ("glib" ,glib)
592 ("hdf5" ,hdf5)
593 ("imagemagick" ,imagemagick)
594 ("lcms" ,lcms)
595 ("libexif" ,libexif)
596 ("libgsf" ,libgsf)
597 ("libjpeg" ,libjpeg-turbo)
598 ("libpng" ,libpng)
599 ("librsvg" ,librsvg)
600 ("libtiff" ,libtiff)
601 ("libxml2" ,libxml2)
602 ("libwebp" ,libwebp)
603 ("matio" ,matio)
604 ("niftilib" ,niftilib)
605 ("openexr" ,openexr)
606 ("orc" ,orc)
607 ("pango" ,pango)
608 ("poppler" ,poppler)))
609 (home-page "https://libvips.github.io/libvips/")
610 (synopsis "Multithreaded image processing system with low memory needs")
611 (description
612 "VIPS is a demand-driven, horizontally threaded image processing library.
613 It's particularly good at processing large images, working with colour,
614 scientific analysis, and general research & development.
615
616 Compared to most image processing libraries VIPS needs little RAM and runs
617 quickly, especially on machines with more than one CPU core. This is primarily
618 due to its architecture which automatically parallelises the image workflows.")
619 (license license:lgpl2.1+)))
620
621 (define-public gmic
622 (package
623 (name "gmic")
624 (version "2.9.6")
625 (source
626 (origin
627 (method url-fetch)
628 (uri (string-append "https://gmic.eu/files/source/gmic_"
629 version ".tar.gz"))
630 (sha256
631 (base32 "06n1dcskky7aqg3a0cp7biwz8agc4xqvr8091l2wsvgib98yhbyj"))))
632 (build-system cmake-build-system)
633 (arguments
634 `(#:tests? #f ;there are no tests
635 #:configure-flags '("-DBUILD_LIB_STATIC=OFF"
636 "-DENABLE_DYNAMIC_LINKING=ON"
637 "-DENABLE_LTO=ON")
638 #:phases
639 (modify-phases %standard-phases
640 (add-before 'configure 'set-LDFLAGS
641 (lambda* (#:key inputs outputs #:allow-other-keys)
642 (setenv "LDFLAGS"
643 (string-append
644 "-Wl,-rpath="
645 (assoc-ref outputs "out") "/lib")))))))
646 (native-inputs
647 `(("pkg-config" ,pkg-config)))
648 (inputs
649 `(("curl" ,curl)
650 ("fftw" ,fftw)
651 ("graphicsmagick" ,graphicsmagick)
652 ("libjpeg-turbo" ,libjpeg-turbo)
653 ("libpng" ,libpng)
654 ("libtiff" ,libtiff)
655 ("libx11" ,libx11)
656 ;;("opencv" ,opencv) ;OpenCV is currently broken in the CI
657 ("openexr" ,openexr)
658 ("zlib" ,zlib)))
659 (home-page "https://gmic.eu/")
660 (synopsis "Full-featured framework for digital image processing")
661 (description "G'MIC is a full-featured framework for digital image
662 processing. It provides several user interfaces to convert / manipulate
663 / filter / visualize generic image datasets, ranging from 1D scalar
664 signals to 3D+t sequences of multi-spectral volumetric images, hence
665 including 2D color images.")
666 ;; Dual-licensed, either license applies.
667 (license (list license:cecill license:cecill-c))))
668
669 (define-public gmic-qt
670 (package
671 (inherit gmic)
672 (name "gmic-qt")
673 (arguments
674 (substitute-keyword-arguments (package-arguments gmic)
675 ((#:configure-flags _)
676 `(list "-DGMIC_QT_HOST=none" "-DENABLE_DYNAMIC_LINKING=ON"
677 (string-append "-DGMIC_LIB_PATH="
678 (assoc-ref %build-inputs "gmic") "/lib")))
679 ((#:phases phases)
680 `(modify-phases ,phases
681 (add-after 'unpack 'qt-chdir
682 (lambda _ (chdir "gmic-qt") #t))))))
683 (native-inputs
684 `(("pkg-config" ,pkg-config)
685 ("qttools" ,qttools)))
686 (inputs
687 `(("gmic" ,gmic)
688 ("qtbase" ,qtbase)
689 ,@(package-inputs gmic)))
690 (synopsis "Qt frontend for the G'MIC image processing framework")
691 (license license:gpl3+)))
692
693 (define-public gmic-qt-krita
694 (package
695 (inherit gmic-qt)
696 (name "gmic-qt-krita")
697 (arguments
698 (substitute-keyword-arguments (package-arguments gmic-qt)
699 ((#:configure-flags flags)
700 '(list "-DGMIC_QT_HOST=krita" "-DENABLE_DYNAMIC_LINKING=ON"
701 (string-append "-DGMIC_LIB_PATH="
702 (assoc-ref %build-inputs "gmic") "/lib")))))
703 (synopsis "Krita plugin for the G'MIC image processing framework")))
704
705 (define-public nip2
706 (package
707 (name "nip2")
708 (version "8.7.1")
709 (source
710 (origin
711 (method url-fetch)
712 (uri (string-append "https://github.com/libvips/nip2/releases/download/v"
713 version "/nip2-" version ".tar.gz" ))
714 (sha256
715 (base32 "0l7n427njif53npqn02gfjjly8y3khbrkzqxp10j5vp9h97psgiw"))))
716 (build-system gnu-build-system)
717 (arguments
718 `(#:phases
719 (modify-phases %standard-phases
720 ;; test_conv.ws keep failing so disabling for now.
721 (add-after 'unpack 'disable-test-conv
722 (lambda _
723 (delete-file "test/workspaces/test_conv.ws")
724 #t))
725 (add-before 'check 'set-home
726 (lambda _
727 (setenv "HOME" "/tmp") #t)))))
728 (inputs
729 `(("vips" ,vips)
730 ("glib" ,glib)
731 ("libtiff" ,libtiff)
732 ("gtk+-2" ,gtk+-2)
733 ("libxml2" ,libxml2)
734 ("libexif" ,libexif)
735 ("libjpeg" ,libjpeg-turbo) ;required by vips.pc
736 ("librsvg" ,librsvg)
737 ("fftw" ,fftw)
738 ("libgsf" ,libgsf)
739 ("imagemagick" ,imagemagick)
740 ("orc" ,orc)
741 ("matio" ,matio)
742 ("lcms" ,lcms)
743 ("libwebp" ,libwebp)
744 ("openexr" ,openexr)
745 ("poppler" ,poppler)
746 ("gsl" ,gsl)))
747 (native-inputs
748 `(("flex" ,flex)
749 ("bison" ,bison)
750 ("pkg-config" ,pkg-config)))
751 (home-page "https://github.com/libvips/nip2")
752 (synopsis "Spreadsheet-like GUI for libvips")
753 (description "This package provide a graphical user interface (GUI) for
754 the VIPS image processing library. It's a little like a spreadsheet: you
755 create a set of formula connecting your objects together, and on a change nip2
756 recalculates.")
757 (license license:gpl2+)))
758
759 (define-public vxl
760 (package
761 (name "vxl")
762 (version "2.0.2")
763 (source
764 (origin
765 (method git-fetch)
766 (uri (git-reference
767 (url "https://github.com/vxl/vxl")
768 (commit (string-append "v" version))))
769 (file-name (git-file-name name version))
770 (sha256
771 (base32 "0949hw57szq8943f1whwqaz591xjmb19kj803hcv74hdai2b0ycg"))
772 (modules '((guix build utils)))
773 ;; TODO: vxl includes an old version of dcmtk. It won't build with
774 ;; version 3.6.x.
775 (snippet
776 '(begin
777 (for-each delete-file-recursively
778 '("v3p/bzlib/"
779 "v3p/geotiff/"
780 "v3p/jpeg/"
781 "v3p/png/"
782 "v3p/tiff/"
783 "v3p/zlib/"))
784 (substitute* "v3p/CMakeLists.txt"
785 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
786 ""))
787 #t))))
788 (build-system cmake-build-system)
789 (inputs
790 `(("libgeotiff" ,libgeotiff)
791 ("libtiff" ,libtiff)
792 ("libjpeg" ,libjpeg-turbo)
793 ("libpng" ,libpng)
794 ("zlib" ,zlib)))
795 (home-page "https://github.com/vxl/vxl/")
796 (synopsis "Collection of C++ libraries for computer vision")
797 (description "VXL (the Vision-something-Libraries) is a collection of C++
798 libraries designed for computer vision research and implementation.")
799 (license license:bsd-3)))
800
801 (define-public vxl-1
802 (package (inherit vxl)
803 (name "vxl")
804 (version "1.18.0")
805 (source
806 (origin
807 (method git-fetch)
808 (uri (git-reference
809 (url "https://github.com/vxl/vxl")
810 (commit (string-append "v" version))))
811 (file-name (git-file-name name version))
812 (sha256
813 (base32 "1g4mr2cc58jwm0vasscbd4y5380wj3ahkvq121z4gs83fhavvxgz"))
814 (modules '((guix build utils)))
815 (snippet
816 '(begin
817 (for-each delete-file-recursively
818 '("v3p/bzlib/"
819 "v3p/geotiff/"
820 "v3p/png/"
821 "v3p/tiff/"
822 "v3p/zlib/"))
823 (substitute* "v3p/CMakeLists.txt"
824 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
825 ""))
826 #t))))
827 (arguments
828 `(#:configure-flags
829 ;; Needed for itk-snap
830 (list "-DVNL_CONFIG_LEGACY_METHODS=ON")))))
831
832 (define-public insight-toolkit
833 (package
834 (name "insight-toolkit")
835 (version "5.0.0")
836 (source
837 (origin
838 (method url-fetch)
839 (uri (string-append "https://github.com/InsightSoftwareConsortium/ITK/"
840 "releases/download/v" version "/InsightToolkit-"
841 version ".tar.xz"))
842 (sha256
843 (base32 "0bs63mk4q8jmx38f031jy5w5n9yy5ng9x8ijwinvjyvas8cichqi"))))
844 (build-system cmake-build-system)
845 (arguments
846 `(#:tests? #f ; tests require network access and external data
847 #:configure-flags
848 '("-DITK_USE_GPU=ON"
849 "-DITK_USE_SYSTEM_LIBRARIES=ON"
850 "-DITK_USE_SYSTEM_GOOGLETEST=ON"
851 "-DITK_BUILD_SHARED=ON"
852 ;; This prevents "GTest::GTest" from being added to the ITK_LIBRARIES
853 ;; variable in the installed CMake files. This is necessary as other
854 ;; packages using insight-toolkit could not be configured otherwise.
855 "-DGTEST_ROOT=gtest")
856 #:phases
857 (modify-phases %standard-phases
858 (add-after 'unpack 'do-not-tune
859 (lambda _
860 (substitute* "CMake/ITKSetStandardCompilerFlags.cmake"
861 (("-mute=native") ""))
862 #t)))))
863 (inputs
864 `(("eigen" ,eigen)
865 ("expat" ,expat)
866 ("fftw" ,fftw)
867 ("fftwf" ,fftwf)
868 ("hdf5" ,hdf5)
869 ("libjpeg" ,libjpeg-turbo)
870 ("libpng" ,libpng)
871 ("libtiff" ,libtiff)
872 ("mesa" ,mesa-opencl)
873 ("perl" ,perl)
874 ("python" ,python)
875 ("tbb" ,tbb)
876 ("vxl" ,vxl-1)
877 ("zlib" ,zlib)))
878 (native-inputs
879 `(("googletest" ,googletest)
880 ("pkg-config" ,pkg-config)))
881 (home-page "https://github.com/InsightSoftwareConsortium/ITK/")
882 (synopsis "Scientific image processing, segmentation and registration")
883 (description "The Insight Toolkit (ITK) is a toolkit for N-dimensional
884 scientific image processing, segmentation, and registration. Segmentation is
885 the process of identifying and classifying data found in a digitally sampled
886 representation. Typically the sampled representation is an image acquired
887 from such medical instrumentation as CT or MRI scanners. Registration is the
888 task of aligning or developing correspondences between data. For example, in
889 the medical environment, a CT scan may be aligned with a MRI scan in order to
890 combine the information contained in both.")
891 (license license:asl2.0)))
892
893 (define-public insight-toolkit-4
894 (package (inherit insight-toolkit)
895 (version "4.13.2")
896 (source
897 (origin
898 (method url-fetch)
899 (uri (string-append "https://github.com/InsightSoftwareConsortium/ITK/"
900 "releases/download/v" version "/InsightToolkit-"
901 version ".tar.xz"))
902 (sha256
903 (base32 "19cgfpd63gqrvc3m27m394gy2d7w79g5y6lvznb5qqr49lihbgns"))))
904 (arguments
905 `(#:tests? #f ; tests require network access and external data
906 #:configure-flags
907 '("-DITKV3_COMPATIBILITY=ON" ; needed for itk-snap
908 "-DITK_USE_GPU=ON"
909 "-DITK_USE_SYSTEM_LIBRARIES=ON"
910 "-DITK_USE_SYSTEM_GOOGLETEST=ON"
911 "-DITK_USE_SYSTEM_VXL=ON")))))
912
913 (define-public insight-toolkit-4.12
914 (package (inherit insight-toolkit-4)
915 (version "4.12.2")
916 (source
917 (origin
918 (method url-fetch)
919 (uri (string-append "mirror://sourceforge/itk/itk/4.12/"
920 "InsightToolkit-" version ".tar.xz"))
921 (sha256
922 (base32 "1qw9mxbh083siljygahl4gdfv91xvfd8hfl7ghwii19f60xrvn2w"))))))
923
924 (define-public itk-snap
925 (package
926 (name "itk-snap")
927 (version "3.8.0")
928 (source
929 (origin
930 (method git-fetch)
931 (uri (git-reference
932 (url "https://git.code.sf.net/p/itk-snap/src")
933 (commit (string-append "v" version))))
934 (file-name (git-file-name name version))
935 (sha256
936 (base32 "15i5ixpryfrbf3vrrb5rici8fb585f25k0v1ljds16bp1f1msr4q"))))
937 (build-system cmake-build-system)
938 (arguments
939 `(#:configure-flags
940 (list "-DSNAP_VERSION_GIT_SHA1=release"
941 "-DSNAP_VERSION_GIT_BRANCH=release"
942 "-DSNAP_VERSION_GIT_TIMESTAMP=0"
943 "-DSNAP_PACKAGE_QT_PLUGINS=OFF"
944 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
945 #:phases
946 (modify-phases %standard-phases
947 ;; During the installation phase all libraries provided by all
948 ;; dependencies will be copied to the lib directory. That's insane,
949 ;; so we disable this.
950 (add-after 'unpack 'do-not-copy-dependencies
951 (lambda _
952 (substitute* "CMakeLists.txt"
953 (("install_qt5_executable\
954 \\(\\$\\{SNAP_MAIN_INSTALL_DIR\\}/\\$\\{SNAP_EXE\\}\\)")
955 ""))
956 #t))
957 (add-after 'unpack 'disable-gui-tests
958 (lambda _
959 ;; The GUI tests just time out.
960 (substitute* "CMakeLists.txt"
961 ((" (Workspace|DiffSpace|ProbeIntensity|RegionCompetition\
962 |RandomForest|RandomForestBailOut)")
963 ""))
964 #t))
965 (add-after 'unpack 'make-reproducible
966 (lambda _
967 (substitute* "CMakeLists.txt"
968 (("TODAY\\(SNAP_VERSION_COMPILE_DATE\\)")
969 "SET(SNAP_VERSION_COMPILE_DATE \"(removed for reproducibility)\")"))
970 #t))
971 (add-after 'unpack 'prepare-submodules
972 (lambda* (#:key inputs #:allow-other-keys)
973 (rmdir "Submodules/c3d")
974 (copy-recursively (assoc-ref inputs "c3d-src")
975 "Submodules/c3d")
976 (substitute* '("Submodules/c3d/adapters/BiasFieldCorrectionN4.cxx"
977 "Submodules/c3d/adapters/ApplyMetric.cxx")
978 (("vcl_") "std::"))
979 (rmdir "Submodules/greedy")
980 (symlink (assoc-ref inputs "greedy-src")
981 "Submodules/greedy")
982 #t))
983 (add-after 'unpack 'fix-includes
984 (lambda _
985 (substitute* "GUI/Model/RegistrationModel.cxx"
986 (("<vnl_symmetric_eigensystem.h>")
987 "<vnl/algo/vnl_symmetric_eigensystem.h>"))
988 #t))
989 (add-before 'check 'prepare-tests
990 (lambda _
991 ;; Needed by at least one test.
992 (setenv "HOME" "/tmp")
993 #t))
994 (add-after 'install 'wrap-executable
995 (lambda* (#:key inputs outputs #:allow-other-keys)
996 (let ((out (assoc-ref outputs "out")))
997 (wrap-program (string-append out "/bin/itksnap")
998 `("QT_PLUGIN_PATH" ":" prefix
999 ,(map (lambda (label)
1000 (string-append (assoc-ref inputs label)
1001 "/lib/qt5/plugins"))
1002 '("qtbase" "qtdeclarative"))))
1003 #t))))))
1004 (inputs
1005 `(("curl" ,curl)
1006 ("fftw" ,fftw)
1007 ("fftwf" ,fftwf)
1008 ("glu" ,glu)
1009 ("hdf5" ,hdf5)
1010 ("mesa" ,mesa-opencl)
1011 ;; This package does not build with either insight-toolkit 5.0.0 and
1012 ;; not with 4.13. It really needs to be 4.12.
1013 ("itk" ,insight-toolkit-4.12)
1014 ("vtk" ,vtk-6)
1015 ("qtbase" ,qtbase)
1016 ("qtdeclarative" ,qtdeclarative)
1017 ("vxl" ,vxl-1)
1018 ("zlib" ,zlib)))
1019 (native-inputs
1020 `(("googletest" ,googletest)
1021 ("qttools" ,qttools)
1022 ("pkg-config" ,pkg-config)
1023 ("c3d-src"
1024 ,(let* ((commit "f521358db26e00002c911cc47bf463b043942ad3")
1025 (revision "1")
1026 (version (git-version "0" revision commit)))
1027 (origin
1028 (method git-fetch)
1029 (uri (git-reference
1030 (url "https://github.com/pyushkevich/c3d")
1031 (commit commit)))
1032 (file-name (git-file-name "c3d" version))
1033 (sha256
1034 (base32
1035 "0kyv3rxrxwr8c3sa9zv01lsnhk95b27gx1s870k3yi8qp52h7bx3")))))
1036 ;; We are using an arbitrary commit from 2017 because the latest
1037 ;; version breaks the build...
1038 ("greedy-src"
1039 ,(let* ((commit "97e340f7e8e66597599144947775e6039e79a0d3")
1040 (revision "1")
1041 (version (git-version "0" revision commit)))
1042 (origin
1043 (method git-fetch)
1044 (uri (git-reference
1045 (url "https://github.com/pyushkevich/greedy")
1046 (commit commit)))
1047 (file-name (git-file-name "greedy" version))
1048 (sha256
1049 (base32
1050 "0k5bc9za4jrc8z9dj08z1rkcp5xf0gnd1d2jmi1w9ny4vxh2q2ab")))))))
1051 (home-page "https://sourceforge.net/p/itk-snap/")
1052 (synopsis "Medical image segmentation")
1053 (description "ITK-SNAP is a tool for segmenting anatomical structures in
1054 medical images. It provides an automatic active contour segmentation
1055 pipeline, along with supporting a manual segmentation toolbox. ITK-SNAP has a
1056 full-featured UI aimed at clinical researchers.")
1057 ;; This includes the submodules greedy and c3d.
1058 (license license:gpl3+)))
1059
1060 (define-public metapixel
1061 ;; Follow stable branch.
1062 (let ((commit "98ee9daa093b6c334941242e63f90b1c2876eb4f"))
1063 (package
1064 (name "metapixel")
1065 (version (git-version "1.0.2" "1" commit))
1066 (source
1067 (origin
1068 (method git-fetch)
1069 (uri (git-reference
1070 (url "https://github.com/schani/metapixel")
1071 (commit commit)
1072 ;; TODO: Package rwimg and lispreader?
1073 (recursive? #t)))
1074 (file-name (git-file-name name version))
1075 (sha256
1076 (base32 "0r7n3a6bvcxkbpda4mwmrpicii09iql5z69nkjqygkwxw7ny3309"))))
1077 (build-system gnu-build-system)
1078 (inputs
1079 `(("giflib" ,giflib)
1080 ("libjpeg" ,libjpeg-turbo)
1081 ("libpng" ,libpng)
1082 ("perl" ,perl)))
1083 (native-inputs
1084 `(("pkg-config" ,pkg-config)
1085 ("docbook-xml" ,docbook-xml)
1086 ("docbook-xsl" ,docbook-xsl)
1087 ("xsltproc" ,libxslt)))
1088 (arguments
1089 `(#:tests? #f ; No tests.
1090 #:make-flags (list
1091 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1092 (string-append "MANPAGE_XSL="
1093 (assoc-ref %build-inputs "docbook-xsl")
1094 "/xml/xsl/docbook-xsl-*/manpages/docbook.xsl"))
1095 #:phases
1096 (modify-phases %standard-phases
1097 (delete 'configure)
1098 (add-before 'install 'make-local-docbook-xml
1099 (lambda* (#:key inputs #:allow-other-keys)
1100 (substitute* "metapixel.xml"
1101 (("http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd")
1102 (string-append (assoc-ref inputs "docbook-xml")
1103 "/xml/dtd/docbook/docbookx.dtd")))
1104 #t))
1105 (add-before 'install 'fix-directory-creation
1106 (lambda* (#:key outputs #:allow-other-keys)
1107 (mkdir-p (string-append (assoc-ref outputs "out") "/share/man/man1"))
1108 #t)))))
1109 (home-page "https://www.complang.tuwien.ac.at/schani/metapixel/")
1110 (synopsis "Photomosaics generator")
1111 (description "Metapixel is a program for generating photomosaics. It can
1112 generate classical photomosaics, in which the source image is viewed as a
1113 matrix of equally sized rectangles for each of which a matching image is
1114 substituted, as well as collage-style photomosaics, in which rectangular parts
1115 of the source image at arbitrary positions (i.e. not aligned to a matrix) are
1116 substituted by matching images.")
1117 (license license:gpl2))))
1118
1119 (define-public scantailor-advanced
1120 (let ((commit "3d1e74e6ace413733511086934a66f4e3f7a6027"))
1121 (package
1122 (name "scantailor-advanced")
1123 (version (string-append "1.0.16-" (string-take commit 7)))
1124 (source
1125 (origin
1126 (method git-fetch)
1127 (uri (git-reference
1128 (url "https://github.com/4lex4/scantailor-advanced")
1129 (commit commit)))
1130 (file-name (git-file-name name version))
1131 (sha256
1132 (base32
1133 "0kixwjb2x457dq7927hkh34c803p7yh1pmn6n61rk9shqrcg492h"))))
1134 (build-system qt-build-system)
1135 (native-inputs
1136 `(("qttools" ,qttools)))
1137 (inputs
1138 `(("boost" ,boost)
1139 ("libjpeg" ,libjpeg-turbo)
1140 ("libpng" ,libpng)
1141 ("libtiff" ,libtiff)
1142 ("qtbase" ,qtbase)
1143 ("qtsvg" ,qtsvg)
1144 ("zlib" ,zlib)))
1145 (arguments
1146 `(#:phases
1147 (modify-phases %standard-phases
1148 ;; Some tests require a display and fail with offscreen mode.
1149 (add-after 'unpack 'disable-failing-tests
1150 (lambda _
1151 (setenv "ARGS" "--exclude-regex \"imageproc_.*\"")
1152 #t)))))
1153 (home-page "https://github.com/4lex4/scantailor-advanced")
1154 (synopsis "Clean up scanned pages")
1155 (description "Scan Tailor is an interactive post-processing tool for
1156 scanned pages. It performs operations such as page splitting, deskewing,
1157 adding/removing borders, and others. You give it raw scans, and you get pages
1158 ready to be printed or assembled into a PDF or DJVU file. Scanning, optical
1159 character recognition, and assembling multi-page documents are out of scope of
1160 this project.
1161
1162 Scan Tailer Advanced is a fork of Scan Tailer that merges Scan Tailor Featured
1163 and Scan Tailor Enhanced versions as well as including many more bug fixes.")
1164 (license license:gpl3+))))
1165
1166 (define-public stiff
1167 (package
1168 (name "stiff")
1169 (version "2.4.0")
1170 (source
1171 (origin
1172 (method url-fetch)
1173 (uri (string-append "https://www.astromatic.net/download/stiff/stiff-"
1174 version ".tar.gz"))
1175 (sha256
1176 (base32 "14m92dskzw7bwsr64ha4p0mj3ndv13gwcbfic3qxrs3zq5353s7l"))))
1177 (build-system gnu-build-system)
1178 (inputs
1179 `(("libtiff" ,libtiff)
1180 ("zlib" ,zlib)
1181 ("libjpeg-turbo" ,libjpeg-turbo)))
1182 (home-page "https://www.astromatic.net/software/stiff")
1183 (synopsis "Convert scientific FITS images to TIFF format")
1184 (description
1185 "STIFF is a program that converts scientific @acronym{FITS, Flexible Image
1186 Transport System} images to the more popular TIFF format for illustration
1187 purposes.")
1188 (license license:gpl3+)))