sccn / bva-io

Routines for loading and saving data files in Brain Vision Data Exchange format (export and import of Brain Vision Analyzer MATLAB files developed by Arnaud Delorme)
23 stars 11 forks source link

Issue with event markers #11

Closed arnodelorme closed 4 years ago

arnodelorme commented 4 years ago

Description I'm attempting to import a .vhdr file produced by Brain Vision Analyzer 2. The process fails with error:

EEGLAB error in function parsebvmrk() at line 40:

Operands to || and && operators must be convertible to logical scalar values.

Steps to Reproduce The data I'm using is from https://osf.io/rmuje/. I can upload one of the files but they're quite big (49,000 K).

Outside EEGLab:

1, Download the EEG1 file from OSF

  1. Unzip the file
  2. Go to .\EEG1\EEG1\35\export
  3. Remove the "_" symbols from between "Pulse" and "Artifact" and "Correction" (I think this might be due to WinRAR adding them?)

Inside EEGLAB:

File > Import data > .. > From Brain Vis Rec vhdr file Select the vhdr file from .\EEG1\EEG1\35\export Click OK (I've tried changing the interval and channels, but same error) Error Expected behavior: The data should load.

Actual behavior: It doesn't load.

arnodelorme commented 4 years ago

@jbernard-McMaster submitted this issue. I have downloaded the dataset and followed instructions above. Seems like starting at event 194, the events values are badly formated with more output values than the parsemrkr.m function can handle.


Error in strread (line 52)
    [varargout{1:nlhs}]=dataread('string',varargin{:}); %#ok<REMFF1>

 MRK.markerinfos(190:200,:)

ans =

  11×2 cell array

    {'SyncStatus,Sync On,32246,1,0'    }    {[190]}
    {'Pulse Artifact,R,32378,1,32'     }    {[191]}
    {'Scanner,Scanner Start,32393,1,29'}    {[192]}
    {'Scanner,Scan Start,32393,1,0'    }    {[193]}
    {'Scanner,s ,32393,1,0,,false'     }    {[194]}
    {'Scanner,s ,32411,1,0,,false'     }    {[195]}
    {'Scanner,s ,32429,1,0,,false'     }    {[196]}
    {'Scanner,s ,32447,1,0,,false'     }    {[197]}
    {'Scanner,s ,32465,1,0,,false'     }    {[198]}
    {'Scanner,s ,32483,1,0,,false'     }    {[199]}
    {'Scanner,s ,32501,1,0,,false'     }    {[200]}
arnodelorme commented 4 years ago

@widmann what do you think?

widmann commented 4 years ago

Sorry, the EEG1 file is too big to be downloaded here. Please provide a reasonably sized sample file.

Thanks, Andreas

jbernard-McMaster commented 4 years ago

I cannot. It isn't my data so I have no control over it. Sorry. :(

widmann commented 4 years ago

It is sufficient to send one affected vmrk file as attachment by pm. Thanks!

jbernard-McMaster commented 4 years ago

I sent it. :)

widmann commented 4 years ago

Could you please try the attached version of parsebvmrk.m (just replace in the bva-io plugin directory). parsebvmrk.m.zip

jbernard-McMaster commented 4 years ago

Nice! Works perfectly. :) Thanks!

widmann commented 4 years ago

Fixed in commit 2ef2805. Thanks for reporting.

Best, Andreas