Skip to main content

Function to Structure Coupling (FSC)

Project description

FSC (Function–Structure Coupling)

FSC is a Python implementation of the Function–Structure Coupling model, an edge-centric framework for analyzing brain connectivity using constrained Laplacians.

The method links functional connectivity (FC) and structural connectivity (SC) by solving a network flow model that explains functional interactions through structural pathways.


Installation

Install FSC from PyPI:

pip install fscpy

Import in Python:

from fsc import FSC

Overview

FSC formulates function-structure coupling as a constrained network problem:

  • Functional connectivity (FC) defines pairwise constraints (imposed potential differences)
  • Structural connectivity (SC) defines the network topology and weights
  • The model solves for nodal potentials (φ) and edge-level currents (I)

Mathematically:

I_ij = SC_ij * (φ_i - φ_j)

where:

  • φ = nodal potentials
  • SC = structural connectivity (weights)
  • I = edge-level current (flow)

Quick Example

from enigmatoolbox.datasets import load_sc, load_fc
from fsc import FSC

# Load connectivity matrices
fc_ctx, _, _, _ = load_fc()
sc_ctx, _, _, _ = load_sc()

# Run FSC model
fsc = FSC(FC=fc_ctx, SC=sc_ctx)

# Get outputs
phi = fsc.get_nodal_potentials()
edge_currents = fsc.get_edge_currents()

Outputs

Main methods:

  • get_nodal_potentials()
    → Nodal potentials (φ)

  • get_edge_currents()
    → Edge-level currents (I)

  • get_voltage_difference_matrix()
    → Pairwise potential differences (φ_i − φ_j)

  • get_graph_laplacian()
    → Structural graph Laplacian

  • get_streamline_currents()
    → Streamline-wise currents (for tractography applications)


Examples

See the examples/ directory for:

  • ENIGMA Toolbox example
  • Visualization scripts

Run an example:

python examples/enigma_example.py

Optional Dependencies

Some examples require additional packages:

pip install enigmatoolbox nilearn

Notes

  • FC is interpreted as imposed pairwise potential differences
  • SC is treated as a weighted adjacency matrix (conductance)
  • Only the upper triangle of FC is used to define constraints
  • The model uses Modified Nodal Analysis (MNA)

Applications

FSC can be used for:

  • Studying function-structure coupling in brain networks
  • Identifying structural pathways supporting functional connectivity
  • Network flow analysis on connectomes
  • Tractography filtering and visualization

Reference

Sairanen, Viljami.
From nodes to pathways: an edge-centric model of brain function-structure coupling via constrained Laplacians
https://doi.org/10.1101/2024.03.03.583186


Author

Viljami Sairanen


License

MIT License (see LICENSE file)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fscpy-1.0.1.tar.gz (45.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fscpy-1.0.1-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

File details

Details for the file fscpy-1.0.1.tar.gz.

File metadata

  • Download URL: fscpy-1.0.1.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for fscpy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5fd0d79f0b549d92521638758ccc444c5a3aa334323bcf49960b0e68431eb95b
MD5 f163c563358d7f7b8e231040a1824154
BLAKE2b-256 ae02f72641ea1920e14df202ef42f855d6c1f0f61e9582a337fb2dd53bb5b262

See more details on using hashes here.

File details

Details for the file fscpy-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: fscpy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 33.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for fscpy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da34037a56c6e75ee50c02e2e376dff42ce112146364853772b167ec59cdd7d6
MD5 e48796df1a8c493c2eaddaa283574bc7
BLAKE2b-256 be33fa739160d00b372f053d13ff9dff4cb042b4213358884a4d76fc4383d5e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page