| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 |
|
| 22 | (define-module (gnu packages medical)
|
| 23 | #:use-module ((guix licenses) #:prefix license:)
|
| 24 | #:use-module (guix build-system cmake)
|
| 25 | #:use-module (guix build-system gnu)
|
| 26 | #:use-module (guix build-system pyproject)
|
| 27 | #:use-module (guix build-system qt)
|
| 28 | #:use-module (guix download)
|
| 29 | #:use-module (guix gexp)
|
| 30 | #:use-module (guix git-download)
|
| 31 | #:use-module (guix hg-download)
|
| 32 | #:use-module (guix packages)
|
| 33 | #:use-module (guix utils)
|
| 34 | #:use-module (gnu packages base)
|
| 35 | #:use-module (gnu packages bash) |
| 36 | #:use-module (gnu packages boost)
|
| 37 | #:use-module (gnu packages check)
|
| 38 | #:use-module (gnu packages compression)
|
| 39 | #:use-module (gnu packages curl)
|
| 40 | #:use-module (gnu packages databases)
|
| 41 | #:use-module (gnu packages documentation)
|
| 42 | #:use-module (gnu packages glib)
|
| 43 | #:use-module (gnu packages gtk)
|
| 44 | #:use-module (gnu packages image)
|
| 45 | #:use-module (gnu packages image-processing)
|
| 46 | #:use-module (gnu packages kde-frameworks) |
| 47 | #:use-module (gnu packages linux)
|
| 48 | #:use-module (gnu packages lua)
|
| 49 | #:use-module (gnu packages pkg-config)
|
| 50 | #:use-module (gnu packages protobuf)
|
| 51 | #:use-module (gnu packages python)
|
| 52 | #:use-module (gnu packages python-build)
|
| 53 | #:use-module (gnu packages python-crypto)
|
| 54 | #:use-module (gnu packages python-web)
|
| 55 | #:use-module (gnu packages python-xyz)
|
| 56 | #:use-module (gnu packages qt)
|
| 57 | #:use-module (gnu packages serialization)
|
| 58 | #:use-module (gnu packages sqlite)
|
| 59 | #:use-module (gnu packages tls)
|
| 60 | #:use-module (gnu packages web)
|
| 61 | #:use-module (gnu packages xml))
|
| 62 |
|
| 63 | (define-public mygnuhealth
|
| 64 | (package
|
| 65 | (name "mygnuhealth")
|
| 66 | (version "2.2.1")
|
| 67 | (source
|
| 68 | (origin
|
| 69 | (method url-fetch)
|
| 70 | (uri (pypi-uri "MyGNUHealth" version))
|
| 71 | (sha256
|
| 72 | (base32 "1jcrriccqzb4jx7zayhiqmpvi3cvfy3bbf9zr3m83878f94yww8j"))))
|
| 73 | (build-system pyproject-build-system)
|
| 74 | (arguments
|
| 75 | (list
|
| 76 | #:tests? #f |
| 77 | #:imported-modules
|
| 78 | `(,@%pyproject-build-system-modules
|
| 79 | ,@%qt-build-system-modules)
|
| 80 | #:modules
|
| 81 | `(((guix build qt-build-system) #:prefix qt:)
|
| 82 | (guix build pyproject-build-system)
|
| 83 | (guix build utils))
|
| 84 | #:phases
|
| 85 | #~(modify-phases %standard-phases
|
| 86 | (add-after 'install 'qt-wrap
|
| 87 | (assoc-ref qt:%standard-phases 'qt-wrap))
|
| 88 | (add-before 'check 'env-setup
|
| 89 | (lambda _
|
| 90 | (mkdir-p "/tmp/mygh/")
|
| 91 | (setenv "HOME" "/tmp"))))))
|
| 92 | (native-inputs (list python-pyside-6 python-setuptools))
|
| 93 | (inputs (list bash-minimal
|
| 94 | kirigami-5
|
| 95 | python
|
| 96 | python-bcrypt
|
| 97 | python-matplotlib
|
| 98 | python-requests
|
| 99 | python-tinydb
|
| 100 | qtbase-5
|
| 101 | qtdeclarative-5
|
| 102 | qtgraphicaleffects
|
| 103 | qtquickcontrols-5
|
| 104 | qtquickcontrols2-5
|
| 105 | qtsvg-5))
|
| 106 | (home-page "https://www.gnuhealth.org")
|
| 107 | (synopsis "The GNU Health Personal Health Record")
|
| 108 | (description
|
| 109 | "This package provides GNUHealth Personal Health Record
|
| 110 | application for desktop and mobile devices that integrates with the GNU
|
| 111 | Health Federation.")
|
| 112 | (license license:gpl3+)))
|
| 113 |
|
| 114 | (define-public orthanc
|
| 115 | (package
|
| 116 | (name "orthanc")
|
| 117 | (version "1.12.10")
|
| 118 | (source
|
| 119 | (origin
|
| 120 | (method hg-fetch)
|
| 121 | (uri (hg-reference (url "https://orthanc.uclouvain.be/hg/orthanc")
|
| 122 | (changeset "8628c32729cf")))
|
| 123 | (file-name (hg-file-name name version))
|
| 124 | (sha256
|
| 125 | (base32 "16xkbs6amhx81yvn7avkg8nwha6sj55l6vipa5290yf0rgygyadr"))))
|
| 126 | (build-system cmake-build-system)
|
| 127 | (arguments
|
| 128 | (list
|
| 129 | #:configure-flags
|
| 130 | #~(list (string-append "-DDCMTK_DICTIONARY_DIR="
|
| 131 | #$(this-package-input "dcmtk") "/share/dcmtk-"
|
| 132 | #$(package-version (this-package-input "dcmtk")))
|
| 133 | |
| 134 | "-DBUILD_CONNECTIVITY_CHECKS=OFF"
|
| 135 | |
| 136 | "-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=OFF")
|
| 137 | #:phases
|
| 138 | #~(modify-phases %standard-phases
|
| 139 | (add-after 'unpack 'chdir
|
| 140 | (lambda _
|
| 141 | |
| 142 | |
| 143 | (chdir "OrthancServer")))
|
| 144 | (add-after 'unpack 'remove-localtime-requirement
|
| 145 | (lambda _
|
| 146 | |
| 147 | |
| 148 | (substitute* "OrthancFramework/Sources/Toolbox.cpp"
|
| 149 | (("if \\(!boost::filesystem::exists\\(LOCALTIME\\)\\)")
|
| 150 | "if (false)"))))
|
| 151 | |
| 152 | (replace 'check
|
| 153 | (lambda* (#:key tests? #:allow-other-keys)
|
| 154 | (when tests?
|
| 155 | (invoke "./UnitTests")))))))
|
| 156 | (native-inputs (list doxygen
|
| 157 | glibc-utf8-locales |
| 158 | googletest
|
| 159 | python))
|
| 160 | (inputs (list boost
|
| 161 | civetweb
|
| 162 | curl
|
| 163 | dcmtk
|
| 164 | jsoncpp
|
| 165 | libjpeg-turbo
|
| 166 | libpng
|
| 167 | lua
|
| 168 | openssl
|
| 169 | protobuf
|
| 170 | pugixml
|
| 171 | `(,util-linux "lib") |
| 172 | sqlite
|
| 173 | unzip))
|
| 174 | (home-page "https://orthanc-server.com")
|
| 175 | (synopsis
|
| 176 | "Standalone @acronym{DICOM, Digital Imaging and Communications in
|
| 177 | Medicine} server")
|
| 178 | (description
|
| 179 | "Orthanc is a standalone @acronym{DICOM, Digital Imaging and
|
| 180 | Communications in Medicine} server with a RESTful API and plugin
|
| 181 | mechanism for extending its functionality.")
|
| 182 | (license license:gpl3+)))
|
| 183 |
|
| 184 | (define-public orthanc-postgresql
|
| 185 | |
| 186 | (let ((changeset "81d837d7d20d")
|
| 187 | (revision "0"))
|
| 188 | (package
|
| 189 | (name "orthanc-postgresql")
|
| 190 | (version (git-version "10.0" revision changeset))
|
| 191 | (source
|
| 192 | (origin
|
| 193 | (method hg-fetch)
|
| 194 | (uri (hg-reference
|
| 195 | (url "https://orthanc.uclouvain.be/hg/orthanc-databases")
|
| 196 | (changeset changeset)))
|
| 197 | (file-name (hg-file-name name version))
|
| 198 | (sha256
|
| 199 | (base32 "1ijxa8hlpxjcrcp0b54fzmxf01lqb9741bff4ak1nw24sn9z96ai"))))
|
| 200 | (build-system cmake-build-system)
|
| 201 | (arguments
|
| 202 | (list
|
| 203 | #:configure-flags
|
| 204 | #~(list
|
| 205 | |
| 206 | "-DORTHANC_FRAMEWORK_SOURCE=path"
|
| 207 | (string-append "-DORTHANC_FRAMEWORK_ROOT="
|
| 208 | #$(package-source (this-package-input "orthanc"))
|
| 209 | "/OrthancFramework/Sources"))
|
| 210 | #:phases
|
| 211 | #~(modify-phases %standard-phases
|
| 212 | (add-after 'unpack 'chdir
|
| 213 | (lambda _
|
| 214 | |
| 215 | |
| 216 | (chdir "PostgreSQL")))
|
| 217 | |
| 218 | (replace 'check
|
| 219 | (lambda* (#:key tests? #:allow-other-keys)
|
| 220 | (when tests?
|
| 221 | |
| 222 | |
| 223 | (let ((pgdata "/tmp/pgdata")
|
| 224 | (host "/tmp")
|
| 225 | (port "5432")
|
| 226 | |
| 227 | (username "postgres")
|
| 228 | (password "")
|
| 229 | (database "orthanctest"))
|
| 230 | (invoke "initdb" pgdata)
|
| 231 | (invoke "pg_ctl" "-D" pgdata
|
| 232 | "-o" (string-append "-k " host)
|
| 233 | "start")
|
| 234 | (invoke "createdb" "-h" host database)
|
| 235 | (invoke "createuser" "-h" host username)
|
| 236 | |
| 237 | (invoke "psql" "-h" host "-d" database "-c"
|
| 238 | (string-append "ALTER ROLE " username
|
| 239 | " WITH SUPERUSER;"))
|
| 240 | (invoke "./UnitTests" host port username password
|
| 241 | database))))))))
|
| 242 | (native-inputs
|
| 243 | (list googletest
|
| 244 | python))
|
| 245 | (inputs
|
| 246 | (list boost-1.83
|
| 247 | jsoncpp
|
| 248 | openssl
|
| 249 | orthanc
|
| 250 | postgresql
|
| 251 | protobuf
|
| 252 | unzip
|
| 253 | (list util-linux "lib") |
| 254 | zlib))
|
| 255 | (home-page "https://orthanc-server.com")
|
| 256 | (synopsis "PostgreSQL plugins for Orthanc")
|
| 257 | (description
|
| 258 | "This package provides plugins to use PostgreSQL as the database
|
| 259 | backend of an Orthanc @acronym{DICOM, Digital Imaging and Communications in
|
| 260 | Medicine} server instead of SQLite.")
|
| 261 | (license license:agpl3+))))
|
| 262 |
|
| 263 | (define-public orthanc-mysql
|
| 264 | |
| 265 | (let ((changeset "a6300ccf6683")
|
| 266 | (revision "0"))
|
| 267 | (package
|
| 268 | (name "orthanc-mysql")
|
| 269 | (version (git-version "5.2" revision changeset))
|
| 270 | (source
|
| 271 | (origin
|
| 272 | (method hg-fetch)
|
| 273 | (uri (hg-reference
|
| 274 | (url "https://orthanc.uclouvain.be/hg/orthanc-databases")
|
| 275 | (changeset changeset)))
|
| 276 | (file-name (hg-file-name name version))
|
| 277 | (sha256
|
| 278 | (base32 "0hi3bawj117lk7lrxpa6h7vq4hx9jwqb3m5pwn3726hnf4kmp4jc"))))
|
| 279 | (build-system cmake-build-system)
|
| 280 | (arguments
|
| 281 | (list
|
| 282 | #:configure-flags
|
| 283 | #~(list
|
| 284 | |
| 285 | "-DORTHANC_FRAMEWORK_SOURCE=path"
|
| 286 | (string-append "-DORTHANC_FRAMEWORK_ROOT="
|
| 287 | #$(package-source (this-package-input "orthanc"))
|
| 288 | "/OrthancFramework/Sources"))
|
| 289 | #:phases
|
| 290 | #~(modify-phases %standard-phases
|
| 291 | (add-after 'unpack 'chdir
|
| 292 | (lambda _
|
| 293 | |
| 294 | |
| 295 | (chdir "MySQL")))
|
| 296 | (add-after 'unpack 'fix-mysql-include-path
|
| 297 | (lambda* (#:key inputs #:allow-other-keys)
|
| 298 | |
| 299 | |
| 300 | (substitute* "Resources/CMake/MariaDBConfiguration.cmake"
|
| 301 | (("/usr/include/mysql")
|
| 302 | (search-input-directory inputs "include/mysql")))))
|
| 303 | |
| 304 | (replace 'check
|
| 305 | (lambda* (#:key tests? #:allow-other-keys)
|
| 306 | (when tests?
|
| 307 | |
| 308 | |
| 309 | (let ((datadir "/tmp/mysql")
|
| 310 | (socket "/tmp/mysql/mysqld.sock")
|
| 311 | (username "root")
|
| 312 | (password "")
|
| 313 | (database "orthanctest"))
|
| 314 | (invoke "mysqld" "--initialize-insecure"
|
| 315 | (string-append "--datadir=" datadir))
|
| 316 | (spawn "mysqld"
|
| 317 | (list
|
| 318 | "mysqld"
|
| 319 | |
| 320 | "--no-defaults"
|
| 321 | (string-append "--datadir=" datadir)
|
| 322 | (string-append "--socket=" socket)
|
| 323 | |
| 324 | "--max_allowed_packet=32m"))
|
| 325 | (sleep 1)
|
| 326 | (invoke "mysql"
|
| 327 | (string-append "--socket=" socket)
|
| 328 | "-u" username
|
| 329 | "-e" "CREATE DATABASE orthanctest;")
|
| 330 | (invoke "./UnitTests" socket username password
|
| 331 | database))))))))
|
| 332 | (native-inputs
|
| 333 | (list googletest
|
| 334 | python))
|
| 335 | (inputs
|
| 336 | (list boost-1.83
|
| 337 | curl
|
| 338 | jsoncpp
|
| 339 | mysql
|
| 340 | openssl
|
| 341 | orthanc
|
| 342 | protobuf
|
| 343 | unzip
|
| 344 | (list util-linux "lib") |
| 345 | zlib))
|
| 346 | (home-page "https://orthanc-server.com")
|
| 347 | (synopsis "MySQL plugins for Orthanc")
|
| 348 | (description
|
| 349 | "This package provides plugins to use MySQL or MariaDB as the database
|
| 350 | backend of an Orthanc @acronym{DICOM, Digital Imaging and Communications in
|
| 351 | Medicine} server instead of SQLite.")
|
| 352 | (license license:agpl3+))))
|
| 353 |
|
| 354 | |
| 355 | |
| 356 | (define-public orthanc-mariadb
|
| 357 | (package/inherit orthanc-mysql
|
| 358 | (name "orthanc-mariadb")
|
| 359 | (arguments
|
| 360 | (substitute-keyword-arguments arguments
|
| 361 | ((#:phases phases)
|
| 362 | #~(modify-phases #$phases
|
| 363 | (replace 'check
|
| 364 | (lambda* (#:key tests? #:allow-other-keys)
|
| 365 | (when tests?
|
| 366 | |
| 367 | |
| 368 | (let ((datadir "/tmp/mysql")
|
| 369 | (socket "/tmp/mysql/mysqld.sock")
|
| 370 | (username "root")
|
| 371 | (password "")
|
| 372 | (database "orthanctest"))
|
| 373 | (invoke "mariadb-install-db"
|
| 374 | (string-append "--datadir=" datadir)
|
| 375 | "--auth-root-authentication-method=normal")
|
| 376 | (spawn "mysqld"
|
| 377 | (list
|
| 378 | "mysqld"
|
| 379 | |
| 380 | "--no-defaults"
|
| 381 | (string-append "--datadir=" datadir)
|
| 382 | (string-append "--socket=" socket)
|
| 383 | |
| 384 | "--max-allowed-packet=32m"))
|
| 385 | (sleep 1)
|
| 386 | (invoke "mysql"
|
| 387 | (string-append "--socket=" socket)
|
| 388 | "-u" username
|
| 389 | "-e" "CREATE DATABASE orthanctest;")
|
| 390 | (invoke "./UnitTests" socket username password
|
| 391 | database)))))))))
|
| 392 | (native-inputs (modify-inputs native-inputs
|
| 393 | (prepend mariadb))) |
| 394 | (inputs (modify-inputs inputs
|
| 395 | (delete "mysql")
|
| 396 | (prepend `(,mariadb "dev")
|
| 397 | `(,mariadb "lib"))))
|
| 398 | (synopsis "MariaDB plugins for Orthanc")))
|
| 399 |
|
| 400 | (define-public xmedcon
|
| 401 | (package
|
| 402 | (name "xmedcon")
|
| 403 | (version "0.26.1")
|
| 404 | (source
|
| 405 | (origin
|
| 406 | (method git-fetch)
|
| 407 | (uri (git-reference
|
| 408 | (url "git://git.code.sf.net/p/xmedcon/code")
|
| 409 | (commit (string-append "Version-"
|
| 410 | (string-replace-substring version "." "_")))))
|
| 411 | (file-name (git-file-name name version))
|
| 412 | (sha256
|
| 413 | (base32 "0vgq5jckvfjiq22041irzz85dvc986gbynz6dzl240fwy2xxqz6w"))))
|
| 414 | (build-system gnu-build-system)
|
| 415 | (arguments
|
| 416 | (list
|
| 417 | #:configure-flags
|
| 418 | #~(list "--disable-static"
|
| 419 | (string-append "--with-nifti-prefix="
|
| 420 | #$(this-package-input "nifticlib")))))
|
| 421 | (inputs (list glib gtk+ libpng nifticlib))
|
| 422 | (native-inputs (list pkg-config))
|
| 423 | (home-page "https://xmedcon.sourceforge.io")
|
| 424 | (synopsis "Medical image conversion utility")
|
| 425 | (description
|
| 426 | "@acronym{(X)MedCon, Medical Image Conversion} can be used to convert
|
| 427 | between different file formats used in medical imaging. The supported formats
|
| 428 | are @acronym{ACR, American College of Radiology}-@acronym{NEMA, National
|
| 429 | Electrical Manufacturers Association} 2.0, Analyze (@acronym{SPM, Statistical
|
| 430 | Parametric Mapping}), Concorde/μPET, @acronym{DICOM, Digital Imaging and
|
| 431 | Communications in Medicine} 3.0, CTI ECAT 6/7, @acronym{NIfTI, Neuroimaging
|
| 432 | Informatics Technology Initiative}-1, Interfile 3.3, @acronym{PNG, Portable
|
| 433 | Network Graphics}, and @acronym{GIF, Graphics Interchange Format}87a/89a.
|
| 434 | This package includes a command-line utility (@code{medcon}) and a GTK+ based
|
| 435 | GUI application (@code{xmedcon}).")
|
| 436 | (license license:lgpl2.0+)))
|
| 437 |
|
| 438 | (define-public xmedcon-minimal
|
| 439 | (package/inherit xmedcon
|
| 440 | (name "xmedcon-minimal")
|
| 441 | (arguments
|
| 442 | (substitute-keyword-arguments arguments
|
| 443 | ((#:configure-flags flags #~'())
|
| 444 | #~(append (list "--disable-glib" "--disable-gui") #$flags))))
|
| 445 | (inputs (modify-inputs inputs
|
| 446 | (delete "glib" "gtk+")))
|
| 447 | (synopsis "Medical image conversion utility (variant with CLI only)")))
|