Problem with SEEG epileptogenicity maps

Hi Francois,

I just tried to compute epileptogenicity maps for one seizure recorded with SEEG in one patient.

I successfully imported pre implantation MRI and post implantation MRI, co-registered them and localized SEEG contacts.
I imported SEEG data for one seizure and for the baseline.
All anatomical and SEEG data pre preprocessing was OK.

Computing Epileptogenicity maps was OK with the Surface Output options : I get a stat file that can be plotted on surface.
However, I got a an error while running Epileptogenicity maps using the Volume Output options and I didn't get the output.
Any Idea to solve the problem ?

Thanks again for your amazing software, :slight_smile:

Julien

:

Hi Julien,

I edited this line, it should be more robust across various versions of Matlab now.
Please get this modification (menu Update > Update Brainstorm) and try again.

Francois

I encountered the same problem as you can see in the attached capture. While the surface mapping produces a correct result, the volume map is totally inconsistent. Could it be related to the Matlab version (2017a)? I run the updated brainstorm of course. Any ideas?

Are these two different results, one computed using the surface and the other using a volume grid?
Or is it the same surface results you display in two different ways?

These views are difficult to compare because we don’t see the the same regions. Can you prepare other screen captures with:

  • a lower amplitude threshold (or higher p-value threshold)
  • in the MRI viewer: click on the option “MIP: functional” (glass brain)
  • in the MRI viewer: add the display of the contacts

These are the same results calculated as Surface (top) and then as Volume (bottom). The surface results are correct in space, but the volume ones are not; they are actually away from the sEEG electrode space.

Is there a particular Matlab version you used to validate these two processes? Otherwise, all pre-processing and calculation procedures were common for both figures (same data, same pipeline).

So these are two different files.

Can you please post screen captures showing:

  • the two files in your database explorer
  • the anatomy folder in your database explorer
  • a 3D figure showing the SEEG electrodes, the MRI AND the surface at the same time (you can add objects with the buttons at the top of the Surface tab)
  • the MRI viewer with the results you showed previously and the SEEG electrodes (and the “MIP: functional” option selected)

Any recent Matlab version should produce the same output here.

I’m afraid the system won’t allow me to upload the requested volume of images, neither as a single post nor as multiple posts. Any suggestions?

Upload the images somewhere else (dropbox, google drive, one drive, etc), then create a link to download them and post the link here.
You can zip all the images together if you have many

Or simpler maybe: save the images as JPEG instead of PNG, they should be smaller and you should be able to post them directly on the forum.

Hi Francois,
The following might give you an idea:

So, I don't think there is anything wrong with the volume data (as they appear correct when projected) but the stats don't project correctly.

Hope this helps. Let me know if you have any ideas.

Vasileios.

Indeed, there is really something that went wrong.
I cannot reproduce this behavior on my example datasets and everything looks good to me in the figures and in the database, so I’m not sure how to go from here.

There is probably something wrong in the interpolation between the cortex surface and the volume, either in Brainstorm or in SPM (could be due to a bug in the functions that export the data to Brainstorm).

Try the following:

  • right-click on cortex surface > Remove interpolations
  • right-click again > MRI registration > Check MRI-surface registration
    => Do the surface looks aligned with the brain? (do not expect the precise cortical folding to match, this is an SPM template, not anatomical reconstruction)
    => Have you already tried starting everything over from the beginning?

Another thing to test: when displaying the wrong volume results, what does it look like if you lower the threshold? (eg. p-value < 0.99)
If this looks terribly wrong, there is probably an issue in the way the information is exchanged with SPM, but I cannot give you additional guidelines to debug this yourself…

I would need to explore this myself, as I don’t know what to look for…
Would it be possible for you to send me an anonymized version of this dataset?

  • Right-click on the subject folder > File > Duplicate subject
  • Rename the new subject and remove the patient name
  • Delete all the folders except the last one, which contains the Onset+Baseline+Channel files
  • Right-click on the new subject folder > File > Export subject
  • Upload the .zip file somewhere, then send me the link as a private message on this forum.

Francois

I am having a separate issue. I spent a lot of time importing preimplant MRI, postimplant CT, and making surfaces and locating electrodes manually. Then I try to do the Help>guidelines> epileptogenicity maps and it asks for MRI. I tried to do so and it gave an error and moreover deleted my previous surfaces and MRI. When I got to brainstorm db anatomy folder there is none of my work. Any way to recover it?

Thanks.

PS Matlab code preceding this is:
Error using load
Unable to find file or directory 'C:\Users\Cory
Myers\Documents\Duke\CNP2021\ResearchProjects\MatlabPackages\brainstorm_db\Protocol02\anat\07CM\subjectimage_2021-02-23_15-04_axspgr_0002_spm_reslice.mat'.

Error in in_mri (line 149)
MRI = load(MriFile);

Error in import_mri (line 148)
sMri = in_mri(MriFile, FileFormat, isInteractive && ~isMni, isNormalize);

Error in scenario_epilepto>ValidateImportAnatomy (line 346)
DbMriFilePre = import_mri(iSubject, MriFilePre, 'ALL', 0, 0);

Error in scenario_epilepto>@(c)ValidateImportAnatomy() (line 109)
ctrl.fcnValidate{i} = @(c)ValidateImportAnatomy();

Error in panel_guidelines>SwitchPanel (line 116)
[isValidated, errMsg] = ctrl.fcnValidate{iPanel}();

Error in panel_guidelines>@(h,ev)SwitchPanel('next') (line 56)
ctrl.jButtonNext = gui_component('button', jPanelControl, 'br', '>>', buttonFormat, [], @(h,ev)SwitchPanel('next'));


** Error: The pre-implantation MRI file you selected does not exist.


BST> Saving protocol "Protocol02"...
BST> Emptying temporary directory...
BST> Brainstorm stopped.

This menu "guidelines> epileptogenicity" is designed to create a new subject and import the new volumes automatically. It is not robust enough to handle existing data in the anatomy folder that was not imported by itself.
This panel was developed for one very specific use case at the hospital in Grenoble, and might not be adapted to other workflows. It has very few users (and maybe no user at all at the moment, I'm not sure), it hasn't been debugged by hundreds of users as other parts of the software, therefore we can't expect it to be very stable...
I'd recommend you avoid this tool and do everything manually (but you probably drew this conclusion by yourself already...)

Any way to recover it?

Unfortunately not.
You should set up a regular backup of your work with Brainstorm, just like for any other computer work, in order to recover any lost data without having to recompute everything.
Sorry for the loss of time...

Error using load
Unable to find file or directory 'C:\Users\CoryMyers\Documents\Duke\CNP2021\ResearchProjects\MatlabPackages\brainstorm_db\Protocol02\anat\07CM\subjectimage_2021-02-23_15-04_axspgr_0002_spm_reslice.mat'.
...
** Error: The pre-implantation MRI file you selected does not exist.

This error seems to indicate that there was some error in the database structure from the beginning.
Maybe you'll need to reload your protocol to fix some remaining problems.

1 Like