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","."]
code: def reindex(cls, dataset, kdims=None, vdims=None):
      data = dataset.data
      dropped_kdims = [kd for kd in dataset.kdims if kd not in kdims]
      constant = {}
      for kd in dropped_kdims:
          vals = cls.values(dataset, kd.name, expanded=False)
          if len(vals) == 1:
              constant[kd.name] = vals[0]
      if dropped_kdims or constant:
          return tuple(dataset.columns(kdims + vdims).values())
  
      if (
          vdims is not None
          and vdims != dataset.vdims
          and len(dataset.vdims) > 1
      ):
          inds = [
              dataset.get_dimension_index(vd) - dataset.ndims
              for vd in vdims
          ]
          return (
              data[..., inds] if len(inds) > 1 else data[..., inds[0]]
          )
      return 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 8 for calling the ImageInterface obj's underlying member method code with example usage: obj.reindex(cls, dataset, kdims, vdims) and returns: data, tuple, unknown