cellmap_segmentation_challenge.utils.fetch_data#

Functions

copy_store(*, keys, source_store, dest_store)

Iterate over the keys, copying them from the source store to the dest store

get_array_objects(node[, region])

Get a list of the objects supporting this array.

get_chunk_keys(array[, region])

Get the keys for all the chunks in a Zarr array as a generator of strings.

get_fibsem_path(crop_path)

Get the path to the reconstructed FIB-SEM data used to create the crop.

get_group_objects(node)

get_store_url(store, path)

get_url(node)

partition_copy_store(*, keys, source_store, ...)

read_group(path, **kwargs)

resolve_em_url(em_source_root, em_source_paths)

subset_to_slice(outer_array, inner_array)

cellmap_segmentation_challenge.utils.fetch_data.copy_store(*, keys: Iterable[str], source_store: Store, dest_store: Store)[source]#

Iterate over the keys, copying them from the source store to the dest store

Parameters:
  • keys (Iterable[str])

  • source_store (Store)

  • dest_store (Store)

cellmap_segmentation_challenge.utils.fetch_data.partition_copy_store(*, keys, source_store, dest_store, batch_size, pool: ThreadPoolExecutor, log: BoundLogger | None = None)[source]#
Parameters:
  • pool (ThreadPoolExecutor)

  • log (BoundLogger | None)

cellmap_segmentation_challenge.utils.fetch_data.get_url(node: Group | Array) URL[source]#
Parameters:

node (Group | Array)

Return type:

URL

cellmap_segmentation_challenge.utils.fetch_data.get_store_url(store: BaseStore, path: str)[source]#
Parameters:
  • store (BaseStore)

  • path (str)

cellmap_segmentation_challenge.utils.fetch_data.get_fibsem_path(crop_path: str) str[source]#

Get the path to the reconstructed FIB-SEM data used to create the crop. Returns a uri that resolves to a zarr group

Parameters:

crop_path (str)

Return type:

str

cellmap_segmentation_challenge.utils.fetch_data.get_chunk_keys(array: Array, region: tuple[slice, ...] = ()) Generator[str, None, None][source]#

Get the keys for all the chunks in a Zarr array as a generator of strings. Returns keys relative to the path of the array.

copied with modifications from janelia-cellmap/fibsem-tools

Parameters:
  • array (zarr.core.Array) – The zarr array to get the chunk keys from

  • region (tuple[slice, ...]) – The region in the zarr array get chunks keys from. Defaults to (), which will result in all the chunk keys being returned.

Return type:

Generator[str, None, None]

cellmap_segmentation_challenge.utils.fetch_data.get_array_objects(node: Array, region: tuple[slice, ...] = ()) tuple[str, ...][source]#

Get a list of the objects supporting this array. These objects may or may not exist in storage.

Parameters:
  • node (Array)

  • region (tuple[slice, ...])

Return type:

tuple[str, …]

cellmap_segmentation_challenge.utils.fetch_data.get_group_objects(node: Group) tuple[str, ...][source]#
Parameters:

node (Group)

Return type:

tuple[str, …]

cellmap_segmentation_challenge.utils.fetch_data.read_group(path: str, **kwargs) Group[source]#
Parameters:

path (str)

Return type:

Group

cellmap_segmentation_challenge.utils.fetch_data.subset_to_slice(outer_array, inner_array) tuple[slice, ...][source]#
Return type:

tuple[slice, …]

cellmap_segmentation_challenge.utils.fetch_data.resolve_em_url(em_source_root: URL, em_source_paths: list[str])[source]#
Parameters:
  • em_source_root (URL)

  • em_source_paths (list[str])