| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 |
|
| 28 | (define-module (gnu packages image-processing)
|
| 29 | #:use-module ((guix licenses) #:prefix license:)
|
| 30 | #:use-module (guix packages)
|
| 31 | #:use-module (guix utils)
|
| 32 | #:use-module (guix download)
|
| 33 | #:use-module (guix git-download)
|
| 34 | #:use-module (guix build-system cmake)
|
| 35 | #:use-module (guix build-system gnu)
|
| 36 | #:use-module (gnu packages)
|
| 37 | #:use-module (gnu packages algebra)
|
| 38 | #:use-module (gnu packages bison)
|
| 39 | #:use-module (gnu packages boost)
|
| 40 | #:use-module (gnu packages check)
|
| 41 | #:use-module (gnu packages compression)
|
| 42 | #:use-module (gnu packages curl)
|
| 43 | #:use-module (gnu packages documentation)
|
| 44 | #:use-module (gnu packages flex)
|
| 45 | #:use-module (gnu packages fontutils)
|
| 46 | #:use-module (gnu packages geo)
|
| 47 | #:use-module (gnu packages ghostscript)
|
| 48 | #:use-module (gnu packages gl)
|
| 49 | #:use-module (gnu packages glib)
|
| 50 | #:use-module (gnu packages gnome)
|
| 51 | #:use-module (gnu packages graphics)
|
| 52 | #:use-module (gnu packages graphviz)
|
| 53 | #:use-module (gnu packages gstreamer)
|
| 54 | #:use-module (gnu packages gtk)
|
| 55 | #:use-module (gnu packages image)
|
| 56 | #:use-module (gnu packages imagemagick)
|
| 57 | #:use-module (gnu packages maths)
|
| 58 | #:use-module (gnu packages pdf)
|
| 59 | #:use-module (gnu packages perl)
|
| 60 | #:use-module (gnu packages photo)
|
| 61 | #:use-module (gnu packages pkg-config)
|
| 62 | #:use-module (gnu packages protobuf)
|
| 63 | #:use-module (gnu packages python)
|
| 64 | #:use-module (gnu packages python-xyz)
|
| 65 | #:use-module (gnu packages qt)
|
| 66 | #:use-module (gnu packages serialization)
|
| 67 | #:use-module (gnu packages tbb)
|
| 68 | #:use-module (gnu packages tls)
|
| 69 | #:use-module (gnu packages video)
|
| 70 | #:use-module (gnu packages xiph)
|
| 71 | #:use-module (gnu packages xml)
|
| 72 | #:use-module (gnu packages xorg)
|
| 73 | #:use-module (ice-9 match)
|
| 74 | #:use-module (srfi srfi-1))
|
| 75 |
|
| 76 | (define-public dcmtk
|
| 77 | (package
|
| 78 | (name "dcmtk")
|
| 79 | (version "3.6.5")
|
| 80 | (source
|
| 81 | (origin
|
| 82 | (method url-fetch)
|
| 83 | (uri
|
| 84 | (string-append "ftp://dicom.offis.de/pub/dicom/offis/software/dcmtk/"
|
| 85 | "dcmtk" (string-join (string-split version #\.) "")
|
| 86 | "/dcmtk-" version ".tar.gz"))
|
| 87 | (sha256
|
| 88 | (base32 "1fdyz5wwjp4grys61mxb2ia9fi6i3ax6s43l16xnv291bxk7hld0"))))
|
| 89 | (build-system cmake-build-system)
|
| 90 | (inputs
|
| 91 | `( |
| 92 | |
| 93 | ("libjpeg" ,libjpeg)
|
| 94 | ("libpng" ,libpng)
|
| 95 | ("libtiff" ,libtiff)
|
| 96 | ("libxml2" ,libxml2)
|
| 97 | ("openssl" ,openssl)
|
| 98 | ("zlib" ,zlib)))
|
| 99 | (native-inputs
|
| 100 | `(("doxygen" ,doxygen))) |
| 101 | (home-page "https://dcmtk.org")
|
| 102 | (synopsis "Libraries and programs implementing parts of the DICOM standard")
|
| 103 | (description "DCMTK is a collection of libraries and applications
|
| 104 | implementing large parts the DICOM standard. It includes software for
|
| 105 | examining, constructing and converting DICOM image files, handling offline
|
| 106 | media, sending and receiving images over a network connection, as well as
|
| 107 | demonstrative image storage and worklist servers.")
|
| 108 | (license (license:fsf-free
|
| 109 | "file://COPYRIGHT"
|
| 110 | "A union of the Apache 2.0 licence and various non-copyleft
|
| 111 | licences similar to the Modified BSD licence."))))
|
| 112 |
|
| 113 | (define-public mia
|
| 114 | (package
|
| 115 | (name "mia")
|
| 116 | (version "2.4.6")
|
| 117 | (source (origin
|
| 118 | (method url-fetch)
|
| 119 | (uri (string-append "mirror://sourceforge/mia/mia/"
|
| 120 | (version-major+minor version)
|
| 121 | "/mia-" version ".tar.xz"))
|
| 122 | (sha256
|
| 123 | (base32
|
| 124 | "0j4nd5z7i3v199jh7hqqhwd4g7snchizkc7rhzanpvngqg91m1pb"))))
|
| 125 | (build-system cmake-build-system)
|
| 126 | (arguments
|
| 127 | `(#:configure-flags
|
| 128 | (list "-DMIA_CREATE_NIPYPE_INTERFACES=0"
|
| 129 | "-DCMAKE_CXX_FLAGS=-fpermissive")))
|
| 130 | (inputs
|
| 131 | `(("boost" ,boost)
|
| 132 | ("dcmtk" ,dcmtk)
|
| 133 | ("doxygen" ,doxygen)
|
| 134 | ("eigen" ,eigen)
|
| 135 | ("fftw" ,fftw)
|
| 136 | ("fftwf" ,fftwf)
|
| 137 | ("gsl" ,gsl)
|
| 138 | ("gts" ,gts)
|
| 139 | ("hdf5" ,hdf5)
|
| 140 | ("itpp" ,itpp)
|
| 141 | ("libjpeg" ,libjpeg)
|
| 142 | ("libpng" ,libpng)
|
| 143 | ("libtiff" ,libtiff)
|
| 144 | ("libxml" ,libxml2)
|
| 145 | ("libxml++" ,libxml++)
|
| 146 | ("maxflow" ,maxflow)
|
| 147 | ("niftilib" ,niftilib)
|
| 148 | ("nlopt" ,nlopt)
|
| 149 | ("openexr" ,openexr)
|
| 150 | ("python-lxml" ,python2-lxml)
|
| 151 | ("vtk" ,vtk)))
|
| 152 | (native-inputs
|
| 153 | `(("pkg-config" ,pkg-config)
|
| 154 | ("python" ,python-2)))
|
| 155 | (home-page "http://mia.sourceforge.net")
|
| 156 | (synopsis "Toolkit for gray scale medical image analysis")
|
| 157 | (description "MIA provides a combination of command line tools, plug-ins,
|
| 158 | and libraries that make it possible run image processing tasks interactively
|
| 159 | in a command shell and to prototype using the shell's scripting language. It
|
| 160 | is built around a plug-in structure that makes it easy to add functionality
|
| 161 | without compromising the original code base and it makes use of a wide variety
|
| 162 | of external libraries that provide additional functionality.")
|
| 163 | (license license:gpl3+)))
|
| 164 |
|
| 165 | (define-public vtk
|
| 166 | (package
|
| 167 | (name "vtk")
|
| 168 | (version "8.2.0")
|
| 169 | (source (origin
|
| 170 | (method url-fetch)
|
| 171 | (uri (string-append "https://vtk.org/files/release/"
|
| 172 | (version-major+minor version)
|
| 173 | "/VTK-" version ".tar.gz"))
|
| 174 | (sha256
|
| 175 | (base32
|
| 176 | "1fspgp8k0myr6p2a6wkc21ldcswb4bvmb484m12mxgk1a9vxrhrl"))))
|
| 177 | (build-system cmake-build-system)
|
| 178 | (arguments
|
| 179 | '(#:build-type "Release" |
| 180 | |
| 181 | #:configure-flags '("-DVTK_USE_SYSTEM_EXPAT:BOOL=TRUE"
|
| 182 | "-DVTK_USE_SYSTEM_FREETYPE:BOOL=TRUE"
|
| 183 | "-DVTK_USE_SYSTEM_HDF5:BOOL=TRUE"
|
| 184 | "-DVTK_USE_SYSTEM_JPEG:BOOL=TRUE"
|
| 185 | "-DVTK_USE_SYSTEM_JSONCPP:BOOL=TRUE"
|
| 186 | "-DVTK_USE_SYSTEM_LIBXML2:BOOL=TRUE"
|
| 187 | "-DVTK_USE_SYSTEM_OGGTHEORA:BOOL=TRUE"
|
| 188 | "-DVTK_USE_SYSTEM_PNG:BOOL=TRUE"
|
| 189 | "-DVTK_USE_SYSTEM_TIFF:BOOL=TRUE"
|
| 190 | "-DVTK_USE_SYSTEM_ZLIB:BOOL=TRUE")
|
| 191 | #:tests? #f)) |
| 192 | (inputs
|
| 193 | `(("libXt" ,libxt)
|
| 194 | ("xorgproto" ,xorgproto)
|
| 195 | ("libX11" ,libx11)
|
| 196 | ("libxml2" ,libxml2)
|
| 197 | ("mesa" ,mesa)
|
| 198 | ("glu" ,glu)
|
| 199 | ("expat" ,expat)
|
| 200 | ("freetype" ,freetype)
|
| 201 | ("hdf5" ,hdf5)
|
| 202 | ("jpeg" ,libjpeg)
|
| 203 | ("jsoncpp" ,jsoncpp)
|
| 204 | ("libogg" ,libogg)
|
| 205 | ("libtheora" ,libtheora)
|
| 206 | ("png" ,libpng)
|
| 207 | ("tiff" ,libtiff)
|
| 208 | ("zlib" ,zlib)))
|
| 209 | (home-page "https://vtk.org/")
|
| 210 | (synopsis "Libraries for 3D computer graphics")
|
| 211 | (description
|
| 212 | "The Visualization Toolkit (VTK) is a C++ library for 3D computer graphics,
|
| 213 | image processing and visualization. It supports a wide variety of
|
| 214 | visualization algorithms including: scalar, vector, tensor, texture, and
|
| 215 | volumetric methods; and advanced modeling techniques such as: implicit
|
| 216 | modeling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay
|
| 217 | triangulation. VTK has an extensive information visualization framework, has
|
| 218 | a suite of 3D interaction widgets, supports parallel processing, and
|
| 219 | integrates with various databases on GUI toolkits such as Qt and Tk.")
|
| 220 | (license license:bsd-3)))
|
| 221 |
|
| 222 | |
| 223 | (define-public vtk-6
|
| 224 | (package (inherit vtk)
|
| 225 | (version "6.3.0")
|
| 226 | (source (origin
|
| 227 | (method url-fetch)
|
| 228 | (uri (string-append "https://vtk.org/files/release/"
|
| 229 | (version-major+minor version)
|
| 230 | "/VTK-" version ".tar.gz"))
|
| 231 | (sha256
|
| 232 | (base32
|
| 233 | "0pla1r5mvkgl4sl213gfdhzrypdgai0h3z5mfgm6p9jz9hsr794j"))))
|
| 234 | (inputs
|
| 235 | `(("jsoncpp" ,jsoncpp-for-tensorflow)
|
| 236 | ,@(alist-delete "jsoncpp" (package-inputs vtk))))))
|
| 237 |
|
| 238 | (define-public opencv
|
| 239 | (package
|
| 240 | (name "opencv")
|
| 241 | (version "3.4.3")
|
| 242 | (source (origin
|
| 243 | (method git-fetch)
|
| 244 | (uri (git-reference
|
| 245 | (url "https://github.com/opencv/opencv")
|
| 246 | (commit version)))
|
| 247 | (file-name (git-file-name name version))
|
| 248 | (sha256
|
| 249 | (base32
|
| 250 | "06bc61r8myym4s8im10brdjfg4wxkrvsbhhl7vr1msdan2xddzi3"))
|
| 251 | (modules '((guix build utils)))
|
| 252 | (snippet
|
| 253 | '(begin
|
| 254 | |
| 255 | (delete-file-recursively "3rdparty")
|
| 256 |
|
| 257 | |
| 258 | (delete-file-recursively "modules/highgui/src/files_Qt/Milky")
|
| 259 |
|
| 260 | |
| 261 | (for-each delete-file
|
| 262 | '("modules/java/test/pure_test/lib/junit-4.11.jar"
|
| 263 | "samples/java/sbt/sbt/sbt-launch.jar"))
|
| 264 | #t))))
|
| 265 | (build-system cmake-build-system)
|
| 266 | (arguments
|
| 267 | `(#:configure-flags
|
| 268 | (list "-DWITH_IPP=OFF"
|
| 269 | "-DWITH_ITT=OFF"
|
| 270 | "-DWITH_CAROTENE=OFF" |
| 271 | "-DENABLE_PRECOMPILED_HEADERS=OFF"
|
| 272 |
|
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | "-DCPU_BASELINE=SSE2"
|
| 280 |
|
| 281 | ,@(match (%current-system)
|
| 282 | ("x86_64-linux"
|
| 283 | '("-DCPU_DISPATCH=NEON;VFPV3;FP16;SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;POPCNT;AVX;FP16;AVX2;FMA3;AVX_512F;AVX512_SKX"
|
| 284 | "-DCPU_DISPATCH_REQUIRE=SSE3,SSSE3,SSE4_1,SSE4_2,AVX,AVX2"))
|
| 285 | ("armhf-linux"
|
| 286 | '("-DCPU_BASELINE_DISABLE=NEON")) |
| 287 | ("aarch64-linux"
|
| 288 | '("-DCPU_BASELINE=NEON"
|
| 289 | "-DCPU_DISPATCH=NEON;VFPV3;FP16"))
|
| 290 | (_ '()))
|
| 291 |
|
| 292 | "-DBUILD_PERF_TESTS=OFF"
|
| 293 | "-DBUILD_TESTS=ON"
|
| 294 |
|
| 295 | (string-append "-DOPENCV_EXTRA_MODULES_PATH=" (getcwd)
|
| 296 | "/opencv-contrib/modules")
|
| 297 |
|
| 298 | |
| 299 | (string-append "-DOPENCV_TEST_DATA_PATH=" (getcwd)
|
| 300 | "/opencv-extra/testdata")
|
| 301 |
|
| 302 | |
| 303 | |
| 304 | "-DBUILD_PROTOBUF=OFF"
|
| 305 |
|
| 306 | |
| 307 | |
| 308 | |
| 309 | "-DPROTOBUF_UPDATE_FILES=ON"
|
| 310 |
|
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | "-DBUILD_opencv_xfeatures2d=OFF")
|
| 317 | #:phases
|
| 318 | (modify-phases %standard-phases
|
| 319 | (add-after 'unpack 'disable-broken-tests
|
| 320 | (lambda _
|
| 321 | |
| 322 | |
| 323 | |
| 324 | (substitute* '("modules/viz/test/test_tutorial3.cpp"
|
| 325 | "modules/viz/test/test_main.cpp"
|
| 326 | "modules/viz/test/tests_simple.cpp"
|
| 327 | "modules/viz/test/test_viz3d.cpp")
|
| 328 | (("(TEST\\(Viz, )([a-z].*\\).*)" all pre post)
|
| 329 | (string-append pre "DISABLED_" post)))
|
| 330 |
|
| 331 | |
| 332 | |
| 333 | (substitute* "../opencv-contrib/modules/face/test/test_face_align.cpp"
|
| 334 | (("(TEST\\(CV_Face_FacemarkKazemi, )(can_detect_landmarks\\).*)"
|
| 335 | all pre post)
|
| 336 | (string-append pre "DISABLED_" post)))
|
| 337 |
|
| 338 | |
| 339 | |
| 340 | (substitute* "../opencv-contrib/modules/rgbd/test/test_odometry.cpp"
|
| 341 | (("(TEST\\(RGBD_Odometry_Rgbd, )(algorithmic\\).*)" all pre post)
|
| 342 | (string-append pre "DISABLED_" post)))
|
| 343 | #t))
|
| 344 |
|
| 345 | (add-after 'unpack 'unpack-submodule-sources
|
| 346 | (lambda* (#:key inputs #:allow-other-keys)
|
| 347 | (mkdir "../opencv-extra")
|
| 348 | (mkdir "../opencv-contrib")
|
| 349 | (copy-recursively (assoc-ref inputs "opencv-extra")
|
| 350 | "../opencv-extra")
|
| 351 | (invoke "tar" "xvf"
|
| 352 | (assoc-ref inputs "opencv-contrib")
|
| 353 | "--strip-components=1"
|
| 354 | "-C" "../opencv-contrib")))
|
| 355 |
|
| 356 | (add-after 'set-paths 'add-ilmbase-include-path
|
| 357 | (lambda* (#:key inputs #:allow-other-keys)
|
| 358 | |
| 359 | |
| 360 | |
| 361 | (setenv "CPATH"
|
| 362 | (string-append (assoc-ref inputs "ilmbase")
|
| 363 | "/include/OpenEXR"
|
| 364 | ":" (or (getenv "CPATH") "")))
|
| 365 | #t))
|
| 366 | (add-before 'check 'start-xserver
|
| 367 | (lambda* (#:key inputs #:allow-other-keys)
|
| 368 | (let ((xorg-server (assoc-ref inputs "xorg-server"))
|
| 369 | (disp ":1"))
|
| 370 | (setenv "HOME" (getcwd))
|
| 371 | (setenv "DISPLAY" disp)
|
| 372 | |
| 373 | |
| 374 | (zero? (system (format #f "~a/bin/Xvfb ~a &" xorg-server disp)))))))))
|
| 375 | (native-inputs
|
| 376 | `(("pkg-config" ,pkg-config)
|
| 377 | ("xorg-server" ,xorg-server-for-tests) |
| 378 | ("opencv-extra"
|
| 379 | ,(origin
|
| 380 | (method git-fetch)
|
| 381 | (uri (git-reference
|
| 382 | (url "https://github.com/opencv/opencv_extra")
|
| 383 | (commit version)))
|
| 384 | (file-name (git-file-name "opencv_extra" version))
|
| 385 | (sha256
|
| 386 | (base32 "08p5xnq8n1jw8svvz0fnirfg7q8dm3p4a5dl7527s5xj0f9qn7lp"))))
|
| 387 | ("opencv-contrib"
|
| 388 | ,(origin
|
| 389 | (method git-fetch)
|
| 390 | (uri (git-reference
|
| 391 | (url "https://github.com/opencv/opencv_contrib")
|
| 392 | (commit version)))
|
| 393 | (file-name (git-file-name "opencv_contrib" version))
|
| 394 | (patches (search-patches "opencv-rgbd-aarch64-test-fix.patch"))
|
| 395 | (sha256
|
| 396 | (base32 "1f334glf39nk42mpqq6j732h3ql2mpz89jd4mcl678s8n73nfjh2"))))))
|
| 397 | (inputs `(("libjpeg" ,libjpeg)
|
| 398 | ("libpng" ,libpng)
|
| 399 | ("jasper" ,jasper)
|
| 400 | |
| 401 | ("ffmpeg" ,ffmpeg-3.4)
|
| 402 | ("libtiff" ,libtiff)
|
| 403 | ("hdf5" ,hdf5)
|
| 404 | ("libgphoto2" ,libgphoto2)
|
| 405 | ("libwebp" ,libwebp)
|
| 406 | ("zlib" ,zlib)
|
| 407 | ("gtkglext" ,gtkglext)
|
| 408 | ("openexr" ,openexr)
|
| 409 | ("ilmbase" ,ilmbase)
|
| 410 | ("gtk+" ,gtk+-2)
|
| 411 | ("python-numpy" ,python-numpy)
|
| 412 | ("protobuf" ,protobuf)
|
| 413 | ("vtk" ,vtk)
|
| 414 | ("python" ,python)))
|
| 415 | |
| 416 | |
| 417 | (properties '((lint-hidden-cve . ("CVE-2018-7712"
|
| 418 | "CVE-2018-7713"
|
| 419 | "CVE-2018-7714"))))
|
| 420 | (synopsis "Computer vision library")
|
| 421 | (description "OpenCV is a library aimed at
|
| 422 | real-time computer vision, including several hundred computer
|
| 423 | vision algorithms. It can be used to do things like:
|
| 424 |
|
| 425 | @itemize
|
| 426 | @item image and video input and output
|
| 427 | @item image and video processing
|
| 428 | @item displaying
|
| 429 | @item feature recognition
|
| 430 | @item segmentation
|
| 431 | @item facial recognition
|
| 432 | @item stereo vision
|
| 433 | @item structure from motion
|
| 434 | @item augmented reality
|
| 435 | @item machine learning
|
| 436 | @end itemize\n")
|
| 437 | (home-page "https://opencv.org/")
|
| 438 | (license license:bsd-3)))
|
| 439 |
|
| 440 | (define-public vips
|
| 441 | (package
|
| 442 | (name "vips")
|
| 443 | (version "8.7.4")
|
| 444 | (source
|
| 445 | (origin
|
| 446 | (method url-fetch)
|
| 447 | (uri (string-append
|
| 448 | "https://github.com/libvips/libvips/releases/download/v"
|
| 449 | version "/vips-" version ".tar.gz"))
|
| 450 | (sha256
|
| 451 | (base32 "01gjhcrl6zj7mcj1al717v5jsniahplqhz1xkfh2j78vyfl1hxff"))))
|
| 452 | (build-system gnu-build-system)
|
| 453 | (native-inputs
|
| 454 | `(("pkg-config" ,pkg-config)
|
| 455 | ("gobject-introspection" ,gobject-introspection)))
|
| 456 | (inputs
|
| 457 | `(("glib" ,glib)
|
| 458 | ("libjpeg" ,libjpeg)
|
| 459 | ("libpng" ,libpng)
|
| 460 | ("librsvg" ,librsvg)
|
| 461 | ("libtiff" ,libtiff)
|
| 462 | ("libexif" ,libexif)
|
| 463 | ("giflib" ,giflib)
|
| 464 | ("libgsf" ,libgsf)
|
| 465 | ("fftw" ,fftw)
|
| 466 | ("poppler" ,poppler)
|
| 467 | ("pango" ,pango)
|
| 468 | ("lcms" ,lcms)
|
| 469 | ("matio" ,matio)
|
| 470 | ("libwebp" ,libwebp)
|
| 471 | ("niftilib" ,niftilib)
|
| 472 | ("openexr" ,openexr)
|
| 473 | ("orc" ,orc)
|
| 474 | ("imagemagick" ,imagemagick)
|
| 475 | ("libxml2" ,libxml2)
|
| 476 | ("expat" ,expat)
|
| 477 | ("hdf5" ,hdf5)))
|
| 478 | (home-page "https://libvips.github.io/libvips/")
|
| 479 | (synopsis "Multithreaded image processing system with low memory needs")
|
| 480 | (description
|
| 481 | "VIPS is a demand-driven, horizontally threaded image processing library.
|
| 482 | It's particularly good at processing large images, working with colour,
|
| 483 | scientific analysis, and general research & development.
|
| 484 |
|
| 485 | Compared to most image processing libraries VIPS needs little RAM and runs
|
| 486 | quickly, especially on machines with more than one CPU core. This is primarily
|
| 487 | due to its architecture which automatically parallelises the image workflows.")
|
| 488 | (license license:lgpl2.1+)))
|
| 489 |
|
| 490 | (define-public nip2
|
| 491 | (package
|
| 492 | (name "nip2")
|
| 493 | (version "8.7.1")
|
| 494 | (source
|
| 495 | (origin
|
| 496 | (method url-fetch)
|
| 497 | (uri (string-append "https://github.com/libvips/nip2/releases/download/v"
|
| 498 | version "/nip2-" version ".tar.gz" ))
|
| 499 | (sha256
|
| 500 | (base32 "0l7n427njif53npqn02gfjjly8y3khbrkzqxp10j5vp9h97psgiw"))))
|
| 501 | (build-system gnu-build-system)
|
| 502 | (arguments
|
| 503 | `(#:phases
|
| 504 | (modify-phases %standard-phases
|
| 505 | |
| 506 | (add-after 'unpack 'disable-test-conv
|
| 507 | (lambda _
|
| 508 | (delete-file "test/workspaces/test_conv.ws")
|
| 509 | #t))
|
| 510 | (add-before 'check 'set-home
|
| 511 | (lambda _
|
| 512 | (setenv "HOME" "/tmp") #t)))))
|
| 513 | (inputs
|
| 514 | `(("vips" ,vips)
|
| 515 | ("glib" ,glib)
|
| 516 | ("libtiff" ,libtiff)
|
| 517 | ("gtk+-2" ,gtk+-2)
|
| 518 | ("libxml2" ,libxml2)
|
| 519 | ("libexif" ,libexif)
|
| 520 | ("libjpeg" ,libjpeg) |
| 521 | ("librsvg" ,librsvg)
|
| 522 | ("fftw" ,fftw)
|
| 523 | ("libgsf" ,libgsf)
|
| 524 | ("imagemagick" ,imagemagick)
|
| 525 | ("orc" ,orc)
|
| 526 | ("matio" ,matio)
|
| 527 | ("lcms" ,lcms)
|
| 528 | ("libwebp" ,libwebp)
|
| 529 | ("openexr" ,openexr)
|
| 530 | ("poppler" ,poppler)
|
| 531 | ("gsl" ,gsl)))
|
| 532 | (native-inputs
|
| 533 | `(("flex" ,flex)
|
| 534 | ("bison" ,bison)
|
| 535 | ("pkg-config" ,pkg-config)))
|
| 536 | (home-page "https://github.com/libvips/nip2")
|
| 537 | (synopsis "Spreadsheet-like GUI for libvips")
|
| 538 | (description "This package provide a graphical user interface (GUI) for
|
| 539 | the VIPS image processing library. It's a little like a spreadsheet: you
|
| 540 | create a set of formula connecting your objects together, and on a change nip2
|
| 541 | recalculates.")
|
| 542 | (license license:gpl2+)))
|
| 543 |
|
| 544 | (define-public vxl
|
| 545 | (package
|
| 546 | (name "vxl")
|
| 547 | (version "2.0.2")
|
| 548 | (source
|
| 549 | (origin
|
| 550 | (method git-fetch)
|
| 551 | (uri (git-reference
|
| 552 | (url "https://github.com/vxl/vxl.git")
|
| 553 | (commit (string-append "v" version))))
|
| 554 | (file-name (git-file-name name version))
|
| 555 | (sha256
|
| 556 | (base32 "0949hw57szq8943f1whwqaz591xjmb19kj803hcv74hdai2b0ycg"))
|
| 557 | (modules '((guix build utils)))
|
| 558 | |
| 559 | |
| 560 | (snippet
|
| 561 | '(begin
|
| 562 | (for-each delete-file-recursively
|
| 563 | '("v3p/bzlib/"
|
| 564 | "v3p/geotiff/"
|
| 565 | "v3p/jpeg/"
|
| 566 | "v3p/png/"
|
| 567 | "v3p/tiff/"
|
| 568 | "v3p/zlib/"))
|
| 569 | (substitute* "v3p/CMakeLists.txt"
|
| 570 | (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
|
| 571 | ""))
|
| 572 | #t))))
|
| 573 | (build-system cmake-build-system)
|
| 574 | (inputs
|
| 575 | `(("libgeotiff" ,libgeotiff)
|
| 576 | ("libtiff" ,libtiff)
|
| 577 | ("libjpeg" ,libjpeg)
|
| 578 | ("libpng" ,libpng)
|
| 579 | ("zlib" ,zlib)))
|
| 580 | (home-page "https://github.com/vxl/vxl/")
|
| 581 | (synopsis "Collection of C++ libraries for computer vision")
|
| 582 | (description "VXL (the Vision-something-Libraries) is a collection of C++
|
| 583 | libraries designed for computer vision research and implementation.")
|
| 584 | (license license:bsd-3)))
|
| 585 |
|
| 586 | (define-public vxl-1
|
| 587 | (package (inherit vxl)
|
| 588 | (name "vxl")
|
| 589 | (version "1.18.0")
|
| 590 | (source
|
| 591 | (origin
|
| 592 | (method git-fetch)
|
| 593 | (uri (git-reference
|
| 594 | (url "https://github.com/vxl/vxl.git")
|
| 595 | (commit (string-append "v" version))))
|
| 596 | (file-name (git-file-name name version))
|
| 597 | (sha256
|
| 598 | (base32 "1g4mr2cc58jwm0vasscbd4y5380wj3ahkvq121z4gs83fhavvxgz"))
|
| 599 | (modules '((guix build utils)))
|
| 600 | (snippet
|
| 601 | '(begin
|
| 602 | (for-each delete-file-recursively
|
| 603 | '("v3p/bzlib/"
|
| 604 | "v3p/geotiff/"
|
| 605 | "v3p/png/"
|
| 606 | "v3p/tiff/"
|
| 607 | "v3p/zlib/"))
|
| 608 | (substitute* "v3p/CMakeLists.txt"
|
| 609 | (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
|
| 610 | ""))
|
| 611 | #t))))
|
| 612 | (arguments
|
| 613 | `(#:configure-flags
|
| 614 | |
| 615 | (list "-DVNL_CONFIG_LEGACY_METHODS=ON")))))
|
| 616 |
|
| 617 | (define-public insight-toolkit
|
| 618 | (package
|
| 619 | (name "insight-toolkit")
|
| 620 | (version "5.0.0")
|
| 621 | (source
|
| 622 | (origin
|
| 623 | (method url-fetch)
|
| 624 | (uri (string-append "https://github.com/InsightSoftwareConsortium/ITK/"
|
| 625 | "releases/download/v" version "/InsightToolkit-"
|
| 626 | version ".tar.xz"))
|
| 627 | (sha256
|
| 628 | (base32 "0bs63mk4q8jmx38f031jy5w5n9yy5ng9x8ijwinvjyvas8cichqi"))))
|
| 629 | (build-system cmake-build-system)
|
| 630 | (arguments
|
| 631 | `(#:tests? #f |
| 632 | #:configure-flags
|
| 633 | '("-DITK_USE_GPU=ON"
|
| 634 | "-DITK_USE_SYSTEM_LIBRARIES=ON"
|
| 635 | "-DITK_USE_SYSTEM_GOOGLETEST=ON"
|
| 636 | "-DITK_BUILD_SHARED=ON"
|
| 637 | |
| 638 | |
| 639 | |
| 640 | "-DGTEST_ROOT=gtest")
|
| 641 | #:phases
|
| 642 | (modify-phases %standard-phases
|
| 643 | (add-after 'unpack 'do-not-tune
|
| 644 | (lambda _
|
| 645 | (substitute* "CMake/ITKSetStandardCompilerFlags.cmake"
|
| 646 | (("-mute=native") ""))
|
| 647 | #t)))))
|
| 648 | (inputs
|
| 649 | `(("eigen" ,eigen)
|
| 650 | ("expat" ,expat)
|
| 651 | ("fftw" ,fftw)
|
| 652 | ("fftwf" ,fftwf)
|
| 653 | ("hdf5" ,hdf5)
|
| 654 | ("libjpeg" ,libjpeg)
|
| 655 | ("libpng" ,libpng)
|
| 656 | ("libtiff" ,libtiff)
|
| 657 | ("mesa" ,mesa-opencl)
|
| 658 | ("perl" ,perl)
|
| 659 | ("python" ,python)
|
| 660 | ("tbb" ,tbb)
|
| 661 | ("vxl" ,vxl-1)
|
| 662 | ("zlib" ,zlib)))
|
| 663 | (native-inputs
|
| 664 | `(("googletest" ,googletest)
|
| 665 | ("pkg-config" ,pkg-config)))
|
| 666 | (home-page "https://github.com/InsightSoftwareConsortium/ITK/")
|
| 667 | (synopsis "Scientific image processing, segmentation and registration")
|
| 668 | (description "The Insight Toolkit (ITK) is a toolkit for N-dimensional
|
| 669 | scientific image processing, segmentation, and registration. Segmentation is
|
| 670 | the process of identifying and classifying data found in a digitally sampled
|
| 671 | representation. Typically the sampled representation is an image acquired
|
| 672 | from such medical instrumentation as CT or MRI scanners. Registration is the
|
| 673 | task of aligning or developing correspondences between data. For example, in
|
| 674 | the medical environment, a CT scan may be aligned with a MRI scan in order to
|
| 675 | combine the information contained in both.")
|
| 676 | (license license:asl2.0)))
|
| 677 |
|
| 678 | (define-public insight-toolkit-4
|
| 679 | (package (inherit insight-toolkit)
|
| 680 | (version "4.13.2")
|
| 681 | (source
|
| 682 | (origin
|
| 683 | (method url-fetch)
|
| 684 | (uri (string-append "https://github.com/InsightSoftwareConsortium/ITK/"
|
| 685 | "releases/download/v" version "/InsightToolkit-"
|
| 686 | version ".tar.xz"))
|
| 687 | (sha256
|
| 688 | (base32 "19cgfpd63gqrvc3m27m394gy2d7w79g5y6lvznb5qqr49lihbgns"))))
|
| 689 | (arguments
|
| 690 | `(#:tests? #f |
| 691 | #:configure-flags
|
| 692 | '("-DITKV3_COMPATIBILITY=ON" |
| 693 | "-DITK_USE_GPU=ON"
|
| 694 | "-DITK_USE_SYSTEM_LIBRARIES=ON"
|
| 695 | "-DITK_USE_SYSTEM_GOOGLETEST=ON"
|
| 696 | "-DITK_USE_SYSTEM_VXL=ON")))))
|
| 697 |
|
| 698 | (define-public insight-toolkit-4.12
|
| 699 | (package (inherit insight-toolkit-4)
|
| 700 | (version "4.12.2")
|
| 701 | (source
|
| 702 | (origin
|
| 703 | (method url-fetch)
|
| 704 | (uri (string-append "mirror://sourceforge/itk/itk/4.12/"
|
| 705 | "InsightToolkit-" version ".tar.xz"))
|
| 706 | (sha256
|
| 707 | (base32 "1qw9mxbh083siljygahl4gdfv91xvfd8hfl7ghwii19f60xrvn2w"))))))
|
| 708 |
|
| 709 | (define-public itk-snap
|
| 710 | (package
|
| 711 | (name "itk-snap")
|
| 712 | (version "3.8.0")
|
| 713 | (source
|
| 714 | (origin
|
| 715 | (method git-fetch)
|
| 716 | (uri (git-reference
|
| 717 | (url "https://git.code.sf.net/p/itk-snap/src")
|
| 718 | (commit (string-append "v" version))))
|
| 719 | (file-name (git-file-name name version))
|
| 720 | (sha256
|
| 721 | (base32 "15i5ixpryfrbf3vrrb5rici8fb585f25k0v1ljds16bp1f1msr4q"))))
|
| 722 | (build-system cmake-build-system)
|
| 723 | (arguments
|
| 724 | `(#:configure-flags
|
| 725 | (list "-DSNAP_VERSION_GIT_SHA1=release"
|
| 726 | "-DSNAP_VERSION_GIT_BRANCH=release"
|
| 727 | "-DSNAP_VERSION_GIT_TIMESTAMP=0"
|
| 728 | "-DSNAP_PACKAGE_QT_PLUGINS=OFF"
|
| 729 | "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
|
| 730 | #:phases
|
| 731 | (modify-phases %standard-phases
|
| 732 | |
| 733 | |
| 734 | |
| 735 | (add-after 'unpack 'do-not-copy-dependencies
|
| 736 | (lambda _
|
| 737 | (substitute* "CMakeLists.txt"
|
| 738 | (("install_qt5_executable\
|
| 739 | \\(\\$\\{SNAP_MAIN_INSTALL_DIR\\}/\\$\\{SNAP_EXE\\}\\)")
|
| 740 | ""))
|
| 741 | #t))
|
| 742 | (add-after 'unpack 'disable-gui-tests
|
| 743 | (lambda _
|
| 744 | |
| 745 | (substitute* "CMakeLists.txt"
|
| 746 | ((" (Workspace|DiffSpace|ProbeIntensity|RegionCompetition\
|
| 747 | |RandomForest|RandomForestBailOut)")
|
| 748 | ""))
|
| 749 | #t))
|
| 750 | (add-after 'unpack 'make-reproducible
|
| 751 | (lambda _
|
| 752 | (substitute* "CMakeLists.txt"
|
| 753 | (("TODAY\\(SNAP_VERSION_COMPILE_DATE\\)")
|
| 754 | "SET(SNAP_VERSION_COMPILE_DATE \"(removed for reproducibility)\")"))
|
| 755 | #t))
|
| 756 | (add-after 'unpack 'prepare-submodules
|
| 757 | (lambda* (#:key inputs #:allow-other-keys)
|
| 758 | (rmdir "Submodules/c3d")
|
| 759 | (copy-recursively (assoc-ref inputs "c3d-src")
|
| 760 | "Submodules/c3d")
|
| 761 | (substitute* '("Submodules/c3d/adapters/BiasFieldCorrectionN4.cxx"
|
| 762 | "Submodules/c3d/adapters/ApplyMetric.cxx")
|
| 763 | (("vcl_") "std::"))
|
| 764 | (rmdir "Submodules/greedy")
|
| 765 | (symlink (assoc-ref inputs "greedy-src")
|
| 766 | "Submodules/greedy")
|
| 767 | #t))
|
| 768 | (add-after 'unpack 'fix-includes
|
| 769 | (lambda _
|
| 770 | (substitute* "GUI/Model/RegistrationModel.cxx"
|
| 771 | (("<vnl_symmetric_eigensystem.h>")
|
| 772 | "<vnl/algo/vnl_symmetric_eigensystem.h>"))
|
| 773 | #t))
|
| 774 | (add-before 'check 'prepare-tests
|
| 775 | (lambda _
|
| 776 | |
| 777 | (setenv "HOME" "/tmp")
|
| 778 | #t))
|
| 779 | (add-after 'install 'wrap-executable
|
| 780 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 781 | (let ((out (assoc-ref outputs "out")))
|
| 782 | (wrap-program (string-append out "/bin/itksnap")
|
| 783 | `("QT_PLUGIN_PATH" ":" prefix
|
| 784 | ,(map (lambda (label)
|
| 785 | (string-append (assoc-ref inputs label)
|
| 786 | "/lib/qt5/plugins"))
|
| 787 | '("qtbase" "qtdeclarative"))))
|
| 788 | #t))))))
|
| 789 | (inputs
|
| 790 | `(("curl" ,curl)
|
| 791 | ("fftw" ,fftw)
|
| 792 | ("fftwf" ,fftwf)
|
| 793 | ("glu" ,glu)
|
| 794 | ("hdf5" ,hdf5)
|
| 795 | ("mesa" ,mesa-opencl)
|
| 796 | |
| 797 | |
| 798 | ("itk" ,insight-toolkit-4.12)
|
| 799 | ("vtk" ,vtk-6)
|
| 800 | ("qtbase" ,qtbase)
|
| 801 | ("qtdeclarative" ,qtdeclarative)
|
| 802 | ("vxl" ,vxl-1)
|
| 803 | ("zlib" ,zlib)))
|
| 804 | (native-inputs
|
| 805 | `(("googletest" ,googletest)
|
| 806 | ("qttools" ,qttools)
|
| 807 | ("pkg-config" ,pkg-config)
|
| 808 | ("c3d-src"
|
| 809 | ,(let* ((commit "f521358db26e00002c911cc47bf463b043942ad3")
|
| 810 | (revision "1")
|
| 811 | (version (git-version "0" revision commit)))
|
| 812 | (origin
|
| 813 | (method git-fetch)
|
| 814 | (uri (git-reference
|
| 815 | (url "https://github.com/pyushkevich/c3d.git")
|
| 816 | (commit commit)))
|
| 817 | (file-name (git-file-name "c3d" version))
|
| 818 | (sha256
|
| 819 | (base32
|
| 820 | "0kyv3rxrxwr8c3sa9zv01lsnhk95b27gx1s870k3yi8qp52h7bx3")))))
|
| 821 | |
| 822 | |
| 823 | ("greedy-src"
|
| 824 | ,(let* ((commit "97e340f7e8e66597599144947775e6039e79a0d3")
|
| 825 | (revision "1")
|
| 826 | (version (git-version "0" revision commit)))
|
| 827 | (origin
|
| 828 | (method git-fetch)
|
| 829 | (uri (git-reference
|
| 830 | (url "https://github.com/pyushkevich/greedy.git")
|
| 831 | (commit commit)))
|
| 832 | (file-name (git-file-name "greedy" version))
|
| 833 | (sha256
|
| 834 | (base32
|
| 835 | "0k5bc9za4jrc8z9dj08z1rkcp5xf0gnd1d2jmi1w9ny4vxh2q2ab")))))))
|
| 836 | (home-page "https://sourceforge.net/p/itk-snap/")
|
| 837 | (synopsis "Medical image segmentation")
|
| 838 | (description "ITK-SNAP is a tool for segmenting anatomical structures in
|
| 839 | medical images. It provides an automatic active contour segmentation
|
| 840 | pipeline, along with supporting a manual segmentation toolbox. ITK-SNAP has a
|
| 841 | full-featured UI aimed at clinical researchers.")
|
| 842 | |
| 843 | (license license:gpl3+)))
|