User-defined keywords of getArrayRegion (#1416)
The three parameters "shape, vectors, origin" can't be passed as parameters because they are computed, which raise an error when kwds is passed to affineSlice.
This commit is contained in:
parent
7d2fbe7596
commit
ae4522109e
@ -1162,7 +1162,14 @@ class ROI(GraphicsObject):
|
|||||||
# this is a hidden argument for internal use
|
# this is a hidden argument for internal use
|
||||||
fromBR = kwds.pop('fromBoundingRect', False)
|
fromBR = kwds.pop('fromBoundingRect', False)
|
||||||
|
|
||||||
shape, vectors, origin = self.getAffineSliceParams(data, img, axes, fromBoundingRect=fromBR)
|
# Automaticaly compute missing parameters
|
||||||
|
_shape, _vectors, _origin = self.getAffineSliceParams(data, img, axes, fromBoundingRect=fromBR)
|
||||||
|
|
||||||
|
# Replace them with user defined parameters if defined
|
||||||
|
shape = kwds.pop('shape', _shape)
|
||||||
|
vectors = kwds.pop('vectors', _vectors)
|
||||||
|
origin = kwds.pop('origin', _origin)
|
||||||
|
|
||||||
if not returnMappedCoords:
|
if not returnMappedCoords:
|
||||||
rgn = fn.affineSlice(data, shape=shape, vectors=vectors, origin=origin, axes=axes, **kwds)
|
rgn = fn.affineSlice(data, shape=shape, vectors=vectors, origin=origin, axes=axes, **kwds)
|
||||||
return rgn
|
return rgn
|
||||||
|
Loading…
Reference in New Issue
Block a user