From b1208ade0c860da6c85c4ec8ba54601bc2be2741 Mon Sep 17 00:00:00 2001 From: Nicolas Kaenzig Date: Tue, 26 Nov 2024 14:49:07 +0100 Subject: [PATCH] relax nibabel requirement --- pdm.lock | 18 +++++++++--------- pyproject.toml | 4 ++-- src/eva/vision/utils/io/nifti.py | 1 - 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pdm.lock b/pdm.lock index 715edb26..21faa341 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "all", "dev", "docs", "lint", "test", "typecheck", "vision"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:b5c2458a99d34522d02e8dd5b927023597d07f13187f69e65da1edd43e6ac4d0" +content_hash = "sha256:b8df35bf60e5573e36c31c4ad4f324d7693f16b31cadcd27e48b352ae6c0235b" [[metadata.targets]] requires_python = ">=3.10" @@ -1405,18 +1405,18 @@ files = [ [[package]] name = "nibabel" -version = "5.2.1" -requires_python = ">=3.8" +version = "4.0.2" +requires_python = ">=3.7" summary = "Access a multitude of neuroimaging data formats" groups = ["all", "vision"] dependencies = [ - "importlib-resources>=1.3; python_version < \"3.9\"", - "numpy>=1.20", - "packaging>=17", + "numpy>=1.17", + "packaging>=17.0", + "setuptools", ] files = [ - {file = "nibabel-5.2.1-py3-none-any.whl", hash = "sha256:2cbbc22985f7f9d39d050df47249771dfb8d48447f5e7a993177e4cabfe047f0"}, - {file = "nibabel-5.2.1.tar.gz", hash = "sha256:b6c80b2e728e4bc2b65f1142d9b8d2287a9102a8bf8477e115ef0d8334559975"}, + {file = "nibabel-4.0.2-py3-none-any.whl", hash = "sha256:c4fe76348aa865f8300beaaf2a69d31624964c861853ef80c06e33d5f244413c"}, + {file = "nibabel-4.0.2.tar.gz", hash = "sha256:45c49b5349351b45f6c045a91aa02b4f0d367686ff3284632ef95ac65b930786"}, ] [[package]] @@ -2465,7 +2465,7 @@ name = "setuptools" version = "75.1.0" requires_python = ">=3.8" summary = "Easily download, build, install, upgrade, and uninstall Python packages" -groups = ["default", "dev", "docs"] +groups = ["default", "all", "dev", "docs", "vision"] files = [ {file = "setuptools-75.1.0-py3-none-any.whl", hash = "sha256:35ab7fd3bcd95e6b7fd704e4a1539513edad446c097797f2985e0e4b960772f2"}, {file = "setuptools-75.1.0.tar.gz", hash = "sha256:d59a21b17a275fb872a9c3dae73963160ae079f1049ed956880cd7c09b120538"}, diff --git a/pyproject.toml b/pyproject.toml index e93d0ab3..d1ba0d1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ file = "LICENSE" [project.optional-dependencies] vision = [ "h5py>=3.10.0", - "nibabel>=5.2.0", + "nibabel>=4.0.1", "opencv-python-headless>=4.9.0.80", "timm>=1.0.9", "torchvision>=0.17.0", @@ -72,7 +72,7 @@ vision = [ ] all = [ "h5py>=3.10.0", - "nibabel>=5.2.0", + "nibabel>=4.0.1", "opencv-python-headless>=4.9.0.80", "timm>=1.0.9", "torchvision>=0.17.0", diff --git a/src/eva/vision/utils/io/nifti.py b/src/eva/vision/utils/io/nifti.py index e90f919d..49ca8fda 100644 --- a/src/eva/vision/utils/io/nifti.py +++ b/src/eva/vision/utils/io/nifti.py @@ -54,7 +54,6 @@ def save_array_as_nifti( dtype: The data type to save the image. """ nifti_image = nib.Nifti1Image(array, affine=np.eye(4), dtype=dtype) # type: ignore - nifti_image.header.get_xyzt_units() nifti_image.to_filename(filename)