[FieldTrip] Error with toilim in ft_entropyanalysis (Marta Stojanović)

Kloosterman, Niels kloosterman at mpib-berlin.mpg.de
Fri Apr 21 12:33:35 CEST 2023


Dear Marta,

Thanks for your interest in ft_entropyanalysis. To answer your question it would be good to see the exact cfg structure that you used. The lines where your error occurs are for selecting particular timepoints in each trial for computing time-resolved entropy across the trials. For this a time window is selected around this time point and these segments are concatenated. It could be that a time point you requested goes outside the trial when the time window around it is applied. It could also be that your last trial is not complete (check for nans in data.trial{end}).

Hope this helps!

Best,

Niels


Dr. Niels Kloosterman
Vertretungsprofessor in Algemeine Psychologie und Kognitive Neurowissenschaften
Charlotte Fresenius Hochschule Hamburg
niels.kloosterman at charlotte-fresenius-uni.de<mailto:niels.kloosterman at charlotte-fresenius-uni.de>


On 21. Apr 2023, at 12:00, fieldtrip-request at science.ru.nl wrote:


Caution: This is an external email and may be malicious. Please take care when clicking links or opening attachments.



Send fieldtrip mailing list submissions to
       fieldtrip at science.ru.nl

To subscribe or unsubscribe via the World Wide Web, visit
       https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
       fieldtrip-request at science.ru.nl

You can reach the person managing the list at
       fieldtrip-owner at science.ru.nl

When replying, please edit your Subject line so it is more specific
than "Re: Contents of fieldtrip digest..."


Today's Topics:

  1. Error with toilim in ft_entropyanalysis (Marta Stojanović)


----------------------------------------------------------------------

Message: 1
Date: Fri, 21 Apr 2023 09:08:48 +0000
From: Marta Stojanović <marta.stojanovic at student.uva.nl>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Error with toilim in ft_entropyanalysis
Message-ID: <47DC52D6-F510-45E9-AFF6-98AEF5F328BC at student.uva.nl>
Content-Type: text/plain; charset="utf-8"

Hi Fieldtrip community,

I’m reaching out with an issue I receive when running ft_entropyanalysis. The error I receive pertains to the trial limits/how a trial is defined using ft_redefinetrial.

My data input to ft_entropyanalysis is a raw struct (or rather a dummy raw struct where I reshaped previous output to fit the ft_rawdatatype), with the essential fields of trial, time, and label. My data has 145 trials, so my trial and time fields are 1x145 cells. I parcellated MEG data in my project based on the Brainnetome atlas with 246 parcels, and the trials have 1018 timepoints. The fields in the trial 1x145 cell are therefore 246x1018 doubles, and in the time cell 1x1018 doubles. These shapes of the data should fit the desired input shapes.

I receive the following error when I run the function:

‘’’
Index in position 1 exceeds array bounds (must not exceed 1).

Error in ft_redefinetrial (line 180)
   if cfg.toilim(i,1)>data.time{i}(end) ||
   cfg.toilim(i,2)<data.time{i}(1)

Error in ft_entropyanalysis (line 279)
       data_sel = ft_redefinetrial(tmpcfg, data_filt);

Error in run_entropy (line 65)
mmse = ft_entropyanalysis(cfg,test_entropy);
‘’’
The error seems to arise as my requested cfg.toilim is beyond the timepoints that are in the data. The issue seems to arise on the last trial (145) for some reason, hence why i is 145. My time cell contains identical time points for all trials. Each 1x1018 double in the time cell contains the same time points in equal 2-second intervals starting from 0. There is no stimulus since I'm using resting-state data, but there are still arbitrary trials/start times for these trials.

Any suggestion will be greatly appreciated, thanks a lot in advance!

Best,
Marta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230421/68c13ac4/attachment-0001.htm>

------------------------------

Subject: Digest Footer

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8ev3VUJGCaaQBEzxwJCYWUi1upzTzwI11Ig_go6UIq7o4B68pQtUhVd9ZMRhyAvIl_z-qraaP6qS1-OE15N4WmK4CKPYaXfyaAUj$ 


------------------------------

End of fieldtrip Digest, Vol 149, Issue 14
******************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230421/93558f98/attachment.htm>


More information about the fieldtrip mailing list