slmsuite.holography.toolbox.window_slice#
- window_slice(window, shape=None, centered=False, circular=False)[source]#
Parses the slices that describe the window’s view into the larger array.
- Parameters:
window ((int, int, int, int) OR (array_like, array_like) OR array_like) –
A number of formats are accepted:
List in
(x, w, y, h)format, wherewandhare the width and height of the region and(x,y)is the upper-left coordinate.If
centered, then(x,y)is instead the center of the region to imprint.If
circular, then an elliptical region circumscribed by the rectangular region is returned.
Tuple containing arrays of identical length corresponding to y and x indices.
centeredandcircularare ignored.Boolean array of same
shapeasmatrix; the window is defined whereTruepixels are.centeredandcircularare ignored.
shape ((int, int) OR None) – The (height, width) of the array that the window is a view into. If not
None, indices beyond those allowed byshapewill be clipped.centered (bool) – See
window.circular (bool) – See
window.
- Returns:
slice_ – The slice for the window.
- Return type:
(slice, slice) OR (array_like, array_like) OR (array_like)