Kong 2022 Areal_level MS-HBM pipeline: generate the gradient prior error

31 views
Skip to first unread message

Ruyi Pan

unread,
Jul 6, 2025, 3:40:57 PM7/6/25
to CBIG users
Hi,

I am trying to run the provided examples. However, I faced an error when generating the gradient prior to using the example code provided on GitHub. I am wondering what could be the potential issues and how to solve it? The following is the error message from matlab:
#########################
#Compute distance matrix#
#########################
Construct graph ...
Error using matlab.internal.graph.MLGraph
Duplicate edges not supported.
Error in matlab.internal.graph.constructFromEdgeList (line 125)
G = underlyingCtor(double(s), double(t), totalNodes);
Error in graph (line 293)
                matlab.internal.graph.constructFromEdgeList(...
Error in CBIG_SPGrad_create_graph (line 27)
        G = graph(verts(mask), neighbors(mask), grad_weight);
Error in CBIG_SPGrad_generate_gradient_matrix (line 117)
lh_G = CBIG_SPGrad_create_graph(lh_surf, lh_grad_edge);
Error in CBIG_ArealMSHBM_generate_gradient (line 180)
        CBIG_SPGrad_generate_gradient_matrix(mesh, medial_mask, downsample, out_gradient_dir);

Another question is, I saw the group priors only provided for gMSHBM. I am wondering if I can use this prior to the dMSHBM or cMSHBM? Or is it possible to publish the group priors for the two models?

Thank you,
Ruyi Pan

Ruby Kong

unread,
Jul 17, 2025, 5:18:07 AM7/17/25
to Ruyi Pan, CBIG users
Hi Ruyi,

I think this error happens for newer Matlab version it doesn't allow for duplicate edges in the graph, in our case we construct the graph between each pair of neighboring vertices, so we will have case like build edge between vertex 1 to it's neighbor vertex 100, and also build edge between vertex 100 to it's neighbor vetrx 1. I think the newer version matlab doesn't allow this anymore.

Are you able to use Matlab2018?

Which surface are you working on? Our dMSHBM and cMSHBM is only available for 400 resolution and fslr32k. 


--
You received this message because you are subscribed to the Google Groups "CBIG users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cbig_users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cbig_users/2d143d76-2f7d-4b62-bc09-b0dd2c695194n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages