gllmflndn / gifti

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

How to write a 2D matrix into gii file in matlab? #13

Open vidasun opened 11 months ago

vidasun commented 11 months ago

Hi! I used the gii.cdata matrix to perform filtering. And after that, I wondered if there's any way to write this 2D matrix into a new gii file.?I've looked at the example in tutorial and it seemed the isosurface function can only be used on 3D data. Thanks!

gllmflndn commented 11 months ago

Hi @vidasun, If I understand you correctly, you can use the .cdata field to store your 2D array and have it saved in a new GIfTI file, e.g.:

g = gifti;
g.cdata = rand(256,16);
save(g,'data.gii')