Tutorial_epileptogenicity.m errors

Hi-

I have encountered 2 bugs in tutorial_epileptogenicity.m.

The first is trivial to fix: at line 81,

[DbMriFilePostReg, errMsg, fileTag, sMriPostReg] = mri_coregister(DbMriFilePost, DbMriFilePre, 'vox2ras', 0); 

needs to be replaced with

[DbMriFilePostReg, errMsg, fileTag] = mri_coregister(DbMriFilePost, DbMriFilePre, 'vox2ras', 0);

The second is not (as) trivial. I get the following error when I run this script on a newly-downloaded tutorial_epimap folder:
spm crunching for a while... then

WARNING: Reduced file detected: There are discontinuities in the recordings

that cannot be handled correctly in Brainstorm.

The file is read linearly, as if there were not discontinuities.

The time for the first segment is correct, but not the following.

WARNING: Reduced file detected: There are discontinuities in the recordings

that cannot be handled correctly in Brainstorm.

The file is read linearly, as if there were not discontinuities.

The time for the first segment is correct, but not the following.

WARNING: Reduced file detected: There are discontinuities in the recordings

that cannot be handled correctly in Brainstorm.

The file is read linearly, as if there were not discontinuities.

The time for the first segment is correct, but not the following.

BST> bst_process: File indices changed, reloading files list...

BST> process_timefreq: Using 111 windows of 5120 samples each

BST> Emptying temporary directory...

BST> Block is too small #001: ignoring...

BST> Emptying temporary directory...

BST> Block is too small #001: ignoring...

BST> Emptying temporary directory...

BST> Block is too small #001: ignoring...

BST> Emptying temporary directory...

BST> Block is too small #001: ignoring...

BST> Emptying temporary directory...

BST> Block is too small #001: ignoring...

BST> Emptying temporary directory...

BST> Block is too small #001: ignoring...

Index exceeds the number of array elements. Index must not exceed 0.

Error in tutorial_epileptogenicity (line 230)

sFilesEpilepto1 = bst_process('CallProcess', 'process_epileptogenicity', sFilesBaselines(1), sFilesOnsets(1), ...

Thanks for your help!

Aaron

Thank you for reporting this important issue!

I fixed the first problem by restoring the returned structure sMriReg from mri_coregister, which I modified recently: Bugfix: Restored returned variable sMriReg (altered in e7a2882) · brainstorm-tools/brainstorm3@cb368af · GitHub
Simply removing the extra returned variable worked, but didn't solve the source of the problem.

The other problem is older, and comes from the fact that now we have access to the original recording time in the Micromed files (since this commit: Micromed: Add support for reduced files · brainstorm-tools/brainstorm3@514eb5a · GitHub). The times used in the online tutorial and the corresponding script tutorial_epileptogenicity.m are not valid anymore. The warning about discontinuities is also derived from this change, but you can ignore it.

I updated the code here: Bugfix: Tutorial epileptogenicity modified to match new Micromed read… · brainstorm-tools/brainstorm3@7deb7e6 · GitHub

But then, while digging into the causes of why the script was still not running correctly, I discovered more and more issues due to incompatibilities with newer developments (e.g. at this moment, the positions of the electrodes are not imported correctly), and finally decided to take advantage of this exploration to upgrade this tutorial to use a BIDS dataset instead of the current "tutorial_epimap.zip" package.

Please hold on while I am updating the dataset and the tutorial. I will post another message on this thread when the new BIDS dataset is ready to be tested.

sounds good, thanks for the update!

I finished updating everything.
I posted are many bug fixes to the epileptogenicity process and script, and updated the tutorial to work with the BIDS dataset tutorial_epimap_bids.zip.
https://neuroimage.usc.edu/brainstorm/Tutorials/Epileptogenicity

Please update Brainstorm, download the new dataset, and try again from the beginning.

It runs without errors for me now.

Thanks!!