Exporting a Time Selection to the Workspace

When in the “RAW” “Link to raw file” viewing of data, I left-click and drag to select a window of interest (or manually enter a desired selection), then right-click, “Time Selection”, “Export to Matlab” to send the segment to the workspace.

Very nice interface, except that something is happening to the exported segment. Some of the channels have lost energy, and the data are now rank-deficient in the singular value spectrum. I have not yet been able to reverse engineer what is different about the data. I have the filters unchecked (“off”).

If I “import in database” the same raw segment, then export this imported segment to the workspace, then no problems.

Are you apply some sort of resampling or filtering to the exported segment in the raw reviewer, and if so, can we get an unfiltered sample instead? I’m using the raw reviewer to locate interesting spikes, then transfer the spike directly to the workspace for further processing.

Hi John,

Indeed, there is more than just the frequency filters that are applied on the segments of recordings read from the continuous files:

  • EEG average reference (uncheck the button in the toolbar of the main window)
  • All the channel that are not displayed in the figure are set to ZERO
  • The baseline is removed from each sensor based on the entire time segment that is currently loaded (if you change the number of samples you display on each page, the DC value removed is probably going to change slightly). You can disable this feature in the “Display” menu of the “Event” tab.
  • The SSPs available for this file are also applied by default. You can disable them in the “Display” menu of the “Event” tab too.

If you really want to be sure of what you get in output, you’d better use the “Import to database” menu.
But I’d be interested to know why you get different results if you unselect all those menus, and consider only the sensors displayed in your figure.
Let me know if you find out what happens.

Francois

Perfect solution, all better now, thank-you, Francois. I did not realize the “display” options were operating on the transferred data. It was the SSP operators remaining in my data set, which I did not want. Now I get perfect agreement between both exported versions.

I notice that the “Time Selection”, “Export to Matlab” brings in the data as a cell array of 1 in F, while “Import to Database” brings in F as a simple matrix. Any reason for the cell array version of the data? I have switches in my algorithm to handle the two different styles.

I notice that the "Time Selection", "Export to Matlab" brings in the data as a cell array of 1 in F, while "Import to Database" brings in F as a simple matrix. Any reason for the cell array version of the data? I have switches in my algorithm to handle the two different styles.

Yes, there is a reason for that. When exporting data from a figure, it creates a type of structure that is more generic but less informative that than the recordings (brainstorm files named "timeseries_..." instead of "data_..."). It actually represents the figure, not the block of recordings, and can handle displays that are more complex than just a 2D matrix, like a figure with 4x4 graphs representing scouts times series for different conditions, with legends and titles.

The cell array that you see in F represents a set of graphs, not one single matrix. If you had three graphs in your figure, your F variable would be a 1x3 cell array, each cell containing the time series in each graph.

Francois

Thanks! I consider this issue now closed, no actions on your part, just understandings on mine!