Skip to content

Commit

Permalink
Group all imread functions together in the same file (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
GenevieveBuckley committed Mar 14, 2023
1 parent 69989c7 commit 96f2795
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
9 changes: 6 additions & 3 deletions dask_image/imread/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import pims
from tifffile import natural_sorted

from . import _utils


def imread(fname, nframes=1, *, arraytype="numpy"):
"""
Expand Down Expand Up @@ -98,4 +96,9 @@ def _map_read_frame(x, multiple_files, block_info=None, **kwargs):
else:
i, j = block_info[None]['array-location'][0]

return _utils._read_frame(fn=fn, i=slice(i, j), **kwargs)
return _read_frame(fn=fn, i=slice(i, j), **kwargs)


def _read_frame(fn, i, *, arrayfunc=np.asanyarray):
with pims.open(fn) as imgs:
return arrayfunc(imgs[i])
8 changes: 0 additions & 8 deletions dask_image/imread/_utils.py

This file was deleted.

0 comments on commit 96f2795

Please sign in to comment.