wb_command GIFTI output incompatible with MATLAB gifti package

90 views
Skip to first unread message

Madeline Peterson

unread,
Sep 28, 2023, 6:44:36 PM9/28/23
to HCP-Users
Hi, 

I am looking for guidance on an issue reading GIFTI files into MATLAB using the gifti package (https://github.com/ThomasYeoLab/CBIG/blob/08a7c025edc634660872ab136b4212d68106152f/external_packages/matlab/default_packages/cifti-matlab/%40gifti/gifti.m). The error is " [GIFTI] Invalid object construction.". 

GIFTI conversion
The GIFTI files were created by taking HCP dtseries cifti files and converting them to fsaverage6 space through the process described in the HCP Users FAQ #9. The specific command used was: wb_command -metric-resample ${DATA_DIR}/${sub}/sub-${sub}_tstat1_RH.shape.gii ${FSLR_DIR}/fs_LR-deformed_to-fsaverage.R.sphere.32k_fs_LR.surf.gii ${FSAVERAGE_DIR}/fsaverage6_std_sphere.R.41k_fsavg_R.surf.gii ADAP_BARY_AREA ${DATA_DIR}/${sub}/sub-${sub}_tstat1_R_fsaverage6.func.gii -area-metrics ${FSLR_DIR}/fs_LR.R.midthickness_va_avg.32k_fs_LR.shape.gii ${FSAVERAGE_DIR}/fsaverage6.R.midthickness_va_avg.41k_fsavg_R.shape.gii

The files were then binarized with the following command: wb_command -metric-math '(x > 0)' ${DATA_DIR}/${sub}/sub-${sub}_FS6_lang_bin_rh.shape.gii -var x ${DATA_DIR}/${sub}/sub-${sub}_tstat1_R_fsaverage6.func.gii

MATLAB error
Before reading in the file into MATLAB, I was able to successfully view the file in wb_view and it appeared as expected. In MATLAB, I received the error: " [GIFTI] Invalid object construction." The path to the file was correct, and the read/write permissions were set appropriately. In another effort, I attempted to save the GIFTI files as BASE64 Binary using -gifti-convert but this resulted in the same error. 

Interestingly, a similar (but unresolved) issue was also noted on NITRC: https://www.nitrc.org/forum/forum.php?set=custom&forum_id=254&style=nested&max_rows=75

Example file
To replicate the error, I have uploaded an example file to Github: https://github.com/peter3200/trial_repo/blob/master/sub-100206_tstat1_L_fsaverage6.func.gii

Any suggestions or insights would be highly appreciated! Thank you for your time and help!

Sincerely,
Maddy 

Glasser, Matt

unread,
Sep 28, 2023, 6:57:32 PM9/28/23
to hcp-...@humanconnectome.org

Maybe try it with the latest standalone GIFTI package?  Or keep the data in CIFTI and load it in with the cifti-matlab toolbox that does not depend on GIFTI (https://github.com/Washington-University/HCPpipelines/tree/master/global/matlab/cifti-matlab).  This sounds like it is most likely a bug in the GIFTI matlab toolbox. 

 

Matt.

--
You received this message because you are subscribed to the Google Groups "HCP-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hcp-users+...@humanconnectome.org.
To view this discussion on the web visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/02de41b2-4796-4eab-84e9-67a41ec5f840n%40humanconnectome.org.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Rosen, Burke

unread,
Sep 29, 2023, 4:17:39 PM9/29/23
to 'Leah Moreno' via HCP-Users

Madeline Peterson

unread,
Sep 29, 2023, 4:51:19 PM9/29/23
to HCP-Users, bur...@wustl.edu
Thank you both for your suggestions! Using GIfTI version 2.0 did the trick. 

Thanks again, 
Maddy

Reply all
Reply to author
Forward
0 new messages