cubnm.datasets

Example datasets

load_sc(measure[, parc, sub, norm])

Load example structural connectivity matrix from HCP-YA dataset

load_bold([parc, sub, ses])

Load example BOLD data from the HCP-YA dataset

load_fc([parc, sub, ses, exc_interhemispheric, ...])

Load example FC from the HCP-YA dataset

load_fcd([parc, sub, ses, window_size, window_step, ...])

Load example FCD from the HCP-YA dataset

load_maps(names[, parc, norm])

Loads example heterogeneity maps

cubnm.datasets.load_sc(measure, parc='schaefer-100', sub='group-train706', norm='mean')

Load example structural connectivity matrix from HCP-YA dataset

Parameters

measure: {‘strength’, ‘length’}

Structural connectivity measure.

  • 'strength': SC strength (tract counts)

  • 'length': SC tracts length

parc: str

Parcellation. Currently only 'schaefer-100' is supported.

sub: str

Subject or group ID. Two subjects and two group-averaged matrices are currently included:

  • '100206'

  • '100307'

  • 'group-train706'

  • 'group-test303'

norm: {‘mean’, None}

SC strength normalization method. Only used when measure is 'strength'.

  • 'mean': normalize to mean 0.01. Default

  • None: no normalization

Returns

np.ndarray

Structural connectivity matrix. Shape: (nodes, nodes)

cubnm.datasets.load_bold(parc='schaefer-100', sub='100206', ses='REST1_LR')

Load example BOLD data from the HCP-YA dataset

Parameters

parc: str

Parcellation. Currently only 'schaefer-100' is available.

sub: str

Subject ID. Currently two subjects are included:

  • '100206'

  • '100307'

ses: {‘REST1_LR’, ‘REST2_LR’}

Imaging session.

Returns

np.ndarray

The BOLD signal. Shape: (nodes, volumes)

cubnm.datasets.load_fc(parc='schaefer-100', sub='group-train706', ses='REST', exc_interhemispheric=False, return_tril=True)

Load example FC from the HCP-YA dataset

Parameters

parc: str

Parcellation. Currently only 'schaefer-100' is available.

sub: str

Subject or group ID. Two subjects and two group-averaged matrices are currently included:

  • '100206'

  • '100307'

  • 'group-train706'

  • 'group-test303'

ses: {‘REST1_LR’, ‘REST2_LR’, ‘REST’}

Imaging session. For subject-level data currently only 'REST1_LR', and 'REST2_LR' are included and for group-level data only 'REST' is included. 'REST' includes the data averaged across all sessions.

exc_interhemispheric: bool

Whether to exclude interhemispheric connections. Default: False

return_tril: bool

Whether to return the lower triangular part of the FC matrix.

Returns

np.ndarray

Functional connectivity matrix or its lower triangular part. Shape: (nodes, nodes) or (node_pairs,)

cubnm.datasets.load_fcd(parc='schaefer-100', sub='group-train706', ses='REST', window_size=30, window_step=5, drop_edges=True, exc_interhemispheric=False, return_tril=True)

Load example FCD from the HCP-YA dataset

Parameters

parc: str

Parcellation. Currently only 'schaefer-100' is available.

sub: str

Subject or group ID. Two subjects and two group-averaged matrices are currently included:

  • '100206'

  • '100307'

  • 'group-train706'

  • 'group-test303'

ses: {‘REST1_LR’, ‘REST2_LR’, ‘REST’}

Imaging session. For subject-level data currently only 'REST1_LR', and 'REST2_LR' are included and for group-level data only 'REST' is included. 'REST' includes the data pooled across all sessions.

window_size: int

dynamic FC window size (in seconds) will be converted to N TRs (nearest even number) The actual window size is number of TRs + 1 (including center)

window_step: int

dynamic FC window step (in seconds) will be converted to N TRs

drop_edges: bool

drop edge windows which have less than window_size volumes

exc_interhemispheric: bool

Whether to exclude interhemispheric connections. Default: False

return_tril: bool

Whether to return the lower triangular part of the FCD matrix. Ignored when sub is a group (in this case the return matrix is pooled from FCD lower triangles of individual subjects).

Returns

np.ndarray

Functional connectivity dynamics matrix or its lower triangular part. Shape: (nodes, nodes) or (node_pairs,)

cubnm.datasets.SUPPORTED_MAPS = ('myelinmap', 'fcgradient01', 'yeo7')
cubnm.datasets.SUPPORTED_MAP_PARCS = ('aparc', 'schaefer-100', 'schaefer-200', 'schaefer-400')
cubnm.datasets.load_maps(names, parc='schaefer-100', norm='minmax')

Loads example heterogeneity maps

Parameters

names: str or list

One or more maps selected from this list:

  • 'myelinmap'

  • 'fcgradient01'

  • 'yeo7'

parc: str

Parcellation ('aparc', 'schaefer-100', 'schaefer-200', or 'schaefer-400').

norm: {‘zscore’, ‘minmax’, None}

Map normalization method applied across nodes.

  • 'zscore': maps are z-score normalized

  • 'minmax': maps are min-max normalized to [0, 1]

  • None: no normalization

Returns

np.ndarray

Maps array. Shape: (maps, nodes)

Notes

Maps are prepared with tools/prep_data/prep_maps.py.