Washington-University / cifti-matlab

MATLAB code for reading and writing CIFTI connectivity files
Other
65 stars 19 forks source link

Error in read_gifti_file_standalone #4

Closed Yangguoyuan closed 5 years ago

Yangguoyuan commented 5 years ago

Dear cifti-matlab experts, When I use the read_gifti_file_standalone to read my xxx.shape.gii file, which is a metric file in HCP workbench version. There some error. the command is matrix=read_gifti_file_standalone('/xxx/xxx.shape.gii','data') error: Reference to non-existent field 'data'. Error in read_gifti_file_standalone (line 48) this.data{end+1} = gifti_DataArray(t,uid(i),filename); I don't know what's wrong. When I execute structure=gifti('/xxx/xxx.shape.gii') the return is: val = cdata: [32492x1 single]

Anyone can help me?

Best Guoyuan

coalsont commented 5 years ago

read_gifti_file_standalone from the HCP pipelines uses the matlab gifti toolbox (https://www.artefact.tk/software/matlab/gifti/), not this cifti matlab code.

What version of the gifti toolbox do you have installed? I wasn't aware of any version of it that returned the data array itself, rather than a struct/class.

coalsont commented 5 years ago

Oh, I read that wrong. Apparently the struct field is named "cdata", while the code is expecting "data". I wonder if this is a recent change in the toolbox...

coalsont commented 5 years ago

I still had it wrong. The documentation of read_gifti_file_standalone:

% Low level reader of GIfTI 1.0 files
% FORMAT this = read_gifti_file(filename, this)
% filename    - XML GIfTI filename
% this        - structure with fields 'metaData', 'label' and 'data'.

It doesn't look like you are supposed to pass a string as the second argument, or in fact use this function directly at all. Just use input = gifti('<filename>'); instead, your data will be in input.cdata. I assume that the use of read_gifti_file_standalone was from your own code, and not from an HCP pipeline script?

Note that hcp-users@humanconnectome.org is the general place to ask help questions about using HCP data (sign up on the bottom right at https://www.humanconnectome.org/contact-us), github issues are meant for bugs in the specific code contained in the given repository.

Yangguoyuan commented 5 years ago

Hi Coalsont: Thanks for your answer. I know the gifti.m can read the shape.gii/surf.gii files. This issue was from FSL PALM. First, I have two groups of xxx.shape.gii metrix files, then I want to do permutation test using fsl PALM. The first step of PALM was read the gifti file in for next statistic calculation. But there return error about reading gifti file using the read_gifti_file.m which is the same as read_gifti_file_standalone error: error: /guoyuan_data/software/palm-alpha115/fileio/@gifti/private/read_gifti_file.m at line 17, column 5 error: /guoyuan_data/software/palm-alpha115/fileio/@gifti/gifti.m at line 89, column 22 error: /guoyuan_data/software/palm-alpha115/palm_miscread.m at line 284, column 13 error: /guoyuan_data/software/palm-alpha115/palm_ready.m at line 47, column 10 error: /guoyuan_data/software/palm-alpha115/palm_takeargs.m at line 1644, column 72 error: /guoyuan_data/software/palm-alpha115/palm_core.m at line 33, column 11 error: /guoyuan_data/software/palm-alpha115/palm.m at line 81, column 1

Second, I thought this error was caused by read_gifti_file.m couldn't read my xxx.shape.gii. So I using run the read_gifti_file_standalone.m on my linux system alone. I found this m file couldn't read my xxx.shape.gii file. So I ask question here, I just wonder how using read_gifti_file_standalone.m to read xxx.shape.gii file. Or is my write wrong? So how do you use this m file?

Best Guoyuan

coalsont commented 5 years ago

Your error text is missing the actual error message. I don't know what to do in PALM, and very few people will have seen a bug report here. Please use either the FSL list (https://www.jiscmail.ac.uk/cgi-bin/webadmin?A0=fsl , "subscribe" at the top) or the hcp-users list (https://www.humanconnectome.org/contact-us , lower right) to post your problem.