Skip to content

Commit

Permalink
simplify glob imread
Browse files Browse the repository at this point in the history
  • Loading branch information
akhanf committed Apr 7, 2024
1 parent a0af5d6 commit 58ea591
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions workflow/scripts/stitched_tif_to_zarr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import tifffile
from glob import glob
import dask.array as da
import dask.array.image
Expand All @@ -10,18 +9,10 @@

in_tif_glob = snakemake.params.in_tif_glob.format(stain=snakemake.wildcards.stain)

tif_paths = sorted(glob(in_tif_glob))

zslices=[]
for tif_path in tif_paths[:5]:

print(tif_path)
zslices.append(dask.array.image.imread(tif_path, imread=tifffile.imread))
darr = dask.array.image.imread(in_tif_glob)


darr = da.stack(zslices,axis=1)
darr = da.squeeze(darr)

#rescale intensities, and recast -- only recast
#darr = darr * snakemake.params.intensity_rescaling
darr = darr.astype('uint16')
Expand Down

0 comments on commit 58ea591

Please sign in to comment.