Error computing source coherence

Hi
I was computing Lagged Coherence on default anatomy , I used FEM as a head model, actually I was able to get the coherence on two scouts from Desikan-Killiany Atlas : L and R frontal poles, however, when I tried to do it on L an R precuneus, the computation got stuck on 3%, software did not perform the computation.

I tried the same with another subject and this time I used the subject's MRI anatomy, but I got the same trouble.

The problem was just when I selected precuneus as scout.

Thank in advances!

Ps: I selected "after" for applying scouts

Can you please package an example (without FEM, for less complications)?

  • Duplicate the subject (right-click on the subject > File > Duplicate)
  • Delete all the unnecessary files:
    • In the anatomy: keep only the MRI, the head surface, the cortex surface
    • In the functional data: keep only one folder containing one channel file + one data file + one source file.
  • Right-click on the subject > File > Export subject
  • Test your package:
    • Menu File > Load protocol > Load from .zip file, select the .zip you've just created (e.g. "ProtocolName_SubjectName").
    • Make sure you can reproduce the error
  • Upload the .zip file somewhere
  • Post the download link here
  • Post here the screen capture of the options of the process you are running in order to obtain this error.

Thanks

Hi Francois!
Well,
I'm getting the same problem using the ICBM 152 default anatomy, so I'm unsure if I shouId pack and upload that file, I extracted the sources with S-Loreta and everything went fine until I tried to compute lagged coherence using Precuneus as scout:

Las time I waited about 45 minutes but the percentage never changed,

I have been trying with many subjects and scouts but I got the same with cuneus, precentral , parahipocampal, etc

My computer has 16 gb Ram

Thanks in advances!

ps: I think the problem is the giant matrix since I'm computing source coherence in narrow band and 19 electrodes, with the "After" function selected, with "Before" it works fine, but the weird thing is that with the after option percentage never changed even waiting for a long time, last year I was able to compute source connectivity without any problems :open_mouth:

The computation time and memory requirements mostly depends on the number of time points and the number of source points.
Time: it looks like you have 84 files * 25s, so probably 2100000 time samples (at 1000Hz).
Number of sources: around 500 for these two scouts.

So what you are expecting to compute is in the first place is the coherence for 500*500=250000 pairs of signals that are each 2100000 samples long.
No surprise that it takes for ever...

If you want to track more in details what is happening:

  • Put a breakpoint at the beginning of bst_cohn.m, run the execution, then use the Matlab debugger to execute the code line by line
  • Start the Matlab profiler (profile on), run the execution, wait for a few minutes, press CTRL+C in the Matlab command window to stop the computation, then open the profiler report (profile viewer)
  • Open the resource monitor of your computer, if the memory usage goes over 95%, you need to change something.