'Use the position and orientation of this ROI relative to an imageItem
to pull a slice from an array.
**Arguments**
data                The array to slice from. Note that this array does
*not* have to be the same data that is represented
in *img*.
img                 (ImageItem or other suitable QGraphicsItem)
Used to determine the relationship between the
ROI and the boundaries of *data*.
axes                (length-2 tuple) Specifies the axes in *data* that
correspond to the (x, y) axes of *img*. If the
image\'s axis order is set to
\'row-major\', then the axes are instead specified in
(y, x) order.
returnMappedCoords  (bool) If True, the array slice is returned along
with a corresponding array of coordinates that were
used to extract data from the original array.
\**kwds             All keyword arguments are passed to
:func:`affineSlice <pyqtgraph.affineSlice>`.
This method uses :func:`affineSlice <pyqtgraph.affineSlice>` to generate
the slice from *data* and uses :func:`getAffineSliceParams <pyqtgraph.ROI.getAffineSliceParams>`
to determine the parameters to pass to :func:`affineSlice <pyqtgraph.affineSlice>`.
If *returnMappedCoords* is True, then the method returns a tuple (result, coords)
such that coords is the set of coordinates used to interpolate values from the original
data, mapped into the parent coordinate system of the image. This is useful, when slicing
data from images that have been transformed, for determining the location of each value
in the sliced data.
All extra keyword arguments are passed to :func:`affineSlice <pyqtgraph.affineSlice>`.'

def getArrayRegion(self, data, img, axes=(0, 1), returnMappedCoords=False, **kwds):

    fromBR = kwds.pop('fromBoundingRect', False)
    (shape, vectors, origin) = self.getAffineSliceParams(data, img, axes, fromBoundingRect=fromBR)
    if (not returnMappedCoords):
        rgn = fn.affineSlice(data, shape=shape, vectors=vectors, origin=origin, axes=axes, **kwds)
        return rgn
    else:
        kwds['returnCoords'] = True
        (result, coords) = fn.affineSlice(data, shape=shape, vectors=vectors, origin=origin, axes=axes, **kwds)
        mapped = fn.transformCoordinates(img.transform(), coords)
        return (result, mapped)
