parse_array_slices#

parse_array_slices(key: Union[tuple, slice], extent: Box, dims: int = 2) Tuple[Box, List[Optional[Any]]][source]#

Parse multi-dim array-indexing inputs into a Box and slices.

Parameters
  • key (Union[tuple, slice]) – Input to __getitem__.

  • extent (Box) – Extent of the raster/label source being indexed.

  • dims (int, optional) – Total available indexable dims. Defaults to 2.

Raises
Returns

A Box representing the h and w slices and a list

containing slices/index-values for all the dims.

Return type

Tuple[Box, list]