-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
If you have a zarr sink and create an image one sample at a time, when we expand the array to accommodate a larger number of samples, the array fails to behave as expected.
Here is an example of the error:
import large_image
import numpy as np
sink = large_image.new()
for band in range(0, 10, 1):
data = np.zeros((2000, 2000))
data.fill(band)
sink.addTile(data, s=band)
sink.write('test1.tiff')
sink = large_image.new()
for band in range(9, -1, -1):
data = np.zeros((2000, 2000))
data.fill(band)
sink.addTile(data, s=band)
sink.write('test2.tiff')
ts1 = large_image.open('test1.tiff')
print(ts1.getRegion(format='numpy')[0][100, 100, 8])
# WRONG: prints np.uint8(0)
ts2 = large_image.open('test2.tiff')
print(ts2.getRegion(format='numpy')[0][100, 100, 8])
# RIGHT: prints np.uint8(8)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels