at master 1.7 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 7 # build-system 8 uv-build, 9 10 # dependencies 11 deprecated, 12 einops, 13 humanize, 14 nibabel, 15 numpy, 16 packaging, 17 rich, 18 scipy, 19 simpleitk, 20 torch, 21 tqdm, 22 typer, 23 24 # optional dependencies 25 colorcet, 26 matplotlib, 27 pandas, 28 ffmpeg-python, 29 scikit-learn, 30 31 # tests 32 parameterized, 33 pytestCheckHook, 34}: 35 36buildPythonPackage rec { 37 pname = "torchio"; 38 version = "0.20.22"; 39 pyproject = true; 40 41 src = fetchFromGitHub { 42 owner = "TorchIO-project"; 43 repo = "torchio"; 44 tag = "v${version}"; 45 hash = "sha256-LP0hlle8BCoZrJWs5aX/xvI+EPHdOGBARoKwQRqswQc="; 46 }; 47 48 build-system = [ 49 uv-build 50 ]; 51 52 dependencies = [ 53 deprecated 54 einops 55 humanize 56 nibabel 57 numpy 58 packaging 59 rich 60 scipy 61 simpleitk 62 torch 63 tqdm 64 typer 65 ]; 66 67 optional-dependencies = { 68 csv = [ pandas ]; 69 plot = [ 70 colorcet 71 matplotlib 72 ]; 73 video = [ ffmpeg-python ]; 74 sklearn = [ scikit-learn ]; 75 }; 76 77 nativeCheckInputs = [ 78 matplotlib 79 parameterized 80 pytestCheckHook 81 ]; 82 83 disabledTests = [ 84 # tries to download models: 85 "test_load_all" 86 ] 87 ++ lib.optionals stdenv.hostPlatform.isAarch64 [ 88 # RuntimeError: DataLoader worker (pid(s) <...>) exited unexpectedly 89 "test_queue_multiprocessing" 90 ]; 91 92 pythonImportsCheck = [ 93 "torchio" 94 "torchio.data" 95 ]; 96 97 meta = { 98 description = "Medical imaging toolkit for deep learning"; 99 homepage = "https://docs.torchio.org"; 100 changelog = "https://github.com/TorchIO-project/torchio/blob/${src.tag}/CHANGELOG.md"; 101 license = lib.licenses.asl20; 102 maintainers = [ lib.maintainers.bcdarwin ]; 103 }; 104}