Open sivyobe opened 6 years ago
it seems to be read:
https://github.com/mne-tools/mne-matlab/blob/master/matlab/mne_read_source_spaces.m#L251
if you read it back from Python you recover the info?
How can I check if there are the patch informations in python? When I read with the command src=mne.read_source_spaces(..., patch_stats=True, ...), what kind of command can I use to check the information of src?
please provide a full code snippet using sample data so we can debug faster.
In python:
import mne
path = mne.datasets.sample.data_path(download=True)
src = mne.setup_source_space(
subject='sample', subjects_dir=path + '/subjects', add_dist=True, spacing='ico4')
mne.write_source_spaces('ico4-src.fif', src)
src_p = mne.read_source_spaces('ico4-src.fif', patch_stats=True)
mne.write_source_spaces('ico4-src_p.fif', src_p)
In matlab (working in the folder 'path'):
ico4=mne_read_source_spaces('ico4-src.fif');
This command give me the error:
Only two and three dimensional matrices are supported at this time
And also trying with ico4=mne_read_source_spaces('ico4-src_p.fif');
@sivyobe I edited your code snippet. I can confirm the error. I don't have much time now. It's a bug in the matlab IO.
maybe @SherazKhan knows what to do
@agramfort @sivyobe I can fix the bug in mne-matlab and send the PR @sivyobe do you want to take first take on the PR ?
What do you mean @SherazKhan?
@SherazKhan The bug seems to be unfixed in mne-matlab yet?
>> src = mne_read_source_spaces('S01-4098-src.fif', 1);
Reading a source space...Error using fiff_read_tag (line 178)
Only two and three dimensional matrices are supported at this time
Error in mne_read_source_spaces/read_source_space/find_tag (line
288)
There in fiff_read_tag.m
, ndim
is read as "1" while only 2 and 3 are allowed for the matrix form.
mne.setup_source_space
in MNE-Python. Ones created by mne_make_source_space
in the original MNE package work just fine!
Hello, I try to read in matlab (with the mne-matlab tool) a source created in MNE-python with the additional information of patch. I use in python the command mne.setup_source_space(sj, fname=True, spacing='ico4', subject_dir=, add_dist=True), followed by mne.write_source_spaces(...) to have the fif file with patch information.
But when I read the file in matlab there isn't any information about the patch, i.e. the values nearest, nearest_info, pinfo, dist and dist_limit are empty.
Then I try to rewrite the file using one more step in python: mne.read_source_spaces(..., patch_stats=True, ...) followed by mne.write_source_spaces(...) and in this case when I try to read the fif file in matlab an error was reported:
How can I solve the problem? Because I need the patch information for my work at this step in matlab.