code: def get_connectivity_matrix(n_rois, list_of_roi_crossed_lists):
      connectivity_matrix = np.zeros((n_rois, n_rois), dtype=np.uint)
      for rois_crossed in list_of_roi_crossed_lists:
          for idx_i, roi_i in enumerate(rois_crossed):
              for idx_j, roi_j in enumerate(rois_crossed):
                  if idx_i > idx_j:
                      if not roi_i == roi_j:
                          connectivity_matrix[roi_i - 1, roi_j - 1] += 1
      connectivity_matrix = connectivity_matrix + connectivity_matrix.T
      return connectivity_matrix
  
imports: import pickle
  import os.path
  import numpy
  import nibabel
  import networkx
  from ...None import logging
  from ...utils.filemanip import split_filename
  from ..base import BaseInterface, BaseInterfaceInputSpec, traits, File, TraitedSpec, Directory, OutputMultiPath, isdefined
label_desc: Use image node_id 3 for calling a global function with example usage: get_connectivity_matrix(n_rois, list_of_roi_crossed_lists) and returns: connectivity_matrix