1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6 pytestCheckHook,
7 pythonRelaxDepsHook,
8 matplotlib,
9 nibabel,
10 numpy,
11 pydicom,
12 pymedio,
13 scikit-fuzzy,
14 scikit-image,
15 scikit-learn,
16 scipy,
17 simpleitk,
18 statsmodels,
19}:
20
21buildPythonPackage rec {
22 pname = "intensity-normalization";
23 version = "2.2.4";
24 format = "setuptools";
25
26 disabled = pythonOlder "3.6";
27
28 src = fetchPypi {
29 pname = "intensity_normalization";
30 inherit version;
31 hash = "sha256-s/trDIRoqLFj3NO+iv3E+AEB4grBAHDlEL6+TCdsgmg=";
32 };
33
34 postPatch = ''
35 substituteInPlace setup.cfg --replace "!=3.10.*," "" --replace "!=3.11.*" ""
36 substituteInPlace setup.cfg --replace "pytest-runner" ""
37 '';
38
39 nativeBuildInputs = [ pythonRelaxDepsHook ];
40 pythonRelaxDeps = [ "nibabel" ];
41
42 propagatedBuildInputs = [
43 matplotlib
44 nibabel
45 numpy
46 pydicom
47 pymedio
48 scikit-fuzzy
49 scikit-image
50 scikit-learn
51 scipy
52 simpleitk
53 statsmodels
54 ];
55
56 nativeCheckInputs = [ pytestCheckHook ];
57 pytestFlagsArray = [ "tests" ];
58
59 pythonImportsCheck = [
60 "intensity_normalization"
61 "intensity_normalization.normalize"
62 "intensity_normalization.plot"
63 "intensity_normalization.util"
64 ];
65
66 meta = with lib; {
67 homepage = "https://github.com/jcreinhold/intensity-normalization";
68 description = "MRI intensity normalization tools";
69 maintainers = with maintainers; [ bcdarwin ];
70 license = licenses.asl20;
71 };
72}