Closed milad7093 closed 1 year ago
Dear Milad,
You can do it using the networkx
library as follows:
import networx as nx
conn_mats = {}
connectivity_weights = ['FA_mean', 'ADC_mean', 'number_of_fibers']
G = nx.read_gpickle('path/to/connectome.gpickle')
for weight in connectivity_weights:
conn_mats[weight] = nx.to_numpy_array(G, weight=weight)
which will store in conn_mats['FA_mean']
, conn_mats['ADC_mean']
, and conn_mats['number_of_fibers']
each of the connectivity matrices.
You can have an example on how to handle the connectome file here in the documentation.
Hope this helps, Best, Seb
Dear Sebastian
I have just gotten some outputs of cmp3 (connectivity matrices) in the gpickle format and need to extract connectivity matrices base on the following parameters: fa mean adc mean number of fibers
Can you help me?
Please help me
Thanks in advance
Best regards,
-Milad