parse_array_slices_Nd#
- parse_array_slices_Nd(key: tuple | slice, extent: Box, dims: int = 3, h_dim: int = -3, w_dim: int = -2) tuple[rastervision.core.box.Box, list[Any | None]] [source]#
Parse multi-dim array-indexing inputs into a Box and slices.
- Parameters:
- Raises:
NotImplementedError – If not (1 <= dims <= 3).
TypeError – If key is not a slice or tuple.
IndexError – if not (1 <= len(key) <= dims).
TypeError – If the index for any of the dims is None.
ValueError – If more than one Ellipsis (”…”) in the input.
ValueError – If h and w indices (first 2 dims) are not slices.
NotImplementedError – If input contains negative values.
- Returns:
- A Box representing the h and w slices and a list
containing slices/index-values for all the dims.
- Return type: