History of brain_coactivation
The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.
[entries] Add the date when each entry was added, and remove icon_hash beff7c9
The dates are those of the commits that first added the entries' files (2020-08-11 for the entries of the initial commit); renamed entries keep the date of their first name. Changed: none
diff --git a/entries/brain_coactivation/__init__.py b/entries/brain_coactivation/__init__.py
index fefb1e8..2fc9300 100644
--- a/entries/brain_coactivation/__init__.py
+++ b/entries/brain_coactivation/__init__.py
@@ -33,7 +33,7 @@ tags = ['Biological', 'Connectome', 'Weighted', 'Metadata']
url = 'https://sites.google.com/site/bctnet/datasets-and-demos'
citation = [('N. A. Crossley, A. Mechelli, P. E. Vértes, T. T. Winton-Brown, A. X. Patel, C. E. Ginestet, P. McGuire, E. T. Bullmore, "Cognitive relevance of the community structure of the human brain functional coactivation network." Proceedings of the National Academy of Sciences 110(28), 11583-11588 (2013)', 'https://doi.org/10.1073/pnas.1220826110'),
('M. Rubinov, O. Sporns, "Complex network measures of brain connectivity: Uses and interpretations." NeuroImage 52(3), 1059-1069 (2010)', 'https://doi.org/10.1016/j.neuroimage.2009.10.003')]
-icon_hash = '56a85c8e26855e083a2f792b'
+date_added = '2026-10-25'
upstream_license = None
# The files are no longer available from the Brain Connectivity Toolbox site
# (its file attachments were lost when the site was migrated); they are
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) bc3dbbd
The lists of properties at the end of the descriptions marked edge properties with "Edge" but left node properties unmarked, or grouped them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property was often unclear. Every item now starts with (Node), (Edge) or (Graph), followed by the property names, a colon and the explanation, one item per property or group of properties; qualifications (kinds of nodes, networks) follow the names in parentheses. Properties that were only named got a short explanation, and a few items that named the wrong kind of property were corrected.
diff --git a/entries/brain_coactivation/__init__.py b/entries/brain_coactivation/__init__.py
index 6ff4f34..fefb1e8 100644
--- a/entries/brain_coactivation/__init__.py
+++ b/entries/brain_coactivation/__init__.py
@@ -27,8 +27,8 @@ description = """Weighted networks of 638 regions of the human brain (the gray m
The networks have the following properties:
-- Nodes: `coord`, the (x, y, z) coordinates of the region in standard stereotactic space, in millimeters (the regions have no names in the source data).
-- Edges: `weight`, the Jaccard index of coactivation (`coactivation`), or the group-average Fisher-transformed correlation (`rsfmri`)."""
+- (Node) `coord`: the (x, y, z) coordinates of the region in standard stereotactic space, in millimeters (the regions have no names in the source data).
+- (Edge) `weight`: the Jaccard index of coactivation (`coactivation`), or the group-average Fisher-transformed correlation (`rsfmri`)."""
tags = ['Biological', 'Connectome', 'Weighted', 'Metadata']
url = 'https://sites.google.com/site/bctnet/datasets-and-demos'
citation = [('N. A. Crossley, A. Mechelli, P. E. Vértes, T. T. Winton-Brown, A. X. Patel, C. E. Ginestet, P. McGuire, E. T. Bullmore, "Cognitive relevance of the community structure of the human brain functional coactivation network." Proceedings of the National Academy of Sciences 110(28), 11583-11588 (2013)', 'https://doi.org/10.1073/pnas.1220826110'),
[entries] Remove unneeded code from the entries 2c69f19
Unneeded "global files" statements, unused imports and variables, f-strings without placeholders, duplicate keys in foodweb_little_rock (keeping the order and the values used), and the second definition of get_lines() in twitter_higgs. Nothing changes in the networks or descriptions. Changed: none
diff --git a/entries/brain_coactivation/__init__.py b/entries/brain_coactivation/__init__.py
index bdc701f..6ff4f34 100644
--- a/entries/brain_coactivation/__init__.py
+++ b/entries/brain_coactivation/__init__.py
@@ -56,7 +56,6 @@ def fetch_upstream(force=False):
@coerce_props()
@annotate()
def parse(alts=None):
- global files
name = __name__.split(".")[-1]
for fname, alt, key in files:
if alts is not None and alt not in alts:
[entries] Use American spelling in the descriptions 802d564
British spellings in the titles and descriptions of 69 entries (e.g. labelled, organisation, millimetres, centres, anonymised, neighbours, analysed, modelled, colour, licence) are replaced by the American ones. Proper names keep their spelling (Otago Harbour, the Centre for Water Systems, the Centre jeunesse de Montréal, the Dutch Ministry of Defence), as do quoted upstream terms, citations, and property names.
diff --git a/entries/brain_coactivation/__init__.py b/entries/brain_coactivation/__init__.py
index 40eb694..bdc701f 100644
--- a/entries/brain_coactivation/__init__.py
+++ b/entries/brain_coactivation/__init__.py
@@ -20,14 +20,14 @@ from .. import *
from scipy.io import loadmat
title = "Human brain functional coactivation and resting-state networks (2013)"
-description = """Weighted networks of 638 regions of the human brain (the grey matter excluding the cerebellum, parcellated into regions of similar size that respect anatomical landmarks), from Crossley et al., as distributed with the Brain Connectivity Toolbox. Nodes are brain regions, and an undirected edge connects two regions with strong functional coactivation or connectivity, as defined below.
+description = """Weighted networks of 638 regions of the human brain (the gray matter excluding the cerebellum, parcellated into regions of similar size that respect anatomical landmarks), from Crossley et al., as distributed with the Brain Connectivity Toolbox. Nodes are brain regions, and an undirected edge connects two regions with strong functional coactivation or connectivity, as defined below.
-- `coactivation`: the functional coactivation network, from a meta-analysis of the BrainMap database comprising 6,884 task-related contrasts from 1,641 functional MRI and PET studies of healthy adults published between 1985 and 2010. Each reported activation was modelled as a 1 cm³ sphere around its coordinates, and a region was considered activated by a contrast if at least 20% of a sphere overlapped it. Two regions are connected if their coactivation, measured by the Jaccard index (the number of contrasts activating both regions divided by the number of contrasts activating either), is significantly larger than expected by chance (P < 0.01, false-discovery-rate corrected).
+- `coactivation`: the functional coactivation network, from a meta-analysis of the BrainMap database comprising 6,884 task-related contrasts from 1,641 functional MRI and PET studies of healthy adults published between 1985 and 2010. Each reported activation was modeled as a 1 cm³ sphere around its coordinates, and a region was considered activated by a contrast if at least 20% of a sphere overlapped it. Two regions are connected if their coactivation, measured by the Jaccard index (the number of contrasts activating both regions divided by the number of contrasts activating either), is significantly larger than expected by chance (P < 0.01, false-discovery-rate corrected).
- `rsfmri`: the resting-state functional connectivity network of the same regions, from 3T functional MRI scans of 27 healthy volunteers (5 min, eyes closed). The Pearson correlations between the band-pass filtered (0.01-0.1 Hz) regional time series were Fisher-transformed and averaged over the volunteers, and two regions are connected if their correlation is among the strongest, keeping as many edges as in the coactivation network. Two regions have no connections in this network.
The networks have the following properties:
-- Nodes: `coord`, the (x, y, z) coordinates of the region in standard stereotactic space, in millimetres (the regions have no names in the source data).
+- Nodes: `coord`, the (x, y, z) coordinates of the region in standard stereotactic space, in millimeters (the regions have no names in the source data).
- Edges: `weight`, the Jaccard index of coactivation (`coactivation`), or the group-average Fisher-transformed correlation (`rsfmri`)."""
tags = ['Biological', 'Connectome', 'Weighted', 'Metadata']
url = 'https://sites.google.com/site/bctnet/datasets-and-demos'
[entries] New entry: brain_coactivation 2c06466
diff --git a/entries/brain_coactivation/__init__.py b/entries/brain_coactivation/__init__.py
new file mode 100644
index 0000000..40eb694
--- /dev/null
+++ b/entries/brain_coactivation/__init__.py
@@ -0,0 +1,75 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+from scipy.io import loadmat
+
+title = "Human brain functional coactivation and resting-state networks (2013)"
+description = """Weighted networks of 638 regions of the human brain (the grey matter excluding the cerebellum, parcellated into regions of similar size that respect anatomical landmarks), from Crossley et al., as distributed with the Brain Connectivity Toolbox. Nodes are brain regions, and an undirected edge connects two regions with strong functional coactivation or connectivity, as defined below.
+
+- `coactivation`: the functional coactivation network, from a meta-analysis of the BrainMap database comprising 6,884 task-related contrasts from 1,641 functional MRI and PET studies of healthy adults published between 1985 and 2010. Each reported activation was modelled as a 1 cm³ sphere around its coordinates, and a region was considered activated by a contrast if at least 20% of a sphere overlapped it. Two regions are connected if their coactivation, measured by the Jaccard index (the number of contrasts activating both regions divided by the number of contrasts activating either), is significantly larger than expected by chance (P < 0.01, false-discovery-rate corrected).
+- `rsfmri`: the resting-state functional connectivity network of the same regions, from 3T functional MRI scans of 27 healthy volunteers (5 min, eyes closed). The Pearson correlations between the band-pass filtered (0.01-0.1 Hz) regional time series were Fisher-transformed and averaged over the volunteers, and two regions are connected if their correlation is among the strongest, keeping as many edges as in the coactivation network. Two regions have no connections in this network.
+
+The networks have the following properties:
+
+- Nodes: `coord`, the (x, y, z) coordinates of the region in standard stereotactic space, in millimetres (the regions have no names in the source data).
+- Edges: `weight`, the Jaccard index of coactivation (`coactivation`), or the group-average Fisher-transformed correlation (`rsfmri`)."""
+tags = ['Biological', 'Connectome', 'Weighted', 'Metadata']
+url = 'https://sites.google.com/site/bctnet/datasets-and-demos'
+citation = [('N. A. Crossley, A. Mechelli, P. E. Vértes, T. T. Winton-Brown, A. X. Patel, C. E. Ginestet, P. McGuire, E. T. Bullmore, "Cognitive relevance of the community structure of the human brain functional coactivation network." Proceedings of the National Academy of Sciences 110(28), 11583-11588 (2013)', 'https://doi.org/10.1073/pnas.1220826110'),
+ ('M. Rubinov, O. Sporns, "Complex network measures of brain connectivity: Uses and interpretations." NeuroImage 52(3), 1059-1069 (2010)', 'https://doi.org/10.1016/j.neuroimage.2009.10.003')]
+icon_hash = '56a85c8e26855e083a2f792b'
+upstream_license = None
+# The files are no longer available from the Brain Connectivity Toolbox site
+# (its file attachments were lost when the site was migrated); they are
+# obtained from the Internet Archive.
+upstream_prefix = 'https://web.archive.org/web/2020id_/https://sites.google.com/site/bctnet/Home/functions'
+files = [('Coactivation_matrix.mat', 'coactivation', 'Coactivation_matrix'),
+ ('GroupAverage_rsfMRI_matrix.mat', 'rsfmri', 'GroupAverage_rsfMRI')]
+archived_urls = {
+ 'Coactivation_matrix.mat':
+ 'https://web.archive.org/web/20201022115529id_/https://sites.google.com/site/bctnet/Home/functions/Coactivation_matrix.mat?attredirects=0',
+ 'GroupAverage_rsfMRI_matrix.mat':
+ 'https://web.archive.org/web/20201022115224id_/https://sites.google.com/site/bctnet/Home/functions/GroupAverage_rsfMRI_matrix.mat?attredirects=0&d=1'}
+
+def fetch_upstream(force=False):
+ # The Internet Archive URLs carry a query string, so the files are
+ # fetched from them directly.
+ return fetch_archived_files(__name__.split(".")[-1], archived_urls, force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+ global files
+ name = __name__.split(".")[-1]
+ for fname, alt, key in files:
+ if alts is not None and alt not in alts:
+ continue
+ with open_upstream_file(name, fname, "rb", seekable=True) as f:
+ m = loadmat(f)
+ A = m[key]
+ N = A.shape[0]
+ g = Graph(directed=False)
+ g.add_vertex(N)
+ i, j = numpy.nonzero(numpy.triu(A, 1))
+ g.ep.weight = g.new_ep("double")
+ g.add_edge_list(numpy.column_stack((i, j, A[i, j])), eprops=[g.ep.weight])
+ g.vp.coord = g.new_vp("vector<double>")
+ g.vp.coord.set_2d_array(numpy.asarray(m["Coord"], dtype="float").T)
+ yield alt, g