{ } Raw JSON

bundles / skimage latest / skimage / util / arraycrop / crop

function

skimage.util.arraycrop:crop

source: /dev/scikit-image/src/skimage/util/arraycrop.py :12

Signature

def   crop ( ar crop_width copy = False order = K )

Summary

Crop array ar by crop_width along each dimension.

Parameters

ar : array_like, of rank N

Input array.

crop_width : int or Sequence

Number of values to remove from the edges of each axis. ((before_1, after_1), ... (before_N, after_N)) specifies unique crop widths at the start and end of each axis. ((before, after),) or (before, after) specifies a fixed start and end crop for every axis. (n,) or n for integer n is a shortcut for before = after = n for all axes.

copy : bool, optional

If True, ensure the returned array is a contiguous copy. Normally, a crop operation will return a discontiguous view of the underlying input array.

order : {'C', 'F', 'A', 'K'}, optional

If copy==True, control the memory layout of the copy. See np.copy.

Returns

cropped : array

The cropped array. If copy=False (default), this is a sliced view of the input array.

Aliases

  • skimage.util.crop