tensorstore.TensorStore.__getitem__(self, domain: IndexDomain) TensorStore

Computes a virtual view using an explicit index domain.

The domain of the resultant view is computed as in IndexDomain.__getitem__(domain).

Example

>>> dataset = await ts.open(
...     {
...         'driver': 'n5',
...         'kvstore': {
...             'driver': 'memory'
...         }
...     },
...     dtype=ts.uint32,
...     domain=ts.IndexDomain(shape=[60, 70, 80], labels=['x', 'y', 'z']),
...     create=True)
>>> domain = ts.IndexDomain(labels=['x', 'z'],
...                         inclusive_min=[5, 6],
...                         exclusive_max=[8, 9])
>>> dataset[domain]
TensorStore({
  'context': {
    'cache_pool': {},
    'data_copy_concurrency': {},
    'memory_key_value_store': {},
  },
  'driver': 'n5',
  'dtype': 'uint32',
  'kvstore': {'driver': 'memory'},
  'metadata': {
    'axes': ['x', 'y', 'z'],
    'blockSize': [60, 70, 80],
    'compression': {
      'blocksize': 0,
      'clevel': 5,
      'cname': 'lz4',
      'shuffle': 1,
      'type': 'blosc',
    },
    'dataType': 'uint32',
    'dimensions': [60, 70, 80],
  },
  'transform': {
    'input_exclusive_max': [8, [70], 9],
    'input_inclusive_min': [5, 0, 6],
    'input_labels': ['x', 'y', 'z'],
  },
})
Parameters:
domain: IndexDomain

Index domain, must have dimension labels that can be aligned to self.domain.

Returns:

Virtual view with domain equal to self.domain[domain].