Ft_sourceanalysis?

I am having trouble initiating the LCMV beamformer technique under ft_sourceanalysis in the pipeline editor. I have a volumetric head model created through ft_prepare_leadfield using the EEG method BEM Christophe Philllips method, and a data convariance file. But I get the error shown in the image. Any insights?

Also, for some reason I can compute the LCMV beamformer through the compute sources [2016] option, but not the pipeline editor?

Hello,

I fixed this bug and replaced the wrong variable name.
However, I am not sure this process is supposed to work properly. I wrote a draft, hoping that at some point someone with some experience with FieldTrip programming would look at it.
If you are interested in helping us having all the FieldTrip functions working correctly in Brainstorm, we could test this together.

The function ft_sourceanalysis.m is called in this process:

You mentioned you cannot compute use the LCMV option from the pipeline editor. I could not reproduce this error.
Can you report the full error message you get.

Note that the “LCMV” option in Brainstorm and FieldTrip produce outputs that are not of the same nature. The output in Brainstorm has multiple time points, the output of FieldTrip has only no time dimension. Use these options only if you know exactly what you are doing.
http://neuroimage.usc.edu/brainstorm/Tutorials/SourceEstimation#Advanced_options:_LCMV_beamformer

Cheers,
Francois

I believe fixing the variable name did it. I can now run LCMV beamformer through ft_sourceanalysis. I would be happy to help by testing the fieldtrip functions. I ran the other two beamformer options under ft_sourceanalysis: DICS Beamformer and SAM Beamformer and I received the following errors.

DICS Beamformer:

SAM Beamformer:

Also in regards to the LCMV beamformer, I was curious about the functionality of it? This is because running the analysis on my headmodels/data. All of the activity is localized to the white matter. This differs from all other methods that I ran with brainstorm.

Indeed, there are things to change in the parameters that are passed to ft_sourceanalysis by the Brainstorm function I pointed previously.
This should be looked at with someone very familiar with FieldTrip.
I’m not sure the implementation in Brainstorm can be used the way it is now.

I’m not exactly sure what should be passed to the ft_sourceanalysis, and the output should be a ratio between an active state vs. a baseline, as shown in this tutorial:
http://www.fieldtriptoolbox.org/tutorial/beamformer

The formulation of the solution is different is different in Brainstorm (needs the noise and data covariance in input) and FieldTrip (needs only one covariance matrix, but I’m not sure which one).
Hopefully John Mosher, who implemented the Brainstorm version of the LCMV beamformer, can clarify this.

I apologize for the confusion, but the image actually posted was from the LCMV beamformer from brainstorm not ft_source analysis. Running both, very similar results can be seen with localization on the white matter, so I am worried whether I am not utilizing either one correctly. I have a volume head model and a data covariance model, but results are still inconsistent.

I have worked with fieldtrip beamforming before through its matlab toolbox, so I understand that the cross-spectral density and preprocessed data need to be imported into ft_sourceanalysis under its configuration, but I am unsure how to do confirm this has occurred through brainstorm.

It looks like there is something wrong with your source space.
The grid you used is not covering the entire head volume. Are you sure your surfaces are correctly aligned with the MRI? To check this, right-click on a surface > MRI registration > Check MRI/surface registration.

If all the surfaces look good, check the source space: right-click on the head model > Check source grid, then add the MRI to the figure (in the Surface tab, button [add surface] > Anatomy).
If there is something wrong, try computing another head model with different parameters.

To explore the variables that are passed to ft_sourceanalysis:

  • open the file process_ft_sourceanalysis.m in the editor in Matlab
  • place a breakpoint at the line calling ft_sourceanalysis (click next to the line number to get a red dot)
  • run the process “Sources > FieldTrip: ft_sourceanalysis” from the brainstorm interface
  • when the debugger stops, you have access to all the variables and you can use the command window as if you were in the middle of the script
  • when you’re done, stop the debugger with the button Stop in the editor ribbon of the Matlab environment

Francois

It looks like my source grid is aligned with the MRI, and the electrode configuration is correctly set as well. I'm unsure where I am going wrong? I have images of everything below, please note that I am using the mri volume head model creation using openMEEG BEM. Thank you for helping me along with this.








I met with several other beamformer experts met in a small workshop last week in England (14-15 Feb 2017) , to discuss why each package (SPM, MNE-Python, BrainStorm, Fieldtrip, Elekta Beamformer) gives often different results. There was no simple fix identified, but we did clarify a number of issues. We are still working on common data sets and a consensus statement on the issues, with the goal of getting a consistent set of results and data products generated. It will still be several months.

As to Brainstorm, I am still refining my own approach that is unfortunately not well represented in our tutorial, and I am working on a beamformer paper that should formally clarify my methods.

For now, I suggest that you mimic the Elekta Phantom workflow tutorial, which uses a noise covariance matrix to otherwise accurately locate 32 experimental phantom sources.

Then simply replace the noise covariance with a noise covariance that is actually calculated over your data time series, not the pre-stim. In other words, the data covariance is used a noise covariance matrix in the Brainstorm dipole calculations.

Otherwise run the dipole fitting procedure identically, and you will get both an imaging kernel and dipole locations derived from an LCMV beamformer. I am still refining that calculation.

This hack is of course inelegant for now, but part of the issues are deciding what to do when given only a noise covariance, only a data covariance, or both.

  • John

The screen capture your posted previously is showing values only at the center of the head, indicating that there is something wrong: you should see values (even plain blue) everywhere in the volume of the brain. Either there is something wrong with the source space, or with the brain mask that is estimated by Brainstorm.

If you want me to look at it, please send me some data:

  1. Make a copy of a subject in your database: right-click on the subject > File > Duplicate subject
  2. Delete unnecessary files (not needed to reproduce the results you posted previously) but keep at least the anatomy, one data file, one forward model and one source file
  3. Right-click on the subject > File > Export subject
  4. Upload the .zip file somewhere (eg. dropbox, onedrive…)
  5. Send me the link in a separate email (click on username on this forum)

I will also look at the errors in the DICS and SAM options of the FieldTrip process, but it may take a few weeks before I have time to do this.

Francois

I had a concern with the volumetric approach of brainstorm. I created a headmodel using the methods of brainstorm (MRI volume, Open MEEG) and as mentioned before in my post. Activity is localized to subcortical activity. I believed this to be a beamforming issue since that was the technique being used, but the same issue occurs with sLORETA. The interesting thing is when done with the weighted minimum norm technique. Everything is localized as it should onto the MRI volume. I was wondering if you had any insight on this?

I have attached some images of all the issues I have previously brought up. One interesting thing that I noticed is that with the weighted minimum norm technique, results are what they are expected to when utilized on the MRI volume. But if these same results are normalized with Z-transformation. They are completly different and resemble the sLORETA with localization occurring almost entirely in the white matter.


This is the time series used, with all the following pictures being at the same time of 219 ms


Topography of the subject


Noise covariance utilized


WMN without Z score transformation


]
WMN with Z score transformation


sloreta on volume


sloreta on surface

Please let me know if there is anything else I should include, and thank you for assisting me with these issues.

Thanks.

Looks like from the noise covariance that you have at least one noisy channel (even though it does not show in the butterfly plot). How did you compute the noise covariance? From the prestim baseline? Also what type of study is this (in other words, what does time 0ms represent)? I suppose you are producing the brain images at the latency shown in the time series sensor plot?

Yes, I computed the noise co variance off of the prestim baseline. This is a proprioceptive trial measuring error-correction using the application of a perturbation to the subject as they are trying to move a cursor causing a derailing of the cursor. The subject then corrects for this. The time of the given perturbation corresponds to time 0ms.

Also yes, the brain images correspond to the latency shown in the time series.