skimage 0.17.2

NotesParametersReturnsBackRef
window(window_type, shape, warp_kwargs=None)

Notes

This function is based on scipy.signal.get_window and thus can access all of the window types available to that function (e.g., "hann" , "boxcar" ). Note that certain window types require parameters that have to be supplied with the window name as a tuple (e.g., ("tukey", 0.8) ). If only a float is supplied, it is interpreted as the beta parameter of the Kaiser window.

See https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.windows.get_window.html for more details.

Note that this function generates a double precision array of the specified shape and can thus generate very large arrays that consume a large amount of available memory.

The approach taken here to create nD windows is to first calculate the Euclidean distance from the center of the intended nD window to each position in the array. That distance is used to sample, with interpolation, from a 1D window returned from scipy.signal.get_window . The method of interpolation can be changed with the order keyword argument passed to skimage.transform.warp .

Some coordinates in the output window will be outside of the original signal; these will be filled in with zeros.

Window types: - boxcar - triang - blackman - hamming - hann - bartlett - flattop - parzen - bohman - blackmanharris - nuttall - barthann - kaiser (needs beta) - gaussian (needs standard deviation) - general_gaussian (needs power, width) - slepian (needs width) - dpss (needs normalized half-bandwidth) - chebwin (needs attenuation) - exponential (needs decay scale) - tukey (needs taper fraction)

Parameters

window_type : string, float, or tuple

The type of window to be created. Any window type supported by scipy.signal.get_window is allowed here. See notes below for a current list, or the SciPy documentation for the version of SciPy on your machine.

shape : tuple of int or int

The shape of the window along each axis. If an integer is provided, a 1D window is generated.

warp_kwargs : dict

Keyword arguments passed to skimage.transform.warp (e.g., warp_kwargs={'order':3} to change interpolation method).

Returns

nd_window : ndarray

A window of the specified shape . dtype is np.double .

Return an n-dimensional window of a given size and dimensionality.

Examples

Return a Hann window with shape (512, 512):

This example is valid syntax, but we were not able to check execution
>>> from skimage.filters import window
... w = window('hann', (512, 512))

Return a Kaiser window with beta parameter of 16 and shape (256, 256, 35):

This example is valid syntax, but we were not able to check execution
>>> w = window(16, (256, 256, 35))

Return a Tukey window with an alpha parameter of 0.8 and shape (100, 300):

This example is valid syntax, but we were not able to check execution
>>> w = window(('tukey', 0.8), (100, 300))
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.filters._window.window

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/filters/_window.py#8
type: <class 'function'>
Commit: