SobelKernel

SobelKernel#

class braintools.conn.SobelKernel(direction='horizontal', kernel_size=1.0, weight=None, delay=None, **kwargs)#

Sobel edge detection kernel for orientation-selective connectivity.

Implements Sobel operators for detecting edges at specific orientations, useful for implementing orientation-selective connectivity patterns.

Parameters:
  • direction (str) – Direction of edge detection (‘horizontal’, ‘vertical’, ‘both’).

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

  • weight (Initialization | float | int | ndarray | Array | Quantity | None) – Weight initialization (Sobel 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
>>> sobel = SobelKernel(
...     direction='horizontal',
...     kernel_size=60 * u.um,
...     weight=1.0 * u.nS
... )
>>> result = sobel(
...     pre_size=500, post_size=500,
...     pre_positions=positions, post_positions=positions
... )
generate(**kwargs)[source]#

Generate Sobel kernel connections.

Return type:

ConnectionResult