tierneytim / OPM

Tools for OPM processing using SPM
GNU General Public License v2.0
17 stars 7 forks source link

Cannot open NAcortex_8196.surf.gii #17

Closed ZQInQAAS closed 1 year ago

ZQInQAAS commented 1 year ago

Hi, I got an error when I run [hfD, Yinds]=spm_opm_hfc(S);

警告: [GIFTI] Parsing of XML file NAcortex_8196.surf.gii failed. 
错误使用 xmltree (第 47 行)
错误使用 xmltree (第 47 行)
[XMLTree] Cannot open NAcortex_8196.surf.gii

出错 read_gifti_file (第 15 行)
    t = xmltree(filename);

出错 gifti (第 108 行)
                this = read_gifti_file(varargin{1},giftistruct);

出错 spm_eeg_inv_transform_mesh (第 18 行)
    cmesh = export(gifti(mesh.(fn{tess_ind(i)})),'spm');

出错 spm_eeg_inv_forward (第 42 行)
    mesh = spm_eeg_inv_transform_mesh(M, D.inv{val}.mesh);

出错 spm_opm_hfc (第 151 行)
            mfD = spm_eeg_inv_forward(mfD,1);

出错 tierneytimOPM (第 19 行)
[hfD, Yinds]=spm_opm_hfc(S);
gllmflndn commented 1 year ago

Hi @ZQInQAAS, the error message could indicate that either file NAcortex_8196.surf.gii was not found in the current directory or that there was an error when reading the file. If the issue is the latter, could you upload the file here for inspection?

tierneytim commented 1 year ago

Hi both, this is a problem of the object remembering the data it initially processed and trying to find those files. They are not necessary for running. As a workaround try set the argument S.balance=0 and rerun the code. That should work fine. For your own data you should have all he necessary files, in which case setting S.balance=1 is more appropriate

ZQInQAAS commented 1 year ago

Thank you~ This solved my problem.

set the argument S.balance=0 and rerun the code.

I‘m trying to understand the mathematic principle of your work, it’s a great job although a little hard for me. ><

tierneytim commented 1 year ago

Glad it's sorted. And thanks for the kind words