Time window issue with epileptogenicity index method

Dear Francois,
Thank you!

I ran the subject I sent you with a latency of -10:2:-2, and then with latency 'slices' of -10, -8, .., -2, to verify output. Same thing with 0:2:4 vs 0,2,4; both 'surface' mode. Here is what I found.

1.The imaGIN_Epileptogenicity.m output seems ok as far the the EI maps; I compared the -10:2:-2 serial time contact sheets with the 'slice' EI maps, and those are identifcal (minus the t map thresholding, which is based on the max of each file)
2. The issue seems to involve the Delay maps. First, the legend for the -10:2:-2 series map is incorrect (bounds [-10,-8], instead of [-10,-2]), and stems from the time vector included in process_epileptogenicity.m line 367,
tmpFile = import_sources(iStudy, [], bst_fullfile(workDir, listFiles(i).name), [], fileFormat, Comment, 's', [fileLatency(1), fileLatency(end)]);
A fix is to change it to
tmpFile = import_sources(iStudy, [], bst_fullfile(workDir, listFiles(i).name), [], fileFormat, Comment, 's', [min(fileLatency(:)), max(fileLatency(:))]);

This is because the way the neg indices change the order of read, therefore iFiles, and fileLatency variables. Want to make sure that the order of the time slices/latencies is temporally correct.

  1. This is not all regarding the Delay maps. Whether it is -10:2:-2 or 0:2:4, there is an inconsistency in the maps between Delay and EI Time contact sheet for the exact times included in the Delay. They should be identical. I do not think this is a thresholding issue between the two. I here attach the -10:2:-2 delay (mesial, interhemispheric surface) and the 'mesial' time contact sheet, to see the difference (there is a high-intensity/high t blob at -10 sec on the EI maps, not seen in the Delay map. Again, this discrepancy involves both negative or positive latencies, so this precedes my request.
  2. Only partly related, it would be probably helpful to include the numerical min, max-es of these map figures somewhere in the colormap menus, that way one can adjust the colormap scale among various serial vs slices, Delay vs EI maps for correspondence. Also, deleting the .brainstorm/tmp folder after a run automatically may help clean things up before another run, if one attempts to do it serially without exiting and entering bst repeatedly (it probably does not affect the results, but trying to avoid confounders).

Thank you,
OctavianContact_sheet__stat_3D_sbj_Epileptogenicity_surface_33_-10_-2_med.tif (115.3 KB) SEEG_3D_sbj_Epileptogenicity_surface_-10_-2_Delay.tif (297.7 KB)