So I’m trying to export single trial source reconstructions from brainstorm in order to perform searchlight MVPA as in fMRI. However, I find when I export them as SPM8 volumes as a.mat file that the 4-dimensional cube variable is filled with zeros. I’m not sure why this is happening since when I look at the file in brainstorm’s MRI viewer there are clearly non-zero values. Any help would be appreciated and thanks in advance!
The exported volumes should not be fille ed with zeros.
Can you share some of these files, so I try to understand what your problem is?
Duplicate the subject (right-click > File > Duplicate subject), delete all the unnecessary files, and export it (right-click > File > Export subject).
Upload the .zip file somewhere (eg. dropbox, onedrive…) and send me the link in a separate email (click on my username on this forum).
I’ve just downloaded your file, but realized it does not contain the anatomy… I cannot test it on my end.
Please follow the guidelines I gave you in my previous message (right-click on the subject folder > File > Export subject).
When you export the source volume, do you average over a time window? Which time window?
You refer to an empty “Cube” matrix in a .mat file. What do you mean?
If you export the sources with the popup menu “File > Export as 4D matrix” or the process “File > Export to SPM8”, it saves a .nii file (not a .mat file).
This .nii file is not empty (open it with the software MRIcron for instance)…
I cannot reproduce what you describe, or I didn’t understand what you are trying to do.
Can you please be more specific? Post a a few screen captures showing the options of the export
ok I changed the file on box so that I’m computing the LCMV beamform.
These are the steps I take.
[B]Computing LCMV Beamform[/B]
I compute a noise covariance matrix from -200ms - -2 ms corresponding to my baseline
I compute a data covariance matrix from 0-300ms
I compute the LCMV beamform using the median eigenvalue option
[B]Exporting Sources[/B]
The I place the subject into the process1 space and select the option to process sources.
After I do this, I RUN> File > Export to SPM8.
Here I click on the output folder and choose to export as a .mat
Then I averaged over time from 0-300ms
When I saved out the volume from brainstorm as a .mat. In the .mat there is a variable named cube which is a 4 d variable. This variable has many zeros. However, I thought that there would be a value at each source even if it was a small one. Maybe I don’t fully understand the way source localization works, but this is my exact problem. Maybe this is more of a conceptual than a technical issue. Either way your input would be appreciated.
Thanks for the detailed description, now I understand clearly what you mean.
When you defined the head model, you decided to use a source space with 15765 points sampling the brain volume.
At each point, we use 3 dipoles to represent all the possible orientations in space (see the Source estimation tutorial for help).
If you look in your source files (right-click > File > View file contents), you have 47295 source time series.
=> ImagingKernel: [47295x128 double]
These values are reinterpolated over a much denser grid of values to display it in the MRI viewer and overlay it with the subject’s MRI.
From a cloud of points, we create a full volume [197x233x189] (total of 8675289 values).
The grid of source points is only defined inside the brain volume, not in at all the points of the MRI. All the voxels of the MRI volume that are too far from a source are set to zero. This is why you have a lot of values at zero.
Double-click on a PNAI file, it opens the MRI viewer, at the top-right corner of the window you can see the value at the current voxel (if you don’t see this value, update Brainstorm, I added this recently - menu Help>Update)
The Cube variable in the .mat file has smaller dimensions ([74×92×69]) because you selected two options in the export process: “Volume downsample factor” and “Cut empty slices”
I have a follow up question then. If I want to do MVPA in source space what is the best way to export the volume data (so that it can be manipulated like fMRI) or do you think it’s best to constrain dipole orientation such that there is a single value for source location and Create searchlights based on the 15765 sources?
If you want to use some specific tools you have available for fMRI volumes, do it the way you described before.
You cannot constrain the orientation of the dipoles in a volume grid. The orientation constraint is only available with surface source models. The only the you can do here is taking a norm of the three orientation, which is what is done by default, or maybe any other measure that you would think is relevant.
You could work on the surface, but your algorithms are probably not suited for handling meshes instead of volumes.