gllmflndn / gifti

MATLAB/Octave GIfTI Library
https://www.gllmflndn.com/software/matlab/gifti/
MIT License
25 stars 12 forks source link

Trouble opening gifti files saved with the gifti toolbox in CAT12 display results #4

Closed MartinGell closed 4 years ago

MartinGell commented 4 years ago

Good afternoon,

My apologies if this doesn't belong here, but I am unsure where else I should ask.

I need to edit some the thickness data stored in the cdata of gifti files resulting from CAT12 cortical thickness estimation and am having trouble opening the gifti files with the edited cdata in CAT12, saved using the save function of the gifti toolbox. CAT12 throws an error related to xmlparser or xmltree functions (error message below), depending on what system I try this on (Ubuntu and Windows errors respectively).

To make sure this error is not due to my manipulation of the cdata in the gifti files, I tried simply opening (using gifti() function) and then immediately saving (save() function) a gifti file that is possible to open in CAT12 'display results' function without any problem. However, after doing this simple load and save, I get the same error. This makes me think that there is some information loss when saving the gifti files in the toolbox that makes it impossible for CAT12 to open them.

Is there a way to rectify this?

Please note that I tried saving with all possible encoding options and the problem still persists.

Error message in CAT12 when trying to load the loaded and immediately saved gifti file on Windows: Warning: [GIFTI] Parsing of XML file C:\Users\Martin Gell\Desktop\M&B\Classes\Matlab\Toolboxes\spm12\toolbox\cat12\templates_surfaces.mc.freesurfer.gii failed.

In read_gifti_file (line 17) In gifti (line 108) In cat_surf_results>display_results_all (line 1129) In cat_surf_results (line 511) In cat_surf_results>select_data (line 1663) Error using xmltree (line 47) [XMLTree] Cannot open C:\Users\Martin Gell\Desktop\M&B\Classes\Matlab\Toolboxes\spm12\toolbox\cat12\templates_surfaces.mc.freesurfer.gii

Error in xmltree (line 47) error(['[XMLTree] Cannot open ' varargin{1}]);

Error in read_gifti_file (line 15) t = xmltree(filename);

Error in gifti (line 108) this = read_gifti_file(varargin{1},giftistruct);

Error in cat_surf_results>display_results_all (line 1129) g1 = gifti(fullfile(spm('dir'), 'toolbox', 'cat12', ['templates_surfaces' H.str32k], [H.S{i}.info(1).side '.mc.freesurfer.gii']));

Error in cat_surf_results (line 511) display_results_all;

Error in cat_surf_results>select_data (line 1663) cat_surf_results('disp', H.S{1}.name, H.S{2}.name);

Error while evaluating DestroyedObject Callback.

gllmflndn commented 4 years ago

Hi @MartinGell, sorry, I had missed your report. As you found out, this is something specific to CAT12: https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=SPM;e20f02b9.2004