[FieldTrip] Inconsistent Error Opening bdf Files

Xavier Vrijdag x.vrijdag at auckland.ac.nz
Wed Oct 13 22:40:40 CEST 2021


Hello David,

Your code is suggesting that your data is stored on a network drive. Could the error you mention be due to network connectivity issue? You can try to have the data stored locally. I use a biosemi system as well, and have not encountered this issue.

Regards,

Xavier

Xavier Vrijdag, MSc

Research fellow
Department of Anaesthesiology │ School of Medicine
Faculty of Medical & Health Sciences │ The University of Auckland
Private Bag 92019 │ Auckland 1142 │ New Zealand

M +64 21 0230 4558
E x.vrijdag at auckland.ac.nz<mailto:x.vrijdag at auckland.ac.nz>

[FMHS Logo]




From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of David Prete via fieldtrip <fieldtrip at science.ru.nl>
Reply to: FieldTrip discussion list <fieldtrip at science.ru.nl>
Date: Thursday, 14 October 2021 at 3:57 AM
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Cc: David Prete <preted at mcmaster.ca>
Subject: [FieldTrip] Inconsistent Error Opening bdf Files

Hello Everyone,

I keep running into an error trying to open up biosemi bdf data. The error is copied below. However this error is very inconsistent, so I can get the error, then run the code again changing nothing and not get the error.  This seems to be the case with multiple bdf dataset so it it’s that one is corrupted or something. Does anyone know what might be causing this inconsistent error and how I can avoid it?

HERE IS THE CODE THAT RESULTS IN THE ERROR:
  datadir = '\\trainorserv.mcmaster.ca\trainorlab\David_Prete\Predicatble_Omissions\EEG\<http://\\trainorserv.mcmaster.ca\trainorlab\David_Prete\Predicatble_Omissions\EEG\>';
  savedir ='D:\Desktop\Predictable_omissions\Preproc\';
  if ~exist(savedir,'dir'); mkdir(savedir); end

  addpath('D:\David\MATLAB\fieldtrip-20170625\fieldtrip-20170625\');
  load('D:\Desktop\Predictable_omissions\Predictable_Oissions_stim\all_trigs.mat');
  ft_defaults

  layoutFile = 'D:\David\MATLAB\fieldtrip-20170625\fieldtrip-20170625\template\layout\biosemi64.lay';

  cfg = [];
  cfg.method = 'distance';
  cfg.neighbordist = 4;
  cfg.layout = layoutFile;
  neighbours = ft_prepare_neighbours(cfg);

  files                    = dir([datadir,'*.bdf']);
  allData_comps = cell(length(files),1);

  for s = 1:length(files)

      disp('--------------------------------')
      disp(['Preprocessing: ', num2str(s)])
      disp('--------------------------------')

  %Getting the file name of the EEG data
  %loading the data into fieldtrip
  disp('Loading data...')
      fileName = strcat(files(s).folder,'\',files(s).name);
      cfg = [];
      cfg.dataset = fileName;
      data = ft_preprocessing(cfg);

HERE IS THE ERROR MESSAGE:
  Warning OPENEDF: Failing Digital Minimum
  Warning OPENEDF: Failing Digital Maximum
  Warning OPENEDF: Failing Physical Minimum
  Warning OPENEDF: Failing Physical Maximum
  FileStream::DetectCharset():fread failed: error : Invalid argument for \\trainorserv.mcmaster.ca\trainorlab\David_Prete\Predicatble_Omissions\EEG\part_03b_pilot.bdf<http://\\trainorserv.mcmaster.ca\trainorlab\David_Prete\Predicatble_Omissions\EEG\part_03b_pilot.bdf>
  Index exceeds the number of array
  elements (0).

  Error in read_biosemi_bdf (line 185)
      if EDF.Chan_Select(k)

  Error in ft_read_header (line 388)
      hdr = read_biosemi_bdf(filename);

  Error in ft_preprocessing (line 396)
    hdr = ft_read_header(cfg.headerfile,
   'headerformat', cfg.headerformat,
    'coordsys', cfg.coordsys,
    'coilaccuracy', cfg.coilaccuracy,
    'checkmaxfilter',
    istrue(cfg.checkmaxfilter));


Thank you,
David Prete
Ph.D. Candidate
Auditory Development Lab
McMaster Institute for Music and the Mind
McMaster University


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20211013/4235670a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 22258 bytes
Desc: image001.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20211013/4235670a/attachment.png>


More information about the fieldtrip mailing list