Epileptogenicity map problems

HI, I wonder if anyone can give me an insight into this problem:
Trying to analyse a recently recorded patient co-registering the MRI and the post-implantation CT. When co-registering/reslicing the 2 dataset for the standard pipeline everything seems to work ok. If I use the same images (.nii.gz for both) within the epileptogenicity map I get a series of errors and the program gets stuck at "generating canonical surfaces" after performing the following ok


iteration 1...
0.9494 0 0 0 0 0 | -1.0565
0.9494 -2.199 0 0 0 0 | -1.0569
0.9494 -2.199 -15.3 0 0 0 | -1.0729
0.9494 -2.199 -15.3 -0.08123 0 0 | -1.0772
0.9494 -2.199 -15.3 -0.08123 -0.02434 0 | -1.0777
0.9494 -2.199 -15.3 -0.08123 -0.02434 0.0009451 | -1.0777
iteration 2...
1.063 -2.199 -15.3 -0.08123 -0.02434 0.0009451 | -1.0777
1.063 -0.8574 -15.3 -0.08123 -0.02434 0.0009451 | -1.0795
1.063 -0.8574 -14.83 -0.08123 -0.02434 0.0009451 | -1.0797
1.063 -0.8574 -14.83 -0.05506 -0.02434 0.0009451 | -1.0804
1.063 -0.8574 -14.83 -0.05506 -0.02326 0.0009451 | -1.0804
1.063 -0.8574 -14.83 -0.05506 -0.02326 0.0009451 | -1.0804
1.144 0.09979 -14.5 -0.03638 -0.02249 0.0009451 | -1.081
iteration 3...
1.32 0.09979 -14.5 -0.03638 -0.02249 0.0009451 | -1.0811
1.321 0.1149 -14.5 -0.03609 -0.02248 0.0009451 | -1.0811
1.321 0.1149 -15.17 -0.03609 -0.02248 0.0009451 | -1.0815
1.321 0.1149 -15.17 -0.02168 -0.02248 0.0009451 | -1.0817
1.321 0.1149 -15.17 -0.02168 -0.01316 0.0009451 | -1.0818
1.321 0.1149 -15.17 -0.02168 -0.01316 0.006235 | -1.0818
iteration 4...
1.533 0.1149 -15.17 -0.02168 -0.01316 0.006235 | -1.0819
1.576 0.6281 -14.99 -0.01167 -0.01275 0.006235 | -1.0823
1.576 0.6281 -15.16 -0.01167 -0.01275 0.006235 | -1.0823
1.576 0.6281 -15.16 -0.01167 -0.01275 0.006235 | -1.0823
1.576 0.6281 -15.16 -0.01167 -0.009584 0.006235 | -1.0824
1.576 0.6281 -15.16 -0.01167 -0.009584 0.006235 | -1.0824
iteration 5...
1.68 0.6281 -15.16 -0.01167 -0.009584 0.006235 | -1.0824
1.685 0.6843 -15.14 -0.01057 -0.009539 0.006235 | -1.0824
1.685 0.6843 -15.22 -0.01057 -0.009539 0.006235 | -1.0824
1.685 0.6843 -15.22 -0.0101 -0.009539 0.006235 | -1.0824
1.685 0.6843 -15.22 -0.0101 -0.009539 0.006235 | -1.0824
1.685 0.6843 -15.22 -0.0101 -0.009539 0.006235 | -1.0824
iteration 6...
1.685 0.6843 -15.22 -0.0101 -0.009539 0.006235 | -1.0824
1.685 0.6843 -15.22 -0.0101 -0.009539 0.006235 | -1.0824
1.685 0.6843 -15.22 -0.0101 -0.009539 0.006235 | -1.0824
1.685 0.6843 -15.22 -0.01008 -0.009539 0.006235 | -1.0824
1.685 0.6843 -15.22 -0.01008 -0.009539 0.006235 | -1.0824
1.685 0.6843 -15.22 -0.01008 -0.009539 0.006235 | -1.0824
iteration 1...
1.633 0.6843 -15.22 -0.01008 -0.009539 0.006235 | -1.082
1.633 0.7622 -15.22 -0.01008 -0.009539 0.006235 | -1.082
1.633 0.7622 -15.34 -0.01008 -0.009539 0.006235 | -1.0821
1.633 0.7622 -15.34 -0.008081 -0.009539 0.006235 | -1.0821
1.633 0.7622 -15.34 -0.008081 -0.006628 0.006235 | -1.0821
1.633 0.7622 -15.34 -0.008081 -0.006628 0.006235 | -1.0821
iteration 2...
1.676 0.7622 -15.34 -0.008081 -0.006628 0.006235 | -1.0821
1.676 0.8166 -15.34 -0.008081 -0.006628 0.006235 | -1.0821
1.676 0.8166 -15.26 -0.008081 -0.006628 0.006235 | -1.0821
1.676 0.8166 -15.26 -0.007103 -0.006628 0.006235 | -1.0821
1.676 0.8166 -15.26 -0.007103 -0.006628 0.006235 | -1.0821
1.676 0.8166 -15.26 -0.007103 -0.006628 0.005891 | -1.0821
iteration 3...
1.676 0.8166 -15.26 -0.007103 -0.006628 0.005891 | -1.0821
1.676 0.8256 -15.26 -0.007103 -0.006628 0.005891 | -1.0821
1.676 0.8256 -15.26 -0.007103 -0.006628 0.005891 | -1.0821
1.676 0.8256 -15.26 -0.006855 -0.006628 0.005891 | -1.0821
1.676 0.8256 -15.26 -0.006855 -0.006628 0.005891 | -1.0821
1.676 0.8256 -15.26 -0.006855 -0.006628 0.005891 | -1.0821
Done 'Coregister: Estimate'
Done

BST> Emptying temporary directory...

with the following messages first ba warning then an error:

BST> Emptying temporary directory...
Warning: NARGCHK will be removed in a future release. Use NARGINCHK or NARGOUTCHK instead.

In xml_parser (line 114)
In xmltree (line 52)
In read_gifti_file (line 15)
In gifti (line 68)
In ImaGIN_spm_eeg_inv_mesh (line 59)
In process_generate_canonical>Compute (line 153)
In process_generate_canonical>ComputeInteractive (line 210)
In process_generate_canonical (line 28)
In scenario_epilepto>ValidateImportAnatomy (line 403)
In scenario_epilepto>@(c)ValidateImportAnatomy() (line 109)
In panel_guidelines>SwitchPanel (line 116)
In panel_guidelines>@(h,ev)SwitchPanel('next') (line 56)


and then the following error messages appear:

Error using read_gifti_file (line 17)
[GIFTI] Loading of XML file C:\brainstorm3\external\ImaGIN\private\SEEG_cortex_hip_amy_8196.surf.gii failed.

Error in gifti (line 68)
this = read_gifti_file(varargin{1},giftistruct);

Error in ImaGIN_spm_eeg_inv_mesh (line 59)
mesh.tess_mni = export(gifti(filename), 'spm');

Error in process_generate_canonical>Compute (line 153)
spmMesh = ImaGIN_spm_eeg_inv_mesh(NiiFile, Resolution);

Error in process_generate_canonical>ComputeInteractive (line 210)
[isOk, errMsg] = Compute(iSubject, iAnatomy, Resolution, 1);

Error in process_generate_canonical (line 28)
eval(macro_method);

Error in scenario_epilepto>ValidateImportAnatomy (line 403)
process_generate_canonical('ComputeInteractive', iSubject, 1, SurfResolution);

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'));

SPM8 in installed and under path.

Any ideas?

Many thanks and apologies for the lenghty email.

Stefano Seri

Hello

The difference in behavior between the two approaches depends on the default options:

  • when running manually the computation of the "SPM canonical surfaces", it uses the highest resolution available in SPM (20484 vertices)
  • when using the panel "Guidelines > Epileptogenicity maps", it uses by default a modified version of this surface to replicate the results presented in David's article (https://www.ncbi.nlm.nih.gov/pubmed/21975587)

I fixed this discrepancy, now it will be using the default SPM surface everywhere. It will have the same effect of you changing the selected surface (Step #2) to "20484V". After you update Brainstorm, it will select this option by default.

Now, why you were getting this error, this is a mystery. Could you please enter the following lines in your Matlab command window (after starting Brainstorm and running the computation of something involving SPM), and copy-paste the output here:

gifti('C:\brainstorm3\external\ImaGIN\private\SEEG_cortex_hip_amy_8196.surf.gii')
export(gifti('C:\brainstorm3\external\ImaGIN\private\SEEG_cortex_hip_amy_8196.surf.gii'), 'spm');

Thanks
Francois