1{ stdenv
2, lib
3, buildPythonPackage
4, fetchFromGitHub
5, pytestCheckHook
6, pythonOlder
7, deprecated
8, humanize
9, matplotlib
10, nibabel
11, numpy
12, parameterized
13, scipy
14, simpleitk
15, torch
16, tqdm
17, typer
18}:
19
20buildPythonPackage rec {
21 pname = "torchio";
22 version = "0.18.90";
23 format = "pyproject";
24 disabled = pythonOlder "3.7";
25
26 src = fetchFromGitHub {
27 owner = "fepegar";
28 repo = pname;
29 rev = "refs/tags/v${version}";
30 hash = "sha256-h8cvNhOkjMMbQ6Nry8FKtwnK+yhRYRGjXi/xp0i5yyY=";
31 };
32
33 propagatedBuildInputs = [
34 deprecated
35 humanize
36 nibabel
37 numpy
38 scipy
39 simpleitk
40 torch
41 tqdm
42 typer
43 ] ++ typer.passthru.optional-dependencies.all;
44
45 nativeCheckInputs = [ pytestCheckHook matplotlib parameterized ];
46 disabledTests = [
47 # tries to download models:
48 "test_load_all"
49 ] ++ lib.optionals stdenv.isAarch64 [
50 # RuntimeError: DataLoader worker (pid(s) <...>) exited unexpectedly
51 "test_queue_multiprocessing"
52 ];
53 pythonImportsCheck = [
54 "torchio"
55 "torchio.data"
56 ];
57
58 meta = with lib; {
59 description = "Medical imaging toolkit for deep learning";
60 homepage = "http://www.torchio.org/";
61 license = licenses.asl20;
62 maintainers = [ maintainers.bcdarwin ];
63 };
64}