RemoveIntersectingMarkers¶
Remove markers whose neighborhoods intersect gaps in the data and/or specified other markers.
This node can be useful when segments are extracted relative to event markers, and some of these segments may intersect these gaps. The Segmentation node will then drop any segments that cross gaps (since all segments emitted by it must have the same length, i.e., number of samples), and therefore the number of segments retained will be lower than the number of event markers to begin with. For a single Segmentation run this works fine, but if one uses multiple Segmentation operations in parallel with different segment lengths, then one may end up with different numbers of trials in the resulting data. This can be a problem if you then wish to concatenate the segments. This node can be used to prevent that case, since it removes any markers where the surrounding time bounds interset gaps in the data (i.e., as a result of cleaning the data using BadTimeWindowRemoval or because there were breaks in the original signal. Then Segmentation runs are guaranteed to produce the same number of segments. Typically you would want to use AssignTargetValues before this node, and then only those markers that have been assigned a target value will be considered for removal, since Segmentation will only act on those markers (all other event markers will be ignored). Otherwise, all markers will be checked for removal using the specified time bounds. In some cases you also want to remove all markers that fall within the time segment of a marker having a TargetValue that is removed. This is useful if you will be segmenting separately on different markers and want to ensure that markers belonging to the same trial or epoch (i.e., a stim and response marker) are both removed if one is removed. In such a case, you would assign target values to the stim markers, set the time bounds in this node to the full length of the trial/epoch, and set the remove_non_targets flag to True. This will ensure that if a stim marker is removed its corresponding response marker, if any, or any other markers in the trial, will also be removed. You can then assign target values to the (remaining) response markers and segment on the stim and response markers separately and they will be guaranteed to match up.
Version 1.1.1
Ports/Properties¶
data¶
Data to process.
- verbose name: Data
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: INOUT
time_bounds¶
Time limits around the markers that are checked for intersection with gaps, in seconds. The first number is the start time of the range relative to each marker, and the second number is the end time of the range. If any of these numbers is negative, it means that the time point lies this many seconds before the marker, while positive numbers mean that the point lies after the marker. So a range of [-2,2] means that any markers that are within 2 seconds of a marker will be dropped from the data, along with the marker itself, if there are gaps in the signal data within that time range. Important: if you use AssignTargets before this node, then only markers with an assigned target will be considered. To drop all markers that fall within this scope relative to markers with an assigned target value, set remove_non_targets to True.
- verbose name: Marker Safety Bounds
- default value: [-1, 2]
- port type: ListPort
- value type: list (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 during your processing to fix that.
- verbose name: Max Gap Length
- default value: 0.2
- port type: FloatPort
- value type: float (can be None)
remove_non_targets¶
If False, only markers that have been assigned a TargetValue will be considered for removal. If True, all markers which fall within the specified time bounds of a marker having a TargetValue, will be removed if the TargetValue marker is removed (i.e., in the event the latter intersects with a time gap).
- verbose name: Remove Non Targets
- default value: False
- port type: BoolPort
- value type: bool (can be None)
sample_offset¶
Optional additional shift of the bounds position, in samples. This setting allows to shift all bounds by this many samples relative to the marker, which can be used to match the behavior of other systems (e.g., BCILAB or EEGLAB) in a sample-exact fashion. Same as in the Segmentation node.
- verbose name: Additional Sample Offset
- default value: 0
- port type: IntPort
- value type: int (can be None)
avoid_markers¶
List of markers to avoid. Markers are removed whose neighborhoods cross any of these markers to avoid. Wildcards may be used.
- verbose name: Avoid Markers
- default value: None
- port type: ListPort
- value type: list (can be None)
verbose¶
If True, print out additional information about the markers that are 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)