NeuroConn.gradient package

Submodules

NeuroConn.gradient.gradient module

NeuroConn.gradient.gradient.align_gradients(gradients, n_components, custom_ref=None, *args)[source]

Aligns gradients to a reference set of gradients using Procrustes alignment.

Parameters:
  • gradients (str or numpy.ndarray) – The gradients to align.

  • n_components (int) – The number of components to use from the reference gradients.

  • custom_ref (str or numpy.ndarray, optional) – The reference gradients to align to. If None, the default Margulies et al. (2016) gradients will be used. Default is None.

  • *args – Additional arguments to pass to ProcrustesAlignment.

Returns:

The aligned gradients.

Return type:

numpy.ndarray

NeuroConn.gradient.gradient.get_gradients(data, subject, n_components, task, parcellation='schaefer', n_parcels=1000, kernel='cosine', approach='pca', from_mat=True, aligned=True, save=True, save_to=None)[source]

Computes gradients from the subject connectivity matrix.

Parameters:
  • data (str or FmriPreppedDataSet) – The path to the data or the FmriPreppedDataSet object.

  • subject (str) – The subject ID.

  • n_components (int) – The number of components to extract.

  • task (str, optional) – The task name. Default is ‘rest’.

  • parcellation (str, optional) – The parcellation name. Default is ‘schaefer’.

  • n_parcels (int, optional) – The number of parcels. Default is 1000.

  • kernel (str, optional) – The kernel to use. Default is ‘cosine’.

  • approach (str, optional) – The approach to use. Default is ‘pca’.

  • from_mat (bool, optional) – Whether to load the data from a .mat file. Default is True.

  • aligned (bool, optional) – Whether to align the gradients to the Margulies et al. (2016) gradients. Default is True.

  • save (bool, optional) – Whether to save the gradients. Default is True.

  • save_to (str, optional) – The path to save the gradients. Default is None.

Returns:

The computed gradients.

Return type:

numpy.ndarray

Module contents