Skip to content

← utilities package

CountAlongAxis

Returns the number of items contained in an axis.

Can be used, for example, to return the number of trials or time points in the data. This can also be used to count the number of events in a marker stream. Note that this will return None if there is no matching stream. Version 1.2.0

Ports/Properties

data

Data to process.

verbose name
Data
default value
None
port type
DataPort
value type
AnyNumeric (can be None)
data direction
IN

num_items

Number of items in the given axis

verbose name
Num Items
default value
None
port type
DataPort
value type
int (can be None)
data direction
OUT

axis

Axis along which to count. Select the space axis for channels, instance axis for trials or segments, time for the number of time points, feature for the number of features in the stream, frequency for the number of frequencies, etc. You can also enter the axis label here as in feature.mylabel to further narrow down along which axis to count if there are multiple of the same type. If the incoming data is a plain array instead of a packet, or you know the order of axes, you can also pass an integer as the index of the target axis. The default value will resolves to the 0th axis in a plain array.

verbose name
Axis
default value
instance
port type
ComboPort
value type
str (can be None)

stream

The name of the stream on which to operate. If unspecified, first stream containing the specified axis will be counted. Wildcard characters (? *) are allowed for pattern matching, i.e., mystream* will match all streams that start with mystream.

verbose name
Stream
default value
port type
StringPort
value type
str (can be None)

stream_name

verbose name
Stream Name
default value
None
port type
AliasPort
value type
str (can be None)

allow_markers

If True and axis='instance' this will count the number of event markers if the first matching stream is an event stream.

verbose name
Allow Markers
default value
True
port type
BoolPort
value type
bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)