Hi again!
I was trying to compute a visual ERP but I was not able to do so:
It is a neuroscan file:
First I imported the continous file (with "review raw" function), actually it worked and the file was imported but with no events, I don't know why
Then I tried to import the averaged file (avg) but I got this error message:
** Error: Line 49: Index exceeds matrix dimensions.
**
** Call stack:
** >in_fread_avg.m at 49
** >in_fread.m at 167
** >in_data.m at 298
** >import_data.m at 200
** >bst_call.m at 28
** >tree_callbacks.m>@(h,ev)bst_call(@import_data,[],[],[],iStudy,iSubject) at 638
I share here the VEP raw file (vep events are 254 and 253):
First I imported the continous file (with "review raw" function), actually it worked and the file was imported but with no events, I don't know why
There is something weird in this file, maybe there was an error while it was saved.
The field "numevents" is set to zero, while there are events defined in the file...
I added a hack to the reading function to bypass the test (numevents>0) so that events could be read in this case. I hope this is not going to break anything else... IO: Neuroscan .cnt: Allow reading events when numevents=0 · brainstorm-tools/brainstorm3@852c6b8 · GitHub
Where did this file come from?
Can you see the events when opening with the Neuroscan software? Or with any other software?
Then I tried to import the averaged file (avg) but I got this error message:
You hit another blind spot in the Neuroscan reading functions. This .avg file is weirdly defined, as the pre-stimulus baseline (time before the stim) is not a round number of samples. In other terms, there are two samples at t=-2ms and one at t=2ms, but no recordings at t=0ms (at 250Hz, the sampling period is 4ms). I realized that this special case can't be handled in Brainstorm...
I fixed the reader so that it rounds to the closest sample, therefore the first sample won't be displayed as being -50ms (as defined in the .avg header) but as -52ms, so that we have a sample at t=0ms.
Update Brainstorm to get both fixes and try again opening your files.
Yes, Maybe it is, Now I imported the cnt file and it worked, and it shows the events, I guess you're right and this eeg file was not properly saved (or registered by neuroscan software) since it was made with an old neuroscan software version, so if the impromevent you made to BS to importing this file could damage anything, you may want to roll it back (is not an essential file)
I tried importing another neuroscan files and everything went fine
It worked!! now I was able to import the file, Thank you!