- remove all readers but bioformats

- open folder with sequence
This commit is contained in:
Wim Pomp
2025-02-19 21:28:59 +01:00
parent 2247a994be
commit 87e9715f97
15 changed files with 266 additions and 1407 deletions

View File

@@ -1,27 +1,21 @@
import pickle
from multiprocessing import active_children
from pathlib import Path
import pytest
from ndbioimage import Imread, ReaderNotFoundError
from ndbioimage import Imread
@pytest.mark.parametrize('file', (Path(__file__).parent / 'files').iterdir())
@pytest.mark.parametrize('file',
[file for file in (Path(__file__).parent / 'files').iterdir() if not file.suffix == '.pzl'])
def test_open(file):
try:
with Imread(file) as im:
mean = im[dict(c=0, z=0, t=0)].mean()
b = pickle.dumps(im)
jm = pickle.loads(b)
assert jm[dict(c=0, z=0, t=0)].mean() == mean
v = im.view()
assert v[dict(c=0, z=0, t=0)].mean() == mean
b = pickle.dumps(v)
w = pickle.loads(b)
assert w[dict(c=0, z=0, t=0)].mean() == mean
except ReaderNotFoundError:
assert len(Imread.__subclasses__()), 'No subclasses for Imread found.'
for child in active_children():
child.kill()
with Imread(file) as im:
mean = im[dict(c=0, z=0, t=0)].mean()
b = pickle.dumps(im)
jm = pickle.loads(b)
assert jm[dict(c=0, z=0, t=0)].mean() == mean
v = im.view()
assert v[dict(c=0, z=0, t=0)].mean() == mean
b = pickle.dumps(v)
w = pickle.loads(b)
assert w[dict(c=0, z=0, t=0)].mean() == mean