mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
114 lines
1.9 KiB
Nix
114 lines
1.9 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
|
|
# build-system
|
|
uv-build,
|
|
|
|
# dependencies
|
|
deprecated,
|
|
einops,
|
|
humanize,
|
|
jaxtyping,
|
|
nibabel,
|
|
numpy,
|
|
packaging,
|
|
rich,
|
|
scipy,
|
|
simpleitk,
|
|
torch,
|
|
tqdm,
|
|
typer,
|
|
|
|
# optional dependencies
|
|
colorcet,
|
|
matplotlib,
|
|
monai,
|
|
pandas,
|
|
ffmpeg-python,
|
|
scikit-learn,
|
|
|
|
# tests
|
|
parameterized,
|
|
pytestCheckHook,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "torchio";
|
|
version = "1.2.1";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "TorchIO-project";
|
|
repo = "torchio";
|
|
tag = "v${version}";
|
|
hash = "sha256-v9mAtwyglY5PsszrIzGSZJ+eEK3ED3v0slai7Vz9WjA=";
|
|
};
|
|
|
|
build-system = [
|
|
uv-build
|
|
];
|
|
|
|
dependencies = [
|
|
deprecated
|
|
einops
|
|
humanize
|
|
jaxtyping
|
|
nibabel
|
|
numpy
|
|
packaging
|
|
rich
|
|
scipy
|
|
simpleitk
|
|
torch
|
|
tqdm
|
|
typer
|
|
];
|
|
|
|
optional-dependencies =
|
|
let
|
|
extras = {
|
|
csv = [ pandas ];
|
|
monai = [ monai ];
|
|
plot = [
|
|
colorcet
|
|
matplotlib
|
|
];
|
|
video = [ ffmpeg-python ];
|
|
sklearn = [ scikit-learn ];
|
|
};
|
|
in
|
|
extras // { all = lib.concatLists (lib.attrValues extras); };
|
|
|
|
nativeCheckInputs = [
|
|
matplotlib
|
|
parameterized
|
|
pytestCheckHook
|
|
]
|
|
++ optional-dependencies.monai
|
|
++ optional-dependencies.sklearn;
|
|
|
|
disabledTests = [
|
|
# tries to download models:
|
|
"test_load_all"
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isAarch64 [
|
|
# RuntimeError: DataLoader worker (pid(s) <...>) exited unexpectedly
|
|
"test_queue_multiprocessing"
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"torchio"
|
|
"torchio.data"
|
|
];
|
|
|
|
meta = {
|
|
description = "Medical imaging toolkit for deep learning";
|
|
homepage = "https://docs.torchio.org";
|
|
changelog = "https://github.com/TorchIO-project/torchio/releases/tag/${src.tag}";
|
|
license = lib.licenses.asl20;
|
|
maintainers = [ lib.maintainers.bcdarwin ];
|
|
};
|
|
}
|