brain-networks/edge-centric_demo

surface plot seems not working

Closed this issue · 2 comments

Hi thank you for sharing the code.
When I ran through the code, it seems the last bit of the codes not working for me.
It gave the following error, sr and sl seem not to have data.
Error using gifti/subsref (line 24)
Reference to non-existent field 'data'.
Did I miss some dependencies to make it work?

Hi! Thanks for your interest in our code, and thanks for helping us make the example script more robust. I think the error you are seeing is actually because the gifti is in your path.. whereas the code, as of now, assumes do you not have the gifti repo in your path.

try these lines for plotting the surface:

figure, th = trisurf(sr.faces,sr.vertices(:,1),sr.vertices(:,2),sr.vertices(:,3),cr);
set(th,'edgecolor','none'); axis image; set(gca,'clim',[min(enorm_rank),max(enorm_rank)]);
colormap(cmap); colorbar;

figure, th = trisurf(sl.faces,sl.vertices(:,1),sl.vertices(:,2),sl.vertices(:,3),cl);
set(th,'edgecolor','none'); axis image; set(gca,'clim',[min(enorm_rank),max(enorm_rank)]);
colormap(cmap); colorbar;

Let me know if that works! If it does work, then I'll try to write sometime that detects if gifti is in the file path or something like that... (or at least add a comment to clarify)...

Thank you@faskowit for quick response. That works now.
I think the code you provided here is the right one to generate surf plots with sr and sl loaded from the surfinfo.mat.