How to use the braindecode.datautil.trial_segment.add_breaks function in braindecode

To help you get started, we’ve selected a few braindecode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TNTLFreiburg / braindecode / test / unit_tests / datautil / test_trial_segment.py View on Github external
events,
        fs,
        break_start_code,
        break_stop_code,
        name_to_start_codes,
        name_to_stop_codes,
        min_break_length_ms,
        max_break_length_ms,
        break_start_offset_ms,
        break_stop_offset_ms,
        expected_events,
        ):
    events = np.array(events)
    name_to_start_codes = OrderedDict(name_to_start_codes)
    name_to_stop_codes = OrderedDict(name_to_stop_codes)
    events_with_breaks = add_breaks(
        events, fs, break_start_code, break_stop_code, name_to_start_codes,
        name_to_stop_codes, min_break_length_ms=min_break_length_ms,
        max_break_length_ms=max_break_length_ms,
        break_start_offset_ms=break_start_offset_ms, break_stop_offset_ms=break_stop_offset_ms)
    np.testing.assert_array_equal(events_with_breaks,
                                 expected_events)