Dear Developers,
I came across your paper in which you propose a method to enhance the fitting between the simulated functional connectivity (FCsim) and empirical functional connectivity (FCemp) by adding a small number of connections across the hemispheres. However, I was unable to find any code or demo related to this approach.
I have attempted to implement this on my own, but it seems there is something wrong with my implementation. Would you be able to help me correct it or provide information on where I can find a demo or code related to this method?
Thank you very much for your time and assistance. Below is the code I have written so far:
Best regards,
Joey
###get simulated_FC_new every iter, than
updated_SC = SC_matrix.copy()
for i in range(n_regions):
for j in range(i+1, n_regions):
if abs(empirical_FC[i, j] - simulated_FC_new[i,j]) > tolerance:
change_map[i,j] = 1
change_map[j,i] = 1
if empirical_FC[i, j] > 0:
updated_SC[i, j] = max_acter * empirical_FC[i, j]
updated_SC[j, i] = updated_SC[i, j]
else:
if SC_matrix[i, j] != 0:
updated_SC[i, j] = min_acter
updated_SC[j, i] = updated_SC[i, j]
SC_matrix = updated_SC.copy()
plt.figure(figsize=(8,6))
sns.heatmap(change_map, vmin=0, vmax=1, cmap='coolwarm', annot=False, cbar=True)
plt.savefig("{}/opt_0.15_n/change_map{}.png".format(save_dir,iteration), dpi=300)
tolerance = np.around(initial_tolerance * (1 - (iteration / (iterations-1))),3)
tolerances_revieve.append(tolerance)
print(f"Iteration {iteration}, Correlation: {new_correlation:.4f}, Tolerance: {tolerance:.4f}")