class_docstr: Raster is a basic 2D element type for presenting either numpy or
  dask arrays as two dimensional raster images.
  
  Arrays with a shape of (N,M) are valid inputs for Raster whereas
  subclasses of Raster (e.g. RGB) may also accept 3D arrays
  containing channel information.
  
  Raster does not support slicing like the Image or RGB subclasses
  and the extents are in matrix coordinates if not explicitly
  specified.
class_docstr_tok: ["Raster","is","a","basic","2D","element","type","for","presenting","either","numpy","or","dask","arrays","as","two","dimensional","raster","images",".","Arrays","with","a","shape","of","(","N",",","M",")","are","valid","inputs","for","Raster","whereas","subclasses","of","Raster","(","e.g",".","RGB",")","may","also","accept","3D","arrays","containing","channel","information",".","Raster","does","not","support","slicing","like","the","Image","or","RGB","subclasses","and","the","extents","are","in","matrix","coordinates","if","not","explicitly","specified","."]
code: def __getitem__(self, slices):
      if slices in self.dimensions():
          return self.dimension_values(slices)
      slices = util.process_ellipses(self, slices)
      if not isinstance(slices, tuple):
          slices = (slices, slice(None))
      elif len(slices) > (2 + self.depth):
          raise KeyError(
              "Can only slice %d dimensions" % 2 + self.depth
          )
      elif len(slices) == 3 and slices[-1] not in [
          self.vdims[0].name,
          slice(None),
      ]:
          raise KeyError(
              f"{self.vdims[0].name!r} is the only selectable value dimension"
          )
  
      slc_types = [isinstance(sl, slice) for sl in slices[:2]]
      data = self.data.__getitem__(slices[:2][::-1])
      if all(slc_types):
          return self.clone(data, extents=None)
      elif not any(slc_types):
          return data
      else:
          return self.clone(
              np.expand_dims(data, axis=slc_types.index(True)),
              extents=None,
          )
  
imports: import colorsys
  from copy import deepcopy
  from operator import itemgetter
  import numpy
  import param
  from ..core import Dataset, Dimension, Element2D, Overlay, config, util
  from ..core.boundingregion import BoundingBox, BoundingRegion
  from ..core.data import ImageInterface
  from ..core.data.interface import DataError
  from ..core.dimension import dimension_name
  from ..core.sheetcoords import SheetCoordinateSystem, Slice
  from .chart import Curve
  from .geom import Selection2DExpr
  from .graphs import TriMesh
  from .tabular import Table
  from .util import categorical_aggregate2d, compute_slice_bounds
label_desc: Use image node_id 2 for calling the Raster obj's underlying member method code with example usage: obj.__getitem__(slices) and returns: self, self, data, self