[FieldTrip] Bug in ft_trialfun_brainvision_segmented.m

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Fri Mar 17 13:45:16 CET 2017


Thanks for your input, Daniel.

May I suggest you to follow this up through github?

http://www.fieldtriptoolbox.org/development/git

The best thing for you to do would be to make a Pull Request with the suggested changes.

Thanks, and keep up the good work,

Jan_Mathijs




> On 17 Mar 2017, at 13:35, Daniel Matthes <dmatthes at cbs.mpg.de> wrote:
> 
> Hi fieldtrip developers,
> 
> I found a bug in fieldtrip/trialfun/ft_trialfun_brainvision_segmented.m. If the Brain Vision marker file *.vmrk includes no 'Stimulus' makers, the ft_trialfun_brainvision_segmented function crashes in line 116. The reason for this crash is absence of the trialinfo variable.
> 
> In detail, if no 'Stimulus' is defined the numstim variable gets 0 (line 99), otherwise the query 'if all(numstim==numstim(1))' in line 100 results in true.
> 
> I would recommend to change line 100 to:
> 
> if ((numstim > 0 ) && (all(numstim==numstim(1))))
> 
> Hereby the else branch will be executed, if numstim = 0.
> 
> Furthermore, the mentioned function also crashes, if the stimulus markers in the marker file either have no value or a value with wrong letters. This cases should be captured with a more obvious error message.
> 
> All the best,
> 
> Daniel
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip





More information about the fieldtrip mailing list