medpy.iterators.patchwise.SlidingWindowIterator.applyslicer

SlidingWindowIterator.applyslicer(array, slicer, cval=None)[source]

Apply a slicer returned by the iterator to a new array of the same dimensionality as the one used to initialize the iterator.

Parameters:

array : array_like

A n-dimensional array.

slicer : list

List if slice() instances as returned by next().

cval : number

Value to fill undefined positions. If None, the cval of the object is used.

Returns:

patch: ndarray

A patch from the input array.

Notes

If array has more dimensions than slicer and pmask, the first ones are sliced.