python-neo icon indicating copy to clipboard operation
python-neo copied to clipboard

Meaning of the "Block" and "Segment" objects.

Open lakesare opened this issue 1 year ago • 2 comments

In what case are there multiple blocks per the reader object? What does it mean semantically when blocks = reader.read() contains more than one Block object?

lakesare avatar Aug 22 '22 15:08 lakesare

In almost all cases a reader will only return one block. However, certain IO modules (I forget which ones) can in principle store more than one block in a file.

Neo deliberately attaches minimal semantics to the data structures, so a Block can represent whatever a user wishes; however in general a Block is used to represent data from one recording session.

apdavison avatar Aug 23 '22 08:08 apdavison

Thank you! I have a similar question about Segments - what are the conditions for multiple AnalogSignals to be put into the same Segment? What's meant by a "common clock/time basis"?

lakesare avatar Aug 23 '22 20:08 lakesare

Having a common clock / time basis within a segment means that timestamps of objects in that segment (spiketrains, analogsignals) have the same reference time. E.g. you might have a recording that is interrupted after 5 minutes and the interruption leads to a reset of the clock of the recording system. In that case you would end up with two segments, both starting at time 0. Here you can compare the data recorded between spiketrains and analogsignals within one segment, but the timestamps of spiketrains of different segments have a fix (and maybe unknown) time offset.

JuliaSprenger avatar Nov 01 '22 13:11 JuliaSprenger