elephant.asset.asset.synchronous_events_difference

elephant.asset.asset.synchronous_events_difference(sse1, sse2, difference='linkwise')[source]

Given two sequences of synchronous events (SSEs) sse1 and sse2, each consisting of a pool of pixel positions and associated synchronous events (see below), computes the difference between sse1 and sse2.

The difference can be performed ‘pixelwise’ or ‘linkwise’:

  • if ‘pixelwise’, it yields a new SSE which contains all (and only) the events in sse1 whose pixel position doesn’t match any pixel in sse2.

  • if ‘linkwise’, for each pixel (i, j) in sse1 and corresponding synchronous event S1, if (i, j) is a pixel in sse2 corresponding to the event S2, it retains the set difference S1 - S2. If (i, j) is not a pixel in sse2, it retains the full set S1.

Note that in either case the difference is a non-symmetric operation: intersection(sse1, sse2) != intersection(sse2, sse1).

Both sse1 and sse2 must be provided as dictionaries of the type

{(i1, j1): S1, (i2, j2): S2, …, (iK, jK): SK},

where each i, j is an integer and each S is a set of neuron IDs.

Parameters:
sse1, sse2dict

Dictionaries of pixel positions (i, j) as keys and sets S of synchronous events as values (see above).

difference{‘pixelwise’, ‘linkwise’}, optional

The type of difference to perform between sse1 and sse2 (see above). Default: ‘linkwise’

Returns:
sse_newdict

A new SSE (same structure as sse1 and sse2) which retains the difference between sse1 and sse2.

See also

ASSET.extract_synchronous_events

extract SSEs from given spike trains