Effacer les filtres
Effacer les filtres

Error read_gifti_file

32 vues (au cours des 30 derniers jours)
Emma Jacobs
Emma Jacobs le 8 Fév 2023
Hi,
I'm trying to use the FieldTrip toolbox in MATLAB to load a file (cortex_8196.surf.gii), but I am getting an error that says it is unable to read the file.
This is the line that is causing the error:
sourcemodel = ft_read_headshape('C:\Users\Emmak\Documents\school\bmed_599\fieldtrip\fieldtrip20230204\template\, . . .
sourcemodel\cortex_8196.surf.gii');
This is the error:
Error using read_gifti_file
[GIFTI] Loading of XML file
C:\Users\Emmak\Documents\school\bmed_599\fieldtrip\fieldtrip-20230204\template\sourcemodel\cortex_8196.surf.gii
failed.
Error in gifti (line 89)
this = read_gifti_file(varargin{1},giftistruct);
g = gifti(filename);
What might be causing this?
Thanks!
Emma
  4 commentaires
Walter Roberson
Walter Roberson le 8 Fév 2023
I would be interested to see what happens if you readstruct() the gii file.
Emma Jacobs
Emma Jacobs le 8 Fév 2023
>> readstruct('C:\Users\Emmak\Documents\school\bmed_599\fieldtrip\fieldtrip-20230204\template\sourcemodel\cortex_8196.surf.gii', 'FileType','xml')
ans =
struct with fields:
VersionAttribute: 1
NumberOfDataArraysAttribute: 2
MetaData: ""
LabelTable: ""
DataArray: [1×2 struct]

Connectez-vous pour commenter.

Réponse acceptée

Sarthak
Sarthak le 19 Avr 2023
Hi Emma,
It is a bit difficult to analyse the exact reason for your error without your model file,however as per my understanding there may be multiple reasons such as
  • File path issue
  • MATLAB and FieldTrip version mismatch
  • File corruption
  • Fieldtrip configuration issues
If you have verified that there are no such issues and you have the required dependencies and permissions to access the file, you may try to debug the code and use the step-in function feature to find the cause of the issue.
Attaching a documentation link for your reference

Plus de réponses (0)

Catégories

En savoir plus sur Debugging and Analysis dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by