class_docstr: Interface for 2 or 3D arrays representing images
  of raw luminance values, RGB values or HSV values.
class_docstr_tok: ["Interface","for","2","or","3D","arrays","representing","images","of","raw","luminance","values",",","RGB","values","or","HSV","values","."]
docstr: Slice the underlying numpy array in sheet coordinates.
docstr_tok: ["Slice","the","underlying","numpy","array","in","sheet","coordinates","."]
code: def select(cls, dataset, selection_mask=None, **selection):
      """
      Slice the underlying numpy array in sheet coordinates.
      """
      selection = {
          k: slice(*sel) if isinstance(sel, tuple) else sel
          for k, sel in selection.items()
      }
      coords = tuple(
          selection[kd.name] if kd.name in selection else slice(None)
          for kd in dataset.kdims
      )
      if not any([isinstance(el, slice) for el in coords]):
          return dataset.data[dataset.sheet2matrixidx(*coords)]
  
      # Apply slices
      xidx, yidx = coords
      l, b, r, t = dataset.bounds.lbrt()
      if isinstance(xidx, slice):
          l = l if xidx.start is None else max(l, xidx.start)
          r = r if xidx.stop is None else min(r, xidx.stop)
      if isinstance(yidx, slice):
          b = b if yidx.start is None else max(b, yidx.start)
          t = t if yidx.stop is None else min(t, yidx.stop)
      bounds = BoundingBox(points=((l, b), (r, t)))
      slc = Slice(bounds, dataset)
      return slc.submatrix(dataset.data)
  
imports: import numpy
  from ..None import util
  from ..boundingregion import BoundingBox
  from ..dimension import dimension_name
  from ..element import Element
  from ..ndmapping import NdMapping, item_check
  from ..sheetcoords import SheetCoordinateSystem, Slice
  from .grid import GridInterface
  from .interface import DataError, Interface
  from .util import finite_range
label_desc: Use image node_id 13 for calling the ImageInterface obj's underlying member method code with example usage: obj.select(cls, dataset, selection_mask) and returns: slc, dataset