LaplacianKernel

LaplacianKernel#

class braintools.conn.LaplacianKernel(kernel_type='4-connected', kernel_size=1.0, weight=None, delay=None, **kwargs)#

Laplacian kernel for edge detection connectivity.

Implements Laplacian operators for detecting discontinuities and edges, useful for lateral inhibition and edge enhancement.

Parameters:
  • kernel_type (str) – Type of Laplacian (‘4-connected’, ‘8-connected’).

  • kernel_size (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Physical size of the kernel in position units.

  • weight (Initialization | float | int | ndarray | Array | Quantity | None) – Weight initialization (Laplacian values are multiplied by this).

  • delay (Initialization | float | int | ndarray | Array | Quantity | None) – Delay initialization.

Examples

>>> positions = np.random.uniform(0, 1000, (500, 2)) * u.um
>>> laplacian = LaplacianKernel(
...     kernel_type='4-connected',
...     kernel_size=60 * u.um,
...     weight=1.0 * u.nS
... )
>>> result = laplacian(
...     pre_size=500, post_size=500,
...     pre_positions=positions, post_positions=positions
... )
generate(**kwargs)[source]#

Generate Laplacian kernel connections.

Return type:

ConnectionResult