Skip to content

← neural package

ReplaceThresholdedData

Replace samples in the signal data with NaN where the value of a provided measure for that same time point and channel has a value above (or below) a specified threshold.

A common use case is to flag time samples as "bad" (by replacing the signal value with NaN), where the impedance value for that time point at that channel exceeds a specified threshold. You should normally follow this node with the ChannelRepair node to replace the NaNs with interpolated data, as downstream nodes may not be able to handle NaNs. This node expects a single stream of signal data with space and time axes. (Marker streams are ignored and passed through.) The packet providing the measure to threshold must contain a single stream and be the same data shape as the incoming data packet. Its space and time axes must be identical to the incoming data packet, and any other axes must be singletons, except that if the measure packet has a singleton time axis, then all values along that axis in the data packet will be replaced with NaN for the corresponding channels where the measure value is above (or below) the threshold. Version 0.9.0

Ports/Properties

data

Data to process.

verbose name
Data
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
INOUT

measure

Per-channel data containing the measure to compare against the threshold, i.e ., impedance values. This packet must have only one stream with space and time axes that are identical to the incoming data packet.

verbose name
Measure
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
IN

threshold

Threshold value to compare against the measure. If the measure for a given channel is above (or below; see direction property) the threshold, the corresponding sample for that channel and that time point is replaced with NaN.

verbose name
Threshold
default value
None
port type
FloatPort
value type
float (can be None)

direction

Direction of the thresholding. (Above means values above the threshold will be replaced, and vice-versa for below.)

verbose name
Direction
default value
above
port type
EnumPort
value type
str (can be None)

replace_with

Value to replace the data with when the threshold is exceeded.

verbose name
Replace With
default value
nan
port type
EnumPort
value type
str (can be None)

data_stream

Name of the stream in the incoming data packet containing the data to modify. If empty, the first signal stream in the packet is used (event streams are ignored). Wildcards are supported, i.e. mystream* will select the first stream whose name starts with mystream.

verbose name
Data Stream
default value
port type
StringPort
value type
str (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)