Skip to content

Commit 6870a17

Browse files
authored
Fix call to tiffView.open (#230)
* Fix call to tiff view open * add test for tiff dataset mag read * Update test_dataset.py
1 parent 80acf22 commit 6870a17

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

tests/test_dataset.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ def test_open_tiff_dataset():
198198

199199

200200
def test_view_read_with_open():
201-
# This test would be the same for TiffDataset
202201

203202
wk_view = WKDataset("./testdata/simple_wk_dataset/").get_view(
204203
"color", "1", size=(16, 16, 16)
@@ -215,6 +214,16 @@ def test_view_read_with_open():
215214
assert not wk_view._is_opened
216215

217216

217+
def test_tiff_mag_read_with_open():
218+
219+
tiff_dataset = TiffDataset("./testdata/simple_tiff_dataset/")
220+
layer = tiff_dataset.get_layer("color")
221+
mag = layer.get_mag("1")
222+
mag.open()
223+
data = mag.read((10, 10, 10))
224+
assert data.shape == (1, 10, 10, 10) # single channel
225+
226+
218227
def test_view_read_without_open():
219228
# This test would be the same for TiffDataset
220229

wkcuber/api/MagDataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, layer, name):
1818
self.view = self.get_view(is_bounded=False)
1919

2020
def open(self):
21-
self.view.initialize()
21+
self.view.open()
2222

2323
def close(self):
2424
self.view.close()

0 commit comments

Comments
 (0)