Skip to content

← markers package

RemoveIntersectingMarkerSpans

Remove spans of markers that intersect signal boundaries.

This node identifies spans of markers that are delimited by a start marker and a subsequent end marker (e.g., trial_start and trial_end). The node will then check if the signal between those markers has any gaps (e.g., due to packet loss, or artifacts having been removed, for example using the RemoveBadTimeWindows node), and if it finds them, it will remove the start and end markers, and optionally remove some or all in-between markers; see remove_markers property). This can be used to remove all markers for a trial containing a gap ("bad trial"). You can also specify a time offset for the start and/or end markers, where the search for gaps will begin and end. For example, specifying these as -0.5 and 0.2, respectively, will search for gaps within a span that starts 0.5 seconds before the start marker and ends 0.2 seconds after the end marker. A common use case for this is to remove trials with a stimulus and response marker, where the trial length is not fixed but relative to the response marker (i.e., next trial begins immediately after the response marker). One of the main uses of this node is in combination with the Segmentation node: in a case where one segments around multiple places in a trial (e.g., stimulus and response), this will involve two uses of the Segmentation node. However, if the trial contains a gap on only one of the segments (e.g., near the stimulus but not near the response), then only one of the segments gets dropped by the Segmentation node, and one ends up with different numbers of trials in the two pathways. By preceding instead removing the entire trial if it contains any gap anywhere, it can be ensured that the Segmentation nodes will yield the same number of retained trials. This node acts on continuous data, not epoched data, and does not remove any signal data. It simply removes markers which would otherwise be used to segment the data into trials (epochs) using the Segmentation node (usually in combination with AssignTargetValues to identify the markers to segment on). Version 0.6.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

start_marker

Marker that indicates the beginning of a span.

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

end_marker

Marker that indicates the end of a span.

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

remove_markers

List of markers to remove from the span. Use the special symbols $start and $end to refer to those defined above. Use * to refer to any marker. So $start, *, $end will remove all markers in the span including the start and end markers, whereas * will remove all markers in the span but not the start and end markers. $start, $end will only remove the start and end markers and leave the others in the span untouched. You can also list specific markers to remove by marker string (i.e., $start, left, right will remove all markers named left or right in the span to be checked, plus the start_marker.

verbose name
Remove Markers
default value
['$start', '*', '$end']
port type
ListPort
value type
list (can be None)

start_marker_offset

Offset in seconds to add to the start marker, when determining the span to search. This can be a negative number.

verbose name
Start Marker Offset
default value
0.0
port type
FloatPort
value type
float (can be None)

end_marker_offset

Offset in seconds to add to the end marker, when determining the span to search. This can be a negative number.

verbose name
End Marker Offset
default value
0.0
port type
FloatPort
value type
float (can be None)

max_gap_length

Maximum length of time-stamp gaps that are allowed not considered a gap. If a gap between successive samples is larger than this duration in seconds, then any marker whose bounds intersect the gap will be dropped. Optional. Note that if your time stamps are jittered, this will generate a lot of false positives unless you use a very generous cutoff. You can use the DejitterTimestamps node early in the pipeline to remedy that.

verbose name
Max Gap Length
default value
0.2
port type
FloatPort
value type
float (can be None)

cumulative_gap_length

Cumulative gap length that is allowed. If the sum of all gaps between successive samples is larger than this duration in seconds, then any marker whose bounds intersect the gap will be dropped. Set at zero or empty to ignore. Note that this will subtract the expected time difference between samples based on the sampling rate, when calculating the total gap. Note that max_gap_length and cumulative_gap_length are not mutually exclusive.

verbose name
Cumulative Gap Length
default value
0.0
port type
FloatPort
value type
float (can be None)

remove_other_markers

Remove any other markers that lie within the affected segments.

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

handle_missing

How to handle missing markers, that is, if the start_marker or end_marker is not found in the data. Ignore will silently pass the data through unchanged. Warn will pass the data through unchanged with a warning. Raise will raise an exception.

verbose name
Handle Missing
default value
raise
port type
EnumPort
value type
str (can be None)

verbose

Print information about the markers removed.

verbose name
Verbose
default value
False
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)