- OmeCache: detect changes in ome.xml
This commit is contained in:
4
.github/workflows/pytest.yml
vendored
4
.github/workflows/pytest.yml
vendored
@@ -10,9 +10,9 @@ jobs:
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -24,7 +24,7 @@ pip install ndbioimage
|
||||
```
|
||||
import matplotlib.pyplot as plt
|
||||
from ndbioimage import Imread
|
||||
with Imread('image_file.tif', axes='ctxy', dtype=int) as im:
|
||||
with Imread('image_file.tif', axes='ctyx', dtype=int) as im:
|
||||
plt.imshow(im[2, 1])
|
||||
```
|
||||
|
||||
@@ -41,7 +41,7 @@ with Imread('image_file.tif') as im:
|
||||
|
||||
```
|
||||
from ndbioimage import Imread
|
||||
with Imread('image_file.tif', axes='cztxy') as im:
|
||||
with Imread('image_file.tif', axes='cztyx') as im:
|
||||
sliced_im = im[1, :, :, 100:200, 100:200]
|
||||
```
|
||||
|
||||
@@ -53,7 +53,7 @@ sliced_im is an instance of Imread which will load any image data from file only
|
||||
```
|
||||
from ndbioimage import Imread
|
||||
import numpy as np
|
||||
with Imread('image_file.tif', axes='cztxy') as im:
|
||||
with Imread('image_file.tif', axes='cztyx') as im:
|
||||
array = np.asarray(im[0, 0])
|
||||
```
|
||||
|
||||
|
||||
@@ -159,9 +159,10 @@ class OmeCache(DequeDict):
|
||||
return super().__contains__(self.path_and_lstat(path))
|
||||
|
||||
@staticmethod
|
||||
def path_and_lstat(path: str | Path) -> tuple[Path, Optional[os.stat_result]]:
|
||||
def path_and_lstat(path: str | Path) -> tuple[Path, Optional[os.stat_result], Optional[os.stat_result]]:
|
||||
path = Path(path)
|
||||
return path, (path.lstat() if path.exists() else None)
|
||||
return (path, (path.lstat() if path.exists() else None),
|
||||
(path.with_suffix('.ome.xml').lstat() if path.with_suffix('.ome.xml').exists() else None))
|
||||
|
||||
|
||||
class Imread(np.lib.mixins.NDArrayOperatorsMixin, ABC):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "ndbioimage"
|
||||
version = "2024.4.3"
|
||||
version = "2024.4.4"
|
||||
description = "Bio image reading, metadata and some affine registration."
|
||||
authors = ["W. Pomp <w.pomp@nki.nl>"]
|
||||
license = "GPLv3"
|
||||
|
||||
Reference in New Issue
Block a user