osl_dynamics.utils#

Utility and helper functions.

Modules#

  • array_ops — Array operations (covariance ↔ correlation conversions, matrix decompositions, etc.).

  • filenamesOSLFilenames for managing pipeline file paths.

  • logger — Logging utilities for pipeline scripts.

  • misc — Miscellaneous helpers (random seeds, FSL setup, YAML loading).

  • model — Model I/O utilities (saving/loading configs and weights).

  • plotting — Plotting functions (brain surfaces, power maps, PSDs, state time courses, networks).

  • sklearn_wrappers — Scikit-learn compatible wrappers for osl-dynamics models.

  • topoplots — Sensor-space topographic plots.

  • workbench — HCP Workbench integration for cortical surface visualisation.

Functions#

set_random_seed(seed[, op_determinism])

Set all random seeds.

setup_fsl(directory)

Setup FSL.

Package Contents#

osl_dynamics.utils.set_random_seed(seed, op_determinism=False)[source]#

Set all random seeds.

This includes Python’s random module, NumPy and TensorFlow.

Parameters:
  • seed (int) – Random seed.

  • op_determinism (bool, optional) – Whether to enable operation determinism in TensorFlow. If True, TensorFlow operations will be deterministic, generally at the cost of lower performance. Note that the model may run slower if enabled.

Return type:

None

osl_dynamics.utils.setup_fsl(directory)[source]#

Setup FSL.

Parameters:

directory (str) – Path to FSL installation.