auromat.solving.viewasblocks module

auromat.solving.viewasblocks.view_as_blocks(arr_in, block_shape)[source]

Block view of the input n-dimensional array (using re-striding).

Blocks are non-overlapping views of the input array.

This function is the same as skimage.util.shape.view_as_blocks except that it errors if the input error is not c-contiguous.

See:

https://github.com/scikit-image/scikit-image/blob/master/skimage/util/shape.py

Parameters:
  • arr_in (ndarray) – The n-dimensional input array (must be C-contiguous).
  • block_shape (tuple) – The shape of the block. Each dimension must divide evenly into the corresponding dimensions of arr_in.
Return type:

ndarray, block view of the input array.