Topology2d

Defines basic 2d discrete topology utils.

extract_neighbourhood(img, x, y)[source]

Return the neighbourhoods of the indicated voxels

Arguments:

img (array): the 2d image x,y (n array): coordinates of the voxels to extract neighbourhoods from

Returns:

array (nx9 array): neighbourhoods

Note:

Assumes borders of the image are zero so that 0<x,y<w,h !

plane_base_2(center=None)[source]

Returns an array with base 2 numbers on the plane for convolution and lut matching

plane_from_index(index, center=None)[source]

Returns a boolean plane for the corresponding index

plane_label(center=None)[source]
plane_to_index(plane, center=None)[source]

Returns index for a boolean cube