Reading scenes
import networkx as nx
from ome_zarr import OMEZarrScene
scene = OMEZarrScene.from_ome_zarr("https://radosgw.public.os.wwu.de/s2v/P2A_B6_M2.ome.zarr")
---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
Cell In[2], line 1
----> 1 scene = OMEZarrScene.from_ome_zarr("https://radosgw.public.os.wwu.de/s2v/P2A_B6_M2.ome.zarr")
File ~/checkouts/readthedocs.org/user_builds/ome-zarr/envs/stable/lib/python3.12/site-packages/ome_zarr/classes/scene.py:323, in OMEZarrScene.from_ome_zarr(cls, store)
321 if tf.output is not None:
322 path = tf.output.path
--> 323 if path is not None and path in zarr_group:
324 img_group = zarr_group[path]
325 img = cast(
326 OMEZarrMultiscale, OMEZarrMultiscale.from_ome_zarr(img_group)
327 )
File ~/checkouts/readthedocs.org/user_builds/ome-zarr/envs/stable/lib/python3.12/site-packages/zarr/core/group.py:2342, in Group.__contains__(self, member)
2326 def __contains__(self, member: str) -> bool:
2327 """Test for group membership.
2328
2329 Examples
(...) 2340 False
2341 """
-> 2342 return self._sync(self._async_group.contains(member))
File ~/checkouts/readthedocs.org/user_builds/ome-zarr/envs/stable/lib/python3.12/site-packages/zarr/core/sync.py:199, in SyncMixin._sync(self, coroutine)
196 def _sync[T](self, coroutine: Coroutine[Any, Any, T]) -> T:
197 # TODO: refactor this to take *args and **kwargs and pass those to the method
198 # this should allow us to better type the sync wrapper
--> 199 return sync(
200 coroutine,
201 timeout=config.get("async.timeout"),
202 )
File ~/checkouts/readthedocs.org/user_builds/ome-zarr/envs/stable/lib/python3.12/site-packages/zarr/core/sync.py:147, in sync(coro, loop, timeout)
143 pass
145 future = asyncio.run_coroutine_threadsafe(_runner(coro), loop)
--> 147 finished, unfinished = wait([future], return_when=asyncio.ALL_COMPLETED, timeout=timeout)
148 if len(unfinished) > 0:
149 raise TimeoutError(f"Coroutine {coro} failed to finish within {timeout} s")
File ~/.asdf/installs/python/3.12.13/lib/python3.12/concurrent/futures/_base.py:305, in wait(fs, timeout, return_when)
301 return DoneAndNotDoneFutures(done, not_done)
303 waiter = _create_and_install_waiters(fs, return_when)
--> 305 waiter.event.wait(timeout)
306 for f in fs:
307 with f._condition:
File ~/.asdf/installs/python/3.12.13/lib/python3.12/threading.py:655, in Event.wait(self, timeout)
653 signaled = self._flag
654 if not signaled:
--> 655 signaled = self._cond.wait(timeout)
656 return signaled
File ~/.asdf/installs/python/3.12.13/lib/python3.12/threading.py:355, in Condition.wait(self, timeout)
353 try: # restore state no matter what (e.g., KeyboardInterrupt)
354 if timeout is None:
--> 355 waiter.acquire()
356 gotit = True
357 else:
KeyboardInterrupt:
This step requires matplotlib
nx.draw(scene._graph.graph, with_labels=True)