Segment Information when Generating EDFs

Hello!

I wanted to know how Brainstorm decides to split its EDF files. Where is it getting that information to split the EEG into separate EDF files? This would be useful to know because it would allow me to find a way to generate one full EDF file instead of multiple EDF files. The main question is, how is the EDF being generated? What information is it using when it produces an EDF? Can I change this information so that it can produce only one EDF? I have a feeling that Brainstorm is reading information from the EEG file about how it should segment everything. Thank you and have a nice day!

-Shmyrde Jean-Paul

Hi Shmyrde,

The number of EDF files exported should be the same as the number of files you are trying to export. You seem to be saying that a single EEG file is exported in multiple EDF files, which should not be the case. Can you describe the file you are trying to export and provide a screenshot of the object in the Brainstorm database?

If it's a raw file, perhaps it is saved in multiple blocks which is why Brainstorm outputs multiple files, one per block. You can get around this by fully importing the raw file in the Brainstorm database (which should show up as a single non-raw data object), and then properly export it as a single file.

If it's a group of files/trials/blocks in the Brainstorm database, you can concatenate them first using our Standardize -> Concatenate time/signal processes before exporting it as a single file.

Cheers,
Martin

1 Like

Sorry, I didn't ask the question well enough. I meant to ask, why does the EEG split into segments when I read it in using Brainstorm? Is there a way to just read it and have one segment? Not multiple? How are you determining the segments in an eeg file?

Thanks,
Shmyrde Jean-Paul

I am afraid I don't fully understand what you are asking. I have provided you two ways to ensure both your raw and imported files are saved in a single segment, and therefore can be read and exported as such. Do you mean that Brainstorm sometimes processes a data file by blocks? This is to avoid memory issues for files that are so big they would not fit in memory. You can increase your block size in your Brainstorm preferences (File -> Edit preferences). By default, it is 100 megabytes.

Sorry if I again misunderstood you, perhaps include a screen capture to clarify what you are asking?

Martin

It's fine, I'm not asking the right question. Here's a screenshot:


My question is, how do you determine how to split up the EEG into these segments? You notice how there are seven segments? Are you receiving these instructions from the EEG file? I also use Nicolet's software which generates 7 edf files when I export the exact EEG. So i'm starting to believe the EEG file is instructing the software how to segment it. Am I wrong? Since both Brainstorm and Nicolet produced 7 Edfs for the same EEG file, that must mean they both operate the same way? That's why I'm trying to understand how Brainstorm segments the EEG file. I want to modify the original EEG file so that when I import it into brainstorm it'll be one segment not seven. So I need to learn how Brainstorm is making this decision.

Oh, I see, so you are working with Nicolet files. The segment splitting is specific to this format, hence my confusion. We are using an external function to read them in Brainstorm so we have limited support and understanding of this format. I believe the original repository for this function is the following if you want to ask the creators a question: https://github.com/ieeg-portal/Nicolet-Reader

One thing I can add by looking at their code is that the Nicolet files seem already segmented. Therefore, the arbitrary number of 7 segments in your case is most likely decided at the level of the acquisition system.

I hope this helps,
Martin

1 Like

The Nicolet file format supports breaks in the recordings, and it is common to see files with several discontinuous blocks of recordings in the same file. Your 7 blocks in your file correspond most likely to 7 discontinuous pieces of recordings that are saved in the same file. In the Nicolet software, you should be able to observer these cuts, with short or long gaps in the time axis.

EDF is a file format that does not support these discontinuities (or more precisely it does, but not well, and it's better to avoid it). The Brainstorm database does not support imported files with multiple segments. In the Brainstorm data files, the time must be continuous.
This is why your file get splitted automatically: just to match the limitations of the destination file format.

1 Like