diff --git a/src/spikeinterface/core/segmentutils.py b/src/spikeinterface/core/segmentutils.py index b23b7202c6..08583f71c9 100644 --- a/src/spikeinterface/core/segmentutils.py +++ b/src/spikeinterface/core/segmentutils.py @@ -191,16 +191,20 @@ def get_traces(self, start_frame, end_frame, channel_indices): seg_start = self.cumsum_length[i] if i == i0: # first - traces_chunk = rec_seg.get_traces(start_frame - seg_start, None, channel_indices) + end_frame = rec_seg.get_num_samples() + traces_chunk = rec_seg.get_traces(start_frame - seg_start, end_frame, channel_indices) all_traces.append(traces_chunk) elif i == i1: # last if (end_frame - seg_start) > 0: - traces_chunk = rec_seg.get_traces(None, end_frame - seg_start, channel_indices) + start_frame = 0 + traces_chunk = rec_seg.get_traces(start_frame, end_frame - seg_start, channel_indices) all_traces.append(traces_chunk) else: # in between - traces_chunk = rec_seg.get_traces(None, None, channel_indices) + start_frame = 0 + end_frame = rec_seg.get_num_samples() + traces_chunk = rec_seg.get_traces(start_frame, end_frame, channel_indices) all_traces.append(traces_chunk) traces = np.concatenate(all_traces, axis=0) diff --git a/src/spikeinterface/core/tests/test_segmentutils.py b/src/spikeinterface/core/tests/test_segmentutils.py index d3c73805f0..166ecafd09 100644 --- a/src/spikeinterface/core/tests/test_segmentutils.py +++ b/src/spikeinterface/core/tests/test_segmentutils.py @@ -5,10 +5,6 @@ from numpy.testing import assert_raises from spikeinterface.core import ( - AppendSegmentRecording, - AppendSegmentSorting, - ConcatenateSegmentRecording, - ConcatenateSegmentSorting, NumpyRecording, NumpySorting, append_recordings,