plotting from MATLAB

Hello,

I see that the MNE toolbox has some functions to import Freesurfer
surfaces into MATLAB, but I'm having trouble figuring out what's the
correct surface to load if I want to plot my source localization
results from within MATLAB. Basically, what I do now is write a .stc
file in MATLAB and then open it in MNE to see the results of my
analysis overlaid on the brain. I'd like to be able to import the
surface into MATLAB and plot these results without having to write
the .stc file.

The problem I have now is finding the surface that matches the correct
number of vertices I have in my solution. Should I be able to load any
of the surfaces in $SUBJECTS_DIR/mysubject/surf, and matching the
vertex number in the info structure from the source localized data,
plot the results in MATLAB? If so, do I just assume the results for
the vertices not present in the info structure to be zero?

Thanks,

Gus

Hi Gus,

plot the results in MATLAB? If so, do I just assume the results for
the vertices not present in the info structure to be zero?

If I understand correctly, your assumption would be right for a smoothing
level (# smooth steps) of 0. If not you may need to precompute your
smoothing matrices as described in section 8.3 of the manual. I think the
neighborhood information of the vertices can be computed from their
coordinates if you calculated your source space with the '--cps' option.

I'm not sure if there is an easier way but I may be wrong on this. If you
do find out please let me know.

Cheers,
Pavan

Hi Gus,

Unfortunately, the neighborhood information is never in the source
space files, you need to recompute it. Besides, you usually want to
visualize the data on a surface other than the one in the source space
file. You can start by loading the inflated surfaces

s =
mne_read_surfaces
('inflated',true,true,true,'sample',getenv('SUBJECTS_DIR'),true);

Then you need to look at the tris member of each surface returned and
figure out the neighboring vertices.

I hope this helps

- Matti

Thank you Matti and Pavan. That does help.

Just to make it clear, if I do it the old way I was doing it, by
opening the source localization results I get from raw2mat in matlab,
and later writing a .stc file with that information, it should work
properly, correct? For the vertices argument to write .stc, I used the
information in MNE_raw_info.ch_names.

Gus