[FieldTrip] error using ft_read_header func

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Wed Jul 1 17:12:01 CEST 2020


Dear Johannes,

Welcome to the community! I am not so familiar with this fileformat, but looking in the code it seems that this is a genuine bug. I am wondering whether this has ever worked at all.

Long story short, in reading the header, it seems, as per line 177 in read_neuralynx_ncs, that both begrecord AND endrecord need to be defined as 0. However, in ft_read_header, line 1762, read_neuralynx_ncs is called with 1 and 0 as input arguments, rather than (what I would expect) 0 and 0. Perhaps other people might chime in here to confirm, particularly those who are reading along and who work with this fileformat themselves, but I would say that this is incorrect.

Could you try in your own code, to change the ‘1’ on line 1762 in ft_read_header into a ‘0’, and confirm that reading in of the header information then works for you?

If so, then feel free to make a PR on github for this. I know it’s a silly change, which I could easily do myself, but in the spirit of ‘we’re all in it together’ I don’t want to take the opportunity away from you :).

Of course I am just kidding, but also partly serious: if you make the suggested change in a pull request, then this improvement of the codebase will be forever in www-space associated with you (and who knows what the effect of this will be on your professional career, and on the grand scheme of things). This last remark is just a gentle nudge to everybody who is reading along. Oh, and did I already raise the argument that a medical degree does not forbid you to write code?


Best wishes,

Jan-Mathijs

J.M.Schoffelen, MD PhD
Associate PI, VIDI-fellow - PI, language in interaction
Telephone: +31-24-3614793
Physical location: room 00.028
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands


On 1 Jul 2020, at 16:23, Lang, Johannes <Johannes.Lang at uk-erlangen.de<mailto:Johannes.Lang at uk-erlangen.de>> wrote:

Dear all,

I’m new to the community and keep running into an error using the ft_read_header function.

The way I understood the documentation

hdr = ft_read_header(‘filename’)

should read the header information into an array.
However, I keep running into an error

Error using read_neuralynx_ncs (line 182)
cannot read beyond the last record

Error in ft_read_header (line 1762)
    ncs = read_neuralynx_ncs(filename, 1, 0);

Not sure why this is. Has anyone had the same issue before?
Thanks in advance.

Kind regards,

Johannes Lang

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200701/38e29a0f/attachment.htm>


More information about the fieldtrip mailing list