1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, pytestCheckHook
6, cryptography
7, nibabel
8, numpy
9, pydicom
10, simpleitk
11}:
12
13buildPythonPackage rec {
14 pname = "pymedio";
15 version = "0.2.13";
16 disabled = pythonOlder "3.9";
17
18 src = fetchFromGitHub {
19 owner = "jcreinhold";
20 repo = "pymedio";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-iHbClOrtYkHT1Nar+5j/ig4Krya8LdQdFB4Mmm5B9bg=";
23 };
24
25 # relax Python dep to work with 3.10.x and 3.11.x
26 postPatch = ''
27 substituteInPlace setup.cfg --replace "!=3.10.*," "" --replace "!=3.11.*" ""
28 '';
29
30 propagatedBuildInputs = [ numpy ];
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 cryptography
35 nibabel
36 pydicom
37 simpleitk
38 ];
39
40 pythonImportsCheck = [
41 "pymedio"
42 ];
43
44 meta = with lib; {
45 description = "Read medical image files into Numpy arrays";
46 homepage = "https://github.com/jcreinhold/pymedio";
47 license = licenses.mit;
48 maintainers = with maintainers; [ bcdarwin ];
49 };
50}