datatypes Package

TVB DataTypes, as a dictionary between multiple algorithms.

connectivity

The Connectivity datatype.

class tvb.datatypes.connectivity.Connectivity(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.connectivity.Connectivity]

Attributes declared

region_labelstvb.datatypes.connectivity.Connectivity.region_labels = NArray(label=’Region labels’, dtype=<U128, default=None, dim_names=(), ndim=None, required=True)

Short strings, ‘labels’, for the regions represented by the connectivity matrix.

weightstvb.datatypes.connectivity.Connectivity.weights = NArray(label=’Connection strengths’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

Matrix of values representing the strength of connections between regions, arbitrary units.

undirectedtvb.datatypes.connectivity.Connectivity.undirected = Attr(field_type=<class ‘bool’>, default=False, required=False)

1, when the weights matrix is square and symmetric over the main diagonal, 0 when directed graph.

tract_lengthstvb.datatypes.connectivity.Connectivity.tract_lengths = NArray(label=’Tract lengths’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

The length of myelinated fibre tracts between regions. If not provided Euclidean distance between region centres is used.

speedtvb.datatypes.connectivity.Connectivity.speed = NArray(label=’Conduction speed’, dtype=float64, default=array([3.]), dim_names=(), ndim=None, required=True)

A single number or matrix of conduction speeds for the myelinated fibre tracts between regions.

centrestvb.datatypes.connectivity.Connectivity.centres = NArray(label=’Region centres’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array specifying the location of the centre of each region.

corticaltvb.datatypes.connectivity.Connectivity.cortical = NArray(label=’Cortical’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

A boolean vector specifying whether or not a region is part of the cortex.

hemispherestvb.datatypes.connectivity.Connectivity.hemispheres = NArray(label=’Hemispheres (True for Right and False for Left Hemisphere’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

A boolean vector specifying whether or not a region is part of the right hemisphere

orientationstvb.datatypes.connectivity.Connectivity.orientations = NArray(label=’Average region orientation’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

Unit vectors of the average orientation of the regions represented in the connectivity matrix. NOTE: Unknown data should be zeros.

areastvb.datatypes.connectivity.Connectivity.areas = NArray(label=’Area of regions’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

Estimated area represented by the regions in the connectivity matrix. NOTE: Unknown data should be zeros.

idelaystvb.datatypes.connectivity.Connectivity.idelays = NArray(label=’Conduction delay indices’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)

An array of time delays between regions in integration steps.

delaystvb.datatypes.connectivity.Connectivity.delays = NArray(label=’Conduction delay’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

Matrix of time delays between regions in physical units, setting conduction speed automatically combines with tract lengths to update this matrix, i.e. don’t try and change it manually.

number_of_regionstvb.datatypes.connectivity.Connectivity.number_of_regions = Int(field_type=<class ‘int’>, default=0, required=True)

The number of regions represented in this Connectivity

number_of_connectionstvb.datatypes.connectivity.Connectivity.number_of_connections = Int(field_type=<class ‘int’>, default=0, required=True)

The number of non-zero entries represented in this Connectivity

parent_connectivity : tvb.datatypes.connectivity.Connectivity.parent_connectivity = Attr(field_type=<class ‘str’>, default=None, required=False)

saved_selection : tvb.datatypes.connectivity.Connectivity.saved_selection = List(of=<class ‘int’>, default=(), required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

areas

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

property binarized_weights
Returns:

a matrix of he same size as weights, with 1 where weight > 0, and 0 in rest

centres

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

centres_annular(number_of_regions=4, max_radius=77.0, min_radius=13.0, mu=3.141592653589793, kappa=0.5235987755982988)[source]

The nodes are lying inside an annulus.

centres_cubic(number_of_regions=4, max_radius=42.0, flat=False)[source]

The nodes are positioined in a 3D grid inside the cube centred at the origin and with edges parallel to the axes, with an edge length of 2*max_radius.

centres_spherical(number_of_regions=4, max_radius=42.0, flat=False)[source]

The nodes positions are distributed on a sphere. See: http://mathworld.wolfram.com/SphericalCoordinates.html

If flat is true, then theta=0.0, the nodes are lying inside a circle.

r : radial theta: azimuthal polar: phi

centres_toroidal(number_of_regions=4, max_radius=77.0, min_radius=13.0, mu=3.141592653589793, kappa=0.5235987755982988)[source]

The nodes are lying on a torus. See: http://mathworld.wolfram.com/Torus.html

compute_region_labels()[source]

Compute some labers, if missing

compute_tract_lengths()[source]

If no tract lengths data are available, this can be used to calculate the Euclidean distance between region centres to use as a proxy.

configure()[source]

Invoke the compute methods for computable attributes that haven’t been set during initialization.

cortical

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

create_region_labels(mode='numeric')[source]

Assumes weights already exists

delays

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

classmethod from_bytes_stream(bytes_stream, content_type='.zip')[source]

Construct a Connectivity from a stream of bytes.

classmethod from_file(source_file='connectivity_76.zip')[source]
generate_surrogate_connectivity(number_of_regions, motif='chain', undirected=True, these_centres='spherical')[source]

This one generates some defaults. For more specific motifs, generate invoking each method separetly.

get_default_selection()[source]
get_grouped_space_labels()[source]
Returns:

A list [(‘left’, [lh_labels)], (‘right’: [rh_labels])]

property hemisphere_order_indices

A sequence of indices of rows/colums. These permute rows/columns so that the first half would belong to the first hemisphere If there is no hemisphere information returns the identity permutation

hemispheres

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

property horizon

The horizon is the maximum number of steps required in memory for simulation.

idelays

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

is_right_hemisphere(idx)[source]
Parameters:

idx – Region IDX

Returns:

True when hemispheres information is present and it shows that the current node is in the right

hemisphere. When hemispheres info is not present, return True for the second half of the indices and False otherwise.

motif_all_to_all(number_of_regions=4, max_radius=42.0)[source]

Generates an all-to-all closed unweighted undirected graph with equidistant nodes. Self-connections are not included.

motif_chain_directed(number_of_regions=4, max_radius=42.0, return_type=None)[source]

Generates a closed unweighted directed graph with equidistant nodes. Depending on the centres it could be a box or a ring.

motif_chain_undirected(number_of_regions=4, max_radius=42.0)[source]

Generates a closed unweighted undirected graph with equidistant nodes. Depending on the centres it could be a box or a ring.

motif_linear_directed(number_of_regions=4, max_radius=100.0, return_type=None)[source]

Generates a linear (open chain) unweighted directed graph with equidistant nodes.

motif_linear_undirected(number_of_regions=4, max_radius=42.0)[source]

Generates a linear (open chain) unweighted undirected graph with equidistant nodes.

number_of_connections

Declares an integer This is different from Attr(field_type=int). The former enforces int subtypes This allows all integer types, including numpy ones that can be safely cast to the declared type according to numpy rules

number_of_regions

Declares an integer This is different from Attr(field_type=int). The former enforces int subtypes This allows all integer types, including numpy ones that can be safely cast to the declared type according to numpy rules

property ordered_centres

Similar to :method:`ordered_weights`

property ordered_labels

Similar to ordered_weights()

property ordered_tracts

Similar to ordered_weights()

property ordered_weights

This view of the weights matrix lists all left hemisphere nodes before the right ones. It is used by viewers of the connectivity.

orientations

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

parent_connectivity

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

region_labels

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

saved_selection

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

property saved_selection_labels

Taking the entity field saved_selection, convert indexes in that array into labels.

scaled_weights(mode='tract')[source]

Scale the connection strengths (weights) and return the scaled matrix. Three simple types of scaling are supported. The scaling_mode is one of the following:

‘tract’: Scale by a value such that the maximum absolute value of a single

connection is 1.0. (Global scaling)

‘region’: Scale by a value such that the maximum absolute value of the

cumulative input to any region is 1.0. (Global-wise scaling)

None: does nothing.

NOTE: Currently multiple ‘tract’ and/or ‘region’ scalings without

intermediate ‘none’ scaling mode destroy the ability to recover the original un-scaled weights matrix.

set_areas(areas, expected_number_of_nodes)[source]
set_centres(centres, expected_number_of_nodes)[source]

Fill positions

set_cortical(cortical, expected_number_of_nodes)[source]
set_hemispheres(hemispheres, expected_number_of_nodes)[source]
set_idelays(dt)[source]

Convert the time delays between regions in physical units into an array of linear indices into the simulator’s history attribute.

args:

dt (float64): Length of integration time step…

Updates attribute:

idelays (numpy.array): Transmission delay between brain regions in integration steps.

set_orientations(orientations, expected_number_of_nodes)[source]
set_region_labels(region_labels)[source]
set_tract_lengths(tract_lengths, expected_number_of_nodes)[source]

Fill and check tracts. Allow empty files for tracts, they will be computed by tvb-library.

set_weights(weights, expected_number_of_nodes)[source]
speed

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

property subcortical_indices
summary_info()[source]

A more structured __str__ A 2 column table represented as a dict of str->str The default __str__ and html representations of this object are derived from this table. Override this method and return such a table filled with instance information that informs the user about your instance

tract_lengths

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

transform_binarize_matrix()[source]

Transforms the weights matrix into a binary (unweighted) matrix

transform_remove_self_connections()[source]

Remove the values from the main diagonal (self-connections)

try_compute_hemispheres()[source]

If all region labels are prefixed with L or R, then compute hemisphere side with that.

undirected

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

unmapped_indices(region_mapping)[source]

Compute vector of indices of regions in connectivity which are not in the given region mapping.

weights

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

cortex

class tvb.datatypes.cortex.Cortex(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.cortex.Cortex]

Wrapper Class to gather necessary entities for a surface-based simulation. To be used when preparing a simulation launch.

Attributes declared

local_connectivitytvb.datatypes.cortex.Cortex.local_connectivity = Attr(field_type=<class ‘tvb.datatypes.local_connectivity.LocalConnectivity’>, default=None, required=False)

Define the interaction between neighboring network nodes. This is implicitly integrated in the definition of a given surface as an excitatory mean coupling of directly adjacent neighbors to the first state variable of each population model (since these typically represent the mean-neural membrane voltage). This coupling is instantaneous (no time delays).

region_mapping_datatvb.datatypes.cortex.Cortex.region_mapping_data = Attr(field_type=<class ‘tvb.datatypes.region_mapping.RegionMapping’>, default=None, required=True)

An index vector of length equal to the number_of_vertices + the number of non-cortical regions, with values that index into an associated connectivity matrix.

coupling_strengthtvb.datatypes.cortex.Cortex.coupling_strength = NArray(label=’Local coupling strength’, dtype=float64, default=array([1.]), dim_names=(), ndim=None, required=True)

A factor that rescales local connectivity strengths.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

compute_local_connectivity()[source]
configure()[source]

Invoke the compute methods for computable attributes that haven’t been set during initialisation.

coupling_strength

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

classmethod from_file(source_file='cortex_16384.zip', region_mapping_file='regionMapping_16k_76.txt', local_connectivity_file=None)[source]
local_connectivity

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

property number_of_triangles

Define shortcut for retrieving the number of triangles of the surface held by a RegionMapping.

property number_of_vertices

Define shortcut for retrieving the number of vertices of the surface held by a RegionMapping.

prepare_local_coupling(number_of_nodes)[source]

Prepare the concrete local coupling matrix used for simulation.

property region_mapping

Generate a full region mapping vector.

region_mapping_data

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

property surface

Define shortcut for retrieving the surface held by a RegionMapping.

property triangles

Define shortcut for retrieving the triangles of the surface held by a RegionMapping.

property vertex_normals

Define shortcut for retrieving the vertex_normals of the surface held by a RegionMapping.

property vertices

Define shortcut for retrieving the vertices of the surface held by a RegionMapping.

equations

The Equation datatypes.

class tvb.datatypes.equations.Absolute(**kwargs)[source]

Bases: Equation

Traited class [tvb.datatypes.equations.Absolute]

Absolute value

Attributes declared

equationtvb.datatypes.equations.Absolute.equation = Final(field_type=<class ‘str’>, default=’abs(var)’, required=True)

\(result = abs(x)\)

parameterstvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f78d3957760>, required=True)

Should be a list of the parameters and their meaning, Traits should be able to take defaults and sensible ranges from any traited information that was provided.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

class tvb.datatypes.equations.Alpha(**kwargs)[source]

Bases: TemporalApplicableEquation

Traited class [tvb.datatypes.equations.Alpha]

An Alpha function belonging to the Exponential function family.

Attributes declared

equationtvb.datatypes.equations.Alpha.equation = Final(field_type=<class ‘str’>, default=’where((var-onset) > 0, (alpha * beta) / (beta - alpha) * (exp(-alpha * (var-onset)) - exp(-beta * (var-onset))), 0.0 * var)’, required=True)

\((\alpha * \beta) / (\beta - \alpha) * (\exp(-\alpha * (x-onset)) - \exp(-\beta * (x-onset)))\) for \((x-onset) > 0\)

parameters : tvb.datatypes.equations.Alpha.parameters = Attr(field_type=<class ‘dict’>, default=<function Alpha.<lambda> at 0x7f78d343d990>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.Cosine(**kwargs)[source]

Bases: TemporalApplicableEquation

Traited class [tvb.datatypes.equations.Cosine]

A Cosine equation.

Attributes declared

equationtvb.datatypes.equations.Cosine.equation = Final(field_type=<class ‘str’>, default=’amp * cos(6.283185307179586 * frequency * var)’, required=True)

\(amp \cos(2.0 \pi frequency x)\)

parameters : tvb.datatypes.equations.Cosine.parameters = Attr(field_type=<class ‘dict’>, default=<function Cosine.<lambda> at 0x7f78d343d900>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.DiscreteEquation(**kwargs)[source]

Bases: FiniteSupportEquation

Traited class [tvb.datatypes.equations.DiscreteEquation]

A special case for ‘discrete’ spaces, such as the regions, where each point in the space is effectively just assigned a value.

Attributes declared

equationtvb.datatypes.equations.DiscreteEquation.equation = Attr(field_type=<class ‘str’>, default=’var’, required=True)

The equation defines a function of \(x\)

parameterstvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f78d3957760>, required=True)

Should be a list of the parameters and their meaning, Traits should be able to take defaults and sensible ranges from any traited information that was provided.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.DoubleExponential(**kwargs)[source]

Bases: HRFKernelEquation

Traited class [tvb.datatypes.equations.DoubleExponential]

A difference of two exponential functions to define a kernel for the bold monitor.

Parameters :

  • \(\tau_1\): Time constant of the second exponential function [s]

  • \(\tau_2\): Time constant of the first exponential function [s].

  • \(f_1\) : Frequency of the first sine function [Hz].

  • \(f_2\) : Frequency of the second sine function [Hz].

  • \(amp_1\): Amplitude of the first exponential function.

  • \(amp_2\): Amplitude of the second exponential function.

  • \(a\) : Amplitude factor after normalization.

Reference:

[P_2000]

Alex Polonsky, Randolph Blake, Jochen Braun and David J. Heeger (2000). Neuronal activity in human primary visual cortex correlates with perception during binocular rivalry. Nature Neuroscience 3: 1153-1159

Attributes declared

equationtvb.datatypes.equations.DoubleExponential.equation = Final(field_type=<class ‘str’>, default=’((amp_1 * exp(-var/tau_1) * sin(2.*pi*f_1*var)) - (amp_2 * exp(-var/ tau_2) * sin(2.*pi*f_2*var)))’, required=True)

\(h(var) = amp_1\exp(\frac{-var}{ au_1}) \sin(2\cdot\pi f_1 \cdot var) - amp_2\cdot \exp(-\frac{var} {\tau_2})*\sin(2\pi f_2 var)\).

parameters : tvb.datatypes.equations.DoubleExponential.parameters = Attr(field_type=<class ‘dict’>, default=<function DoubleExponential.<lambda> at 0x7f78d343dbd0>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

evaluate(var)[source]

Generate a discrete representation of the equation for the space represented by var.

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.DoubleGaussian(**kwargs)[source]

Bases: FiniteSupportEquation

Traited class [tvb.datatypes.equations.DoubleGaussian]

A Mexican-hat function approximated by the difference of Gaussians functions.

Attributes declared

equationtvb.datatypes.equations.DoubleGaussian.equation = Final(field_type=<class ‘str’>, default=’(amp_1 * exp(-((var-midpoint_1)**2 / (2.0 * sigma_1**2)))) - (amp_2 * exp(-((var-midpoint_2)**2 / (2.0 * sigma_2**2))))’, required=True)

\(amp_1 \exp\left(-\left((x-midpoint_1)^2 / \left(2.0 \sigma_1^2\right)\right)\right) - amp_2 \exp\left(-\left((x-midpoint_2)^2 / \left(2.0 \sigma_2^2\right)\right)\right)\)

parameters : tvb.datatypes.equations.DoubleGaussian.parameters = Attr(field_type=<class ‘dict’>, default=<function DoubleGaussian.<lambda> at 0x7f78d343d630>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.Equation(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.equations.Equation]

Base class for Equation data types.

Attributes declared

equationtvb.datatypes.equations.Equation.equation = Attr(field_type=<class ‘str’>, default=None, required=True)

the equation as it should be interpreted by numexpr

parameterstvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f78d3957760>, required=True)

Should be a list of the parameters and their meaning, Traits should be able to take defaults and sensible ranges from any traited information that was provided.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

evaluate(var)[source]

Generate a discrete representation of the equation for the space represented by var.

The argument var can represent a distance, or effective distance, for each node in a simulation. Or a time, or in principle any arbitrary `` space . ``var can be a single number, a numpy.ndarray or a ?scipy.sparse_matrix? TODO: think this last one is true, need to check as we need it for LocalConnectivity…

get_series_data(min_range=0, max_range=100, step=None)[source]

NOTE: The symbol from the equation which varies should be named: var Returns the series data needed for plotting this equation.

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

class tvb.datatypes.equations.EquationsEnum(value)[source]

Bases: SubformEnum

Superclass of all enums that have equations as values

class tvb.datatypes.equations.FiniteSupportEquation(**kwargs)[source]

Bases: TemporalApplicableEquation

Traited class [tvb.datatypes.equations.FiniteSupportEquation]

Equations that decay to zero as the variable moves away from zero. It is necessary to restrict spatial equation evaluated on a surface to this class, are . The main purpose of this class is to facilitate filtering in the UI, for patters on surface (stimuli surface and localConnectivity).

Attributes declared

equationtvb.datatypes.equations.Equation.equation = Attr(field_type=<class ‘str’>, default=None, required=True)

the equation as it should be interpreted by numexpr

parameterstvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f78d3957760>, required=True)

Should be a list of the parameters and their meaning, Traits should be able to take defaults and sensible ranges from any traited information that was provided.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

class tvb.datatypes.equations.FirstOrderVolterra(**kwargs)[source]

Bases: HRFKernelEquation

Traited class [tvb.datatypes.equations.FirstOrderVolterra]

Integral form of the first Volterra kernel of the three used in the Ballon Windekessel model for computing the Bold signal. This function describes a damped Oscillator.

Parameters :

  • \(\tau_s\): Dimensionless? exponential decay parameter.

  • \(\tau_f\): Dimensionless? oscillatory parameter.

  • \(k_1\) : First Volterra kernel coefficient.

  • \(V_0\) : Resting blood volume fraction.

References :

[F_2000]

Friston, K., Mechelli, A., Turner, R., and Price, C., Nonlinear Responses in fMRI: The Balloon Model, Volterra Kernels, and Other Hemodynamics, NeuroImage, 12, 466 - 477, 2000.

Attributes declared

equationtvb.datatypes.equations.FirstOrderVolterra.equation = Final(field_type=<class ‘str’>, default=’1/3. * exp(-0.5*(var / tau_s)) * (sin(sqrt(1./tau_f - 1./(4.*tau_s**2)) * var)) / (sqrt(1./tau_f - 1./(4.*tau_s**2)))’, required=True)

\(G(t - t^{\prime}) = e^{\frac{1}{2} \left(\frac{t - t^{\prime}}{\tau_s} \right)} \frac{\sin\left((t - t^{\prime}) \sqrt{\frac{1}{\tau_f} - \frac{1}{4 \tau_s^2}}\right)} {\sqrt{\frac{1}{\tau_f} - \frac{1}{4 \tau_s^2}}} \; \; \; \; \; \; for \; \; \; t \geq t^{\prime} = 0 \; \; \; \; \; \; for \; \; \; t < t^{\prime}\).

parameters : tvb.datatypes.equations.FirstOrderVolterra.parameters = Attr(field_type=<class ‘dict’>, default=<function FirstOrderVolterra.<lambda> at 0x7f78d343dcf0>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.Gamma(**kwargs)[source]

Bases: HRFKernelEquation

Traited class [tvb.datatypes.equations.Gamma]

A Gamma function for the bold monitor. It belongs to the family of Exponential functions.

Parameters:

  • \(\tau\) : Exponential time constant of the gamma function [seconds].

  • \(n\) : The phase delay of the gamma function.

  • math:

    factorial : (n-1)!. numexpr does not support factorial yet.

  • math:

    a : Amplitude factor after normalization.

Reference:

[B_1996]

Geoffrey M. Boynton, Stephen A. Engel, Gary H. Glover and David J. Heeger (1996). Linear Systems Analysis of Functional Magnetic Resonance Imaging in Human V1. J Neurosci 16: 4207-4221

Note

might be filtered from the equations used in Stimulus and Local Connectivity.

Attributes declared

equationtvb.datatypes.equations.Gamma.equation = Final(field_type=<class ‘str’>, default=’((var / tau) ** (n - 1) * exp(-(var / tau)) )/ (tau * factorial)’, required=True)

\(h(var) = \frac{(\frac{var}{\tau})^{(n-1)}\exp{-(\frac{var}{\tau})}}{\tau(n-1)!}\).

parameters : tvb.datatypes.equations.Gamma.parameters = Attr(field_type=<class ‘dict’>, default=<function Gamma.<lambda> at 0x7f78d343db40>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

evaluate(var)[source]

Generate a discrete representation of the equation for the space represented by var.

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.Gaussian(**kwargs)[source]

Bases: SpatialApplicableEquation, FiniteSupportEquation

Traited class [tvb.datatypes.equations.Gaussian]

A Gaussian equation. offset: parameter to extend the behaviour of this function when spatializing model parameters.

Attributes declared

equationtvb.datatypes.equations.Gaussian.equation = Final(field_type=<class ‘str’>, default=’(amp * exp(-((var-midpoint)**2 / (2.0 * sigma**2))))+offset’, required=True)

\((amp \exp\left(-\left(\left(x-midpoint\right)^2 / \left(2.0 \sigma^2\right)\right)\right)) + offset\)

parameters : tvb.datatypes.equations.Gaussian.parameters = Attr(field_type=<class ‘dict’>, default=<function Gaussian.<lambda> at 0x7f78d343d510>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.GeneralizedSigmoid(**kwargs)[source]

Bases: TemporalApplicableEquation

Traited class [tvb.datatypes.equations.GeneralizedSigmoid]

A General Sigmoid equation.

Attributes declared

equationtvb.datatypes.equations.GeneralizedSigmoid.equation = Final(field_type=<class ‘str’>, default=’low + (high - low) / (1.0 + exp(-1.8137993642342178 * (var-midpoint)/sigma))’, required=True)

\(low + (high - low) / (1.0 + \exp(-\pi/\sqrt(3.0) (x-midpoint)/\sigma))\)

parameters : tvb.datatypes.equations.GeneralizedSigmoid.parameters = Attr(field_type=<class ‘dict’>, default=<function GeneralizedSigmoid.<lambda> at 0x7f78d343d7e0>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.HRFKernelEquation(**kwargs)[source]

Bases: Equation

Traited class [tvb.datatypes.equations.HRFKernelEquation]

Base class for hemodynamic response functions.

Attributes declared

equationtvb.datatypes.equations.Equation.equation = Attr(field_type=<class ‘str’>, default=None, required=True)

the equation as it should be interpreted by numexpr

parameterstvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f78d3957760>, required=True)

Should be a list of the parameters and their meaning, Traits should be able to take defaults and sensible ranges from any traited information that was provided.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

class tvb.datatypes.equations.Identity(**kwargs)[source]

Bases: Equation

Traited class [tvb.datatypes.equations.Identity]

Identity value

Attributes declared

equationtvb.datatypes.equations.Identity.equation = Final(field_type=<class ‘str’>, default=’var’, required=True)

\(result = x\)

parameterstvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f78d3957760>, required=True)

Should be a list of the parameters and their meaning, Traits should be able to take defaults and sensible ranges from any traited information that was provided.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

class tvb.datatypes.equations.Linear(**kwargs)[source]

Bases: TemporalApplicableEquation

Traited class [tvb.datatypes.equations.Linear]

A linear equation.

Attributes declared

equationtvb.datatypes.equations.Linear.equation = Final(field_type=<class ‘str’>, default=’a * var + b’, required=True)

\(result = a * x + b\)

parameters : tvb.datatypes.equations.Linear.parameters = Attr(field_type=<class ‘dict’>, default=<function Linear.<lambda> at 0x7f78d343d3f0>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.Logarithm(**kwargs)[source]

Bases: Equation

Traited class [tvb.datatypes.equations.Logarithm]

Logarithm Equation

Attributes declared

equationtvb.datatypes.equations.Logarithm.equation = Final(field_type=<class ‘str’>, default=’log(var)’, required=True)

\(result = log(x)\)

parameterstvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f78d3957760>, required=True)

Should be a list of the parameters and their meaning, Traits should be able to take defaults and sensible ranges from any traited information that was provided.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

class tvb.datatypes.equations.MixtureOfGammas(**kwargs)[source]

Bases: HRFKernelEquation

Traited class [tvb.datatypes.equations.MixtureOfGammas]

A mixture of two gamma distributions to create a kernel similar to the one used in SPM.

>> import scipy.stats as sp_stats >> import numpy >> t = numpy.linspace(1,20,100) >> a1, a2 = 6., 10. >> lambda = 1. >> c = 0.5 >> hrf = sp_stats.gamma.pdf(t, a1, lambda) - c * sp_stats.gamma.pdf(t, a2, lambda)

gamma.pdf(x, a, theta) = (lambda*x)**(a-1) * exp(-lambda*x) / gamma(a) a : shape parameter theta: 1 / lambda : scale parameter

References:

[G_1999] (1,2)

Glover, G. Deconvolution of Impulse Response in Event-Related BOLD fMRI. NeuroImage 9, 416-429, 1999.

Parameters:

  • \(a_{1}\) : shape parameter first gamma pdf.

  • \(a_{2}\) : shape parameter second gamma pdf.

  • \(\lambda\) : scale parameter first gamma pdf.

Default values are based on [G_1999]: * \(a_{1} - 1 = n_{1} = 5.0\) * \(a_{2} - 1 = n_{2} = 12.0\) * \(c \equiv a_{2} = 0.4\)

Alternative values \(a_{2}=10\) and \(c=0.5\)

NOTE: gamma_a_1 and gamma_a_2 are placeholders, the true values are computed before evaluating the expression, because numexpr does not support certain functions.

NOTE: [G_1999] used a different analytical function that can be approximated by this difference of gamma pdfs

Attributes declared

equationtvb.datatypes.equations.MixtureOfGammas.equation = Final(field_type=<class ‘str’>, default=’(l * var)**(a_1-1) * exp(-l*var) / gamma_a_1 - c * (l*var)**(a_2-1) * exp(-l*var) / gamma_a_2’, required=True)

\(\frac{\lambda \,t^{a_{1} - 1} \,\, \exp^{-\lambda \,t}}{\Gamma(a_{1})} - 0.5 \frac{\lambda \,t^{a_{2} - 1} \,\, \exp^{-\lambda \,t}}{\Gamma(a_{2})}\).

parameters : tvb.datatypes.equations.MixtureOfGammas.parameters = Attr(field_type=<class ‘dict’>, default=<function MixtureOfGammas.<lambda> at 0x7f78d343dd80>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

evaluate(var)[source]

Generate a discrete representation of the equation for the space represented by var.

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.PulseTrain(**kwargs)[source]

Bases: TemporalApplicableEquation

Traited class [tvb.datatypes.equations.PulseTrain]

A pulse train , offset with respect to the time axis.

Parameters:

  • \(\tau\) : pulse width or pulse duration

  • \(T\) : pulse repetition period

  • onset : time of the first pulse

  • amp : amplitude of the pulse

Attributes declared

equationtvb.datatypes.equations.PulseTrain.equation = Final(field_type=<class ‘str’>, default=’where((var>onset)&(((var-onset) % T) < tau), amp, 0)’, required=True)

\(\left\{{\begin{array}{rl}amp,&{\text{if }} ((var-onset) \mod T) < \tau \space and \space var > onset\\0, &{\text{otherwise }}\end{array}}\right.\)

parameters : tvb.datatypes.equations.PulseTrain.parameters = Attr(field_type=<class ‘dict’>, default=<function PulseTrain.<lambda> at 0x7f78d343da20>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.RescaleInterval(**kwargs)[source]

Bases: Equation

Traited class [tvb.datatypes.equations.RescaleInterval]

Direct rescaling of an interval from [oldMin..oldMax] into [newMin..newMax]

Attributes declared

equationtvb.datatypes.equations.RescaleInterval.equation = Final(field_type=<class ‘str’>, default=’(var - oldMin) * (newMax - newMin) / (oldMax - oldMin) + newMin’, required=True)

\(result = (x - oldMin) * (newMax - newMin) / (oldMax - oldMin) + newMin\)

parameters : tvb.datatypes.equations.RescaleInterval.parameters = Attr(field_type=<class ‘dict’>, default=<function RescaleInterval.<lambda> at 0x7f78d343d480>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.Sigmoid(**kwargs)[source]

Bases: SpatialApplicableEquation, FiniteSupportEquation

Traited class [tvb.datatypes.equations.Sigmoid]

A Sigmoid equation. offset: parameter to extend the behaviour of this function when spatializing model parameters.

Attributes declared

equationtvb.datatypes.equations.Sigmoid.equation = Final(field_type=<class ‘str’>, default=’(amp / (1.0 + exp(-1.8137993642342178 * (radius-var)/sigma))) + offset’, required=True)

\((amp / (1.0 + \exp(-\pi/\sqrt(3.0) (radius-x)/\sigma))) + offset\)

parameters : tvb.datatypes.equations.Sigmoid.parameters = Attr(field_type=<class ‘dict’>, default=<function Sigmoid.<lambda> at 0x7f78d343d6c0>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.Sinusoid(**kwargs)[source]

Bases: TemporalApplicableEquation

Traited class [tvb.datatypes.equations.Sinusoid]

A Sinusoid equation.

Attributes declared

equationtvb.datatypes.equations.Sinusoid.equation = Final(field_type=<class ‘str’>, default=’amp * sin(6.283185307179586 * frequency * var)’, required=True)

\(amp \sin(2.0 \pi frequency x)\)

parameters : tvb.datatypes.equations.Sinusoid.parameters = Attr(field_type=<class ‘dict’>, default=<function Sinusoid.<lambda> at 0x7f78d343d870>, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

equation

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

parameters

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.equations.SpatialApplicableEquation(**kwargs)[source]

Bases: Equation

Traited class [tvb.datatypes.equations.SpatialApplicableEquation]

Abstract class introduced just for filtering what equations to be displayed in UI, for setting model parameters on the Surface level.

Attributes declared

equationtvb.datatypes.equations.Equation.equation = Attr(field_type=<class ‘str’>, default=None, required=True)

the equation as it should be interpreted by numexpr

parameterstvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f78d3957760>, required=True)

Should be a list of the parameters and their meaning, Traits should be able to take defaults and sensible ranges from any traited information that was provided.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

class tvb.datatypes.equations.TemporalApplicableEquation(**kwargs)[source]

Bases: Equation

Traited class [tvb.datatypes.equations.TemporalApplicableEquation]

Abstract class introduced just for filtering what equations to be displayed in UI, for setting the temporal component in Stimulus on region and surface.

Attributes declared

equationtvb.datatypes.equations.Equation.equation = Attr(field_type=<class ‘str’>, default=None, required=True)

the equation as it should be interpreted by numexpr

parameterstvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f78d3957760>, required=True)

Should be a list of the parameters and their meaning, Traits should be able to take defaults and sensible ranges from any traited information that was provided.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

fcd

Adapter that uses the traits module to generate interfaces for … Analyzer.

class tvb.datatypes.fcd.Fcd(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.fcd.Fcd]

Attributes declared

array_data : tvb.datatypes.fcd.Fcd.array_data = NArray(label=’’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

sourcetvb.datatypes.fcd.Fcd.source = Attr(field_type=<class ‘tvb.datatypes.time_series.TimeSeries’>, default=None, required=True)

Links to the time-series on which FCD is calculated.

swtvb.datatypes.fcd.Fcd.sw = Float(field_type=<class ‘float’>, default=120000, required=True)

Length of the time window used to divided the time series. FCD matrix is calculated in the following way: the time series is divided in time window of fixed length and with an overlapping of fixed length. The datapoints within each window, centered at time ti, are used to calculate FC(ti) as Pearson correlation. The ij element of the FCD matrix is calculated as the Pearson correlation between FC(ti) and FC(tj) arranged in a vector.

sptvb.datatypes.fcd.Fcd.sp = Float(field_type=<class ‘float’>, default=2000, required=True)

Spanning= (time windows length)-(overlapping between two consecutive time window). FCD matrix is calculated in the following way: the time series is divided in time window of fixed length and with an overlapping of fixed length. The datapoints within each window, centered at time ti, are used to calculate FC(ti) as Pearson correlation. The ij element of the FCD matrix is calculated as the Pearson correlation between FC(ti) and FC(tj) arranged in a vector

labels_orderingtvb.datatypes.fcd.Fcd.labels_ordering = List(of=<class ‘str’>, default=(‘Time’, ‘Time’, ‘State Variable’, ‘Mode’), required=True)

List of strings representing names of each data dimension

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

labels_ordering

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

source

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

sp

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

sw

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

graph

The Graph datatypes.

class tvb.datatypes.graph.ConnectivityMeasure(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.graph.ConnectivityMeasure]

Measurement of based on a connectivity.

Attributes declared

array_data : tvb.datatypes.graph.ConnectivityMeasure.array_data = NArray(label=’’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

connectivity : tvb.datatypes.graph.ConnectivityMeasure.connectivity = Attr(field_type=<class ‘tvb.datatypes.connectivity.Connectivity’>, default=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

connectivity

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

A more structured __str__ A 2 column table represented as a dict of str->str The default __str__ and html representations of this object are derived from this table. Override this method and return such a table filled with instance information that informs the user about your instance

class tvb.datatypes.graph.CorrelationCoefficients(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.graph.CorrelationCoefficients]

Correlation coefficients datatype.

Attributes declared

array_data : tvb.datatypes.graph.CorrelationCoefficients.array_data = NArray(label=’’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

sourcetvb.datatypes.graph.CorrelationCoefficients.source = Attr(field_type=<class ‘tvb.datatypes.time_series.TimeSeries’>, default=None, required=True)

Links to the time-series on which Correlation (coefficients) is applied.

labels_orderingtvb.datatypes.graph.CorrelationCoefficients.labels_ordering = List(of=<class ‘str’>, default=(‘Node’, ‘Node’, ‘State Variable’, ‘Mode’), required=True)

List of strings representing names of each data dimension

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

PEARSON_MAX = 1
PEARSON_MIN = -1
array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

labels_ordering

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

source

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

A more structured __str__ A 2 column table represented as a dict of str->str The default __str__ and html representations of this object are derived from this table. Override this method and return such a table filled with instance information that informs the user about your instance

class tvb.datatypes.graph.Covariance(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.graph.Covariance]

Covariance datatype.

Attributes declared

array_data : tvb.datatypes.graph.Covariance.array_data = NArray(label=’’, dtype=complex128, default=None, dim_names=(), ndim=None, required=True)

sourcetvb.datatypes.graph.Covariance.source = Attr(field_type=<class ‘tvb.datatypes.time_series.TimeSeries’>, default=None, required=True)

Links to the time-series on which NodeCovariance is applied.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

source

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

A more structured __str__ A 2 column table represented as a dict of str->str The default __str__ and html representations of this object are derived from this table. Override this method and return such a table filled with instance information that informs the user about your instance

local_connectivity

class tvb.datatypes.local_connectivity.LocalConnectivity(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.local_connectivity.LocalConnectivity]

A sparse matrix for representing the local connectivity within the Cortex.

Attributes declared

surface : tvb.datatypes.local_connectivity.LocalConnectivity.surface = Attr(field_type=<class ‘tvb.datatypes.surfaces.CorticalSurface’>, default=None, required=True)

matrix : tvb.datatypes.local_connectivity.LocalConnectivity.matrix = Attr(field_type=<class ‘scipy.sparse._base.spmatrix’>, default=None, required=False)

equation : tvb.datatypes.local_connectivity.LocalConnectivity.equation = Attr(field_type=<class ‘tvb.datatypes.equations.FiniteSupportEquation’>, default=<tvb.datatypes.equations.Gaussian object at 0x7f78cbddda20>, required=False)

cutofftvb.datatypes.local_connectivity.LocalConnectivity.cutoff = Float(field_type=<class ‘float’>, default=40.0, required=True)

Distance at which to truncate the evaluation in mm.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

compute()[source]

Compute current Matrix.

compute_sparse_matrix()[source]

NOTE: Before calling this method, the surface field should already be set on the local connectivity.

Computes the sparse matrix for this local connectivity.

cutoff

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

equation

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

static from_file(source_file='local_connectivity_16384.mat')[source]
matrix

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

matrix_gdist = None
summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

surface

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

mode_decompositions

The Mode Decomposition datatypes.

class tvb.datatypes.mode_decompositions.IndependentComponents(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.mode_decompositions.IndependentComponents]

Result of an Independent Component Analysis.

Attributes declared

sourcetvb.datatypes.mode_decompositions.IndependentComponents.source = Attr(field_type=<class ‘tvb.datatypes.time_series.TimeSeries’>, default=None, required=True)

Links to the time-series on which the ICA is applied.

mixing_matrixtvb.datatypes.mode_decompositions.IndependentComponents.mixing_matrix = NArray(label=’Mixing matrix - Spatial Maps’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

The linear mixing matrix (Mixing matrix)

unmixing_matrixtvb.datatypes.mode_decompositions.IndependentComponents.unmixing_matrix = NArray(label=’Unmixing matrix - Spatial maps’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

The estimated unmixing matrix used to obtain the unmixed sources from the data

prewhitening_matrix : tvb.datatypes.mode_decompositions.IndependentComponents.prewhitening_matrix = NArray(label=’Pre-whitening matrix’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

n_componentstvb.datatypes.mode_decompositions.IndependentComponents.n_components = Int(field_type=<class ‘int’>, default=0, required=True)

Observed data matrix is considered to be a linear combination of \(n\) non-Gaussian independent components

norm_source : tvb.datatypes.mode_decompositions.IndependentComponents.norm_source = NArray(label=’Normalised source time series. Zero centered and whitened.’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

component_time_series : tvb.datatypes.mode_decompositions.IndependentComponents.component_time_series = NArray(label=’Component time series. Unmixed sources.’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

normalised_component_time_series : tvb.datatypes.mode_decompositions.IndependentComponents.normalised_component_time_series = NArray(label=’Normalised component time series’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

component_time_series

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

compute_component_time_series()[source]
compute_mixing_matrix()[source]

Compute the linear mixing matrix A, so X = A * S , where X is the observed data and S contain the independent components

compute_norm_source()[source]

Normalised source time-series.

compute_normalised_component_time_series()[source]
mixing_matrix

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

n_components

Declares an integer This is different from Attr(field_type=int). The former enforces int subtypes This allows all integer types, including numpy ones that can be safely cast to the declared type according to numpy rules

norm_source

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

normalised_component_time_series

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

prewhitening_matrix

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

source

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

unmixing_matrix

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

class tvb.datatypes.mode_decompositions.PrincipalComponents(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.mode_decompositions.PrincipalComponents]

Result of a Principal Component Analysis (PCA).

Attributes declared

sourcetvb.datatypes.mode_decompositions.PrincipalComponents.source = Attr(field_type=<class ‘tvb.datatypes.time_series.TimeSeries’>, default=None, required=True)

Links to the time-series on which the PCA is applied.

weightstvb.datatypes.mode_decompositions.PrincipalComponents.weights = NArray(label=’Principal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

The vectors of the ‘weights’ with which each time-series is represented in each component.

fractionstvb.datatypes.mode_decompositions.PrincipalComponents.fractions = NArray(label=’Fraction explained’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

A vector or collection of vectors representing the fraction of the variance explained by each principal component.

norm_source : tvb.datatypes.mode_decompositions.PrincipalComponents.norm_source = NArray(label=’Normalised source time series’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

component_time_series : tvb.datatypes.mode_decompositions.PrincipalComponents.component_time_series = NArray(label=’Component time series’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

normalised_component_time_series : tvb.datatypes.mode_decompositions.PrincipalComponents.normalised_component_time_series = NArray(label=’Normalised component time series’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

component_time_series

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

compute_component_time_series()[source]

Compnent time-series.

compute_norm_source()[source]

Normalised source time-series.

compute_normalised_component_time_series()[source]

normalised_Compnent time-series.

fractions

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

norm_source

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

normalised_component_time_series

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

source

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

weights

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

patterns

The Pattern datatypes.

class tvb.datatypes.patterns.SpatialPattern(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.patterns.SpatialPattern]

Equation for space variation.

Attributes declared

spatial : tvb.datatypes.patterns.SpatialPattern.spatial = Attr(field_type=<class ‘tvb.datatypes.equations.FiniteSupportEquation’>, default=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

configure_space(distance)[source]

Stores the distance vector as an attribute of the spatiotemporal pattern and uses it to generate the spatial pattern vector.

Depending on equations used and interpretation distance can be an actual physical distance, on a surface, geodesic distance (along the surface) away for some focal point, or a per node weighting…

space = None
spatial

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

property spatial_pattern

Return a discrete representation of the spatial pattern.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this DataType.

class tvb.datatypes.patterns.SpatialPatternVolume(**kwargs)[source]

Bases: SpatialPattern

Traited class [tvb.datatypes.patterns.SpatialPatternVolume]

A spatio-temporal pattern defined in a volume.

Attributes declared

volume : tvb.datatypes.patterns.SpatialPatternVolume.volume = Attr(field_type=<class ‘tvb.datatypes.volumes.Volume’>, default=None, required=True)

focal_points_volume : tvb.datatypes.patterns.SpatialPatternVolume.focal_points_volume = NArray(label=’Focal points’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

spatial : tvb.datatypes.patterns.SpatialPattern.spatial = Attr(field_type=<class ‘tvb.datatypes.equations.FiniteSupportEquation’>, default=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

focal_points_volume

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

volume

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.patterns.SpatioTemporalPattern(**kwargs)[source]

Bases: SpatialPattern

Traited class [tvb.datatypes.patterns.SpatioTemporalPattern]

Combine space and time equations.

Attributes declared

temporal : tvb.datatypes.patterns.SpatioTemporalPattern.temporal = Attr(field_type=<class ‘tvb.datatypes.equations.TemporalApplicableEquation’>, default=None, required=True)

spatial : tvb.datatypes.patterns.SpatialPattern.spatial = Attr(field_type=<class ‘tvb.datatypes.equations.FiniteSupportEquation’>, default=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

configure_time(time)[source]

Stores the time vector, physical units (ms), as an attribute of the spatio-temporal pattern and uses it to generate the temporal pattern vector.

summary_info()[source]

Extend the base class’s summary dictionary.

temporal

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

property temporal_pattern

Return a discrete representation of the temporal pattern.

time = None
class tvb.datatypes.patterns.StimuliRegion(**kwargs)[source]

Bases: SpatioTemporalPattern

Traited class [tvb.datatypes.patterns.StimuliRegion]

A class that bundles the temporal profile of the stimulus, together with the list of scaling weights of the regions where it will applied.

Attributes declared

connectivity : tvb.datatypes.patterns.StimuliRegion.connectivity = Attr(field_type=<class ‘tvb.datatypes.connectivity.Connectivity’>, default=None, required=True)

spatial : tvb.datatypes.patterns.StimuliRegion.spatial = Attr(field_type=<class ‘tvb.datatypes.equations.DiscreteEquation’>, default=<tvb.datatypes.equations.DiscreteEquation object at 0x7f78cc6dfc10>, required=True)

weight : tvb.datatypes.patterns.StimuliRegion.weight = NArray(label=’scaling’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

temporal : tvb.datatypes.patterns.SpatioTemporalPattern.temporal = Attr(field_type=<class ‘tvb.datatypes.equations.TemporalApplicableEquation’>, default=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

configure_space(region_mapping=None)[source]

Do necessary preparations in order to use this stimulus. NOTE: this was previously done in simulator configure_stimuli() method. It no needs to be used in stimulus viewer also.

connectivity

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

static get_default_weights(number_of_regions)[source]

Returns a list with a number of elements equal to the given number of regions.

spatial

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

weight

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

property weight_array

Wrap weight List into a Numpy array, as it is requested by the simulator.

class tvb.datatypes.patterns.StimuliSurface(**kwargs)[source]

Bases: SpatioTemporalPattern

Traited class [tvb.datatypes.patterns.StimuliSurface]

A spatio-temporal pattern defined in a Surface DataType. It includes the list of focal points.

Attributes declared

surface : tvb.datatypes.patterns.StimuliSurface.surface = Attr(field_type=<class ‘tvb.datatypes.surfaces.CorticalSurface’>, default=None, required=True)

focal_points_triangles : tvb.datatypes.patterns.StimuliSurface.focal_points_triangles = NArray(label=’Focal points triangles’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

temporal : tvb.datatypes.patterns.SpatioTemporalPattern.temporal = Attr(field_type=<class ‘tvb.datatypes.equations.TemporalApplicableEquation’>, default=None, required=True)

spatial : tvb.datatypes.patterns.SpatialPattern.spatial = Attr(field_type=<class ‘tvb.datatypes.equations.FiniteSupportEquation’>, default=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

configure_space(region_mapping=None)[source]

Do necessary preparations in order to use this stimulus. NOTE: this was previously done in simulator configure_stimuli() method. It no needs to be used in stimulus viewer also.

property focal_points_surface
focal_points_triangles

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

surface

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

projections

The ProjectionMatrices DataTypes.

class tvb.datatypes.projections.ProjectionMatrix(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.projections.ProjectionMatrix]

Base DataType for representing a ProjectionMatrix. The projection is between a source of type CorticalSurface and a set of Sensors.

Attributes declared

projection_type : tvb.datatypes.projections.ProjectionMatrix.projection_type = Final(field_type=<class ‘str’>, default=None, required=True)

brain_skulltvb.datatypes.projections.ProjectionMatrix.brain_skull = Attr(field_type=<class ‘tvb.datatypes.surfaces.BrainSkull’>, default=None, required=False)

Boundary between skull and cortex domains.

skull_skintvb.datatypes.projections.ProjectionMatrix.skull_skin = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkullSkin’>, default=None, required=False)

Boundary between skull and skin domains.

skin_airtvb.datatypes.projections.ProjectionMatrix.skin_air = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkinAir’>, default=None, required=False)

Boundary between skin and air domains.

conductancestvb.datatypes.projections.ProjectionMatrix.conductances = Attr(field_type=<class ‘dict’>, default={‘air’: 0.0, ‘skin’: 1.0, ‘skull’: 0.01, ‘brain’: 1.0}, required=False)

A dictionary representing the conductances of …

sources : tvb.datatypes.projections.ProjectionMatrix.sources = Attr(field_type=<class ‘tvb.datatypes.surfaces.CorticalSurface’>, default=None, required=True)

sensorstvb.datatypes.projections.ProjectionMatrix.sensors = Attr(field_type=<class ‘tvb.datatypes.sensors.Sensors’>, default=None, required=False)

A set of sensors to compute projection matrix for them.

projection_data : tvb.datatypes.projections.ProjectionMatrix.projection_data = NArray(label=’Projection Matrix Data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

brain_skull

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

conductances

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

classmethod from_file(source_file, matlab_data_name=None, is_brainstorm=False)[source]
projection_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

projection_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

sensors

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

property shape
skin_air

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

skull_skin

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

sources

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.projections.ProjectionSurfaceEEG(**kwargs)[source]

Bases: ProjectionMatrix

Traited class [tvb.datatypes.projections.ProjectionSurfaceEEG]

Specific projection, from a CorticalSurface to EEG sensors.

Attributes declared

projection_type : tvb.datatypes.projections.ProjectionSurfaceEEG.projection_type = Final(field_type=<class ‘str’>, default=’projEEG’, required=True)

sensors : tvb.datatypes.projections.ProjectionSurfaceEEG.sensors = Attr(field_type=<class ‘tvb.datatypes.sensors.SensorsEEG’>, default=None, required=True)

brain_skulltvb.datatypes.projections.ProjectionMatrix.brain_skull = Attr(field_type=<class ‘tvb.datatypes.surfaces.BrainSkull’>, default=None, required=False)

Boundary between skull and cortex domains.

skull_skintvb.datatypes.projections.ProjectionMatrix.skull_skin = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkullSkin’>, default=None, required=False)

Boundary between skull and skin domains.

skin_airtvb.datatypes.projections.ProjectionMatrix.skin_air = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkinAir’>, default=None, required=False)

Boundary between skin and air domains.

conductancestvb.datatypes.projections.ProjectionMatrix.conductances = Attr(field_type=<class ‘dict’>, default={‘air’: 0.0, ‘skin’: 1.0, ‘skull’: 0.01, ‘brain’: 1.0}, required=False)

A dictionary representing the conductances of …

sources : tvb.datatypes.projections.ProjectionMatrix.sources = Attr(field_type=<class ‘tvb.datatypes.surfaces.CorticalSurface’>, default=None, required=True)

projection_data : tvb.datatypes.projections.ProjectionMatrix.projection_data = NArray(label=’Projection Matrix Data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

classmethod from_file(source_file='projection_eeg_65_surface_16k.npy', matlab_data_name='ProjectionMatrix', is_brainstorm=False)[source]
projection_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

sensors

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.projections.ProjectionSurfaceMEG(**kwargs)[source]

Bases: ProjectionMatrix

Traited class [tvb.datatypes.projections.ProjectionSurfaceMEG]

Specific projection, from a CorticalSurface to MEG sensors.

Attributes declared

projection_type : tvb.datatypes.projections.ProjectionSurfaceMEG.projection_type = Final(field_type=<class ‘str’>, default=’projMEG’, required=True)

sensors : tvb.datatypes.projections.ProjectionSurfaceMEG.sensors = Attr(field_type=<class ‘tvb.datatypes.sensors.SensorsMEG’>, default=None, required=True)

brain_skulltvb.datatypes.projections.ProjectionMatrix.brain_skull = Attr(field_type=<class ‘tvb.datatypes.surfaces.BrainSkull’>, default=None, required=False)

Boundary between skull and cortex domains.

skull_skintvb.datatypes.projections.ProjectionMatrix.skull_skin = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkullSkin’>, default=None, required=False)

Boundary between skull and skin domains.

skin_airtvb.datatypes.projections.ProjectionMatrix.skin_air = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkinAir’>, default=None, required=False)

Boundary between skin and air domains.

conductancestvb.datatypes.projections.ProjectionMatrix.conductances = Attr(field_type=<class ‘dict’>, default={‘air’: 0.0, ‘skin’: 1.0, ‘skull’: 0.01, ‘brain’: 1.0}, required=False)

A dictionary representing the conductances of …

sources : tvb.datatypes.projections.ProjectionMatrix.sources = Attr(field_type=<class ‘tvb.datatypes.surfaces.CorticalSurface’>, default=None, required=True)

projection_data : tvb.datatypes.projections.ProjectionMatrix.projection_data = NArray(label=’Projection Matrix Data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

classmethod from_file(source_file='projection_meg_276_surface_16k.npy', matlab_data_name=None, is_brainstorm=False)[source]
projection_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

sensors

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.projections.ProjectionSurfaceSEEG(**kwargs)[source]

Bases: ProjectionMatrix

Traited class [tvb.datatypes.projections.ProjectionSurfaceSEEG]

Specific projection, from a CorticalSurface to SEEG sensors.

Attributes declared

projection_type : tvb.datatypes.projections.ProjectionSurfaceSEEG.projection_type = Final(field_type=<class ‘str’>, default=’projSEEG’, required=True)

sensors : tvb.datatypes.projections.ProjectionSurfaceSEEG.sensors = Attr(field_type=<class ‘tvb.datatypes.sensors.SensorsInternal’>, default=None, required=True)

brain_skulltvb.datatypes.projections.ProjectionMatrix.brain_skull = Attr(field_type=<class ‘tvb.datatypes.surfaces.BrainSkull’>, default=None, required=False)

Boundary between skull and cortex domains.

skull_skintvb.datatypes.projections.ProjectionMatrix.skull_skin = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkullSkin’>, default=None, required=False)

Boundary between skull and skin domains.

skin_airtvb.datatypes.projections.ProjectionMatrix.skin_air = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkinAir’>, default=None, required=False)

Boundary between skin and air domains.

conductancestvb.datatypes.projections.ProjectionMatrix.conductances = Attr(field_type=<class ‘dict’>, default={‘air’: 0.0, ‘skin’: 1.0, ‘skull’: 0.01, ‘brain’: 1.0}, required=False)

A dictionary representing the conductances of …

sources : tvb.datatypes.projections.ProjectionMatrix.sources = Attr(field_type=<class ‘tvb.datatypes.surfaces.CorticalSurface’>, default=None, required=True)

projection_data : tvb.datatypes.projections.ProjectionMatrix.projection_data = NArray(label=’Projection Matrix Data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

classmethod from_file(source_file='projection_seeg_588_surface_16k.npy', matlab_data_name=None, is_brainstorm=False)[source]
projection_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

sensors

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.projections.ProjectionsTypeEnum(value)[source]

Bases: TVBEnum

An enumeration.

EEG = 'projEEG'
MEG = 'projMEG'
SEEG = 'projSEEG'
tvb.datatypes.projections.make_proj_matrix(proj_type)[source]

Build a ProjectionMatrix instance, based on an input type :param proj_type: one of the supported subtypes :return: Instance of the corresponding projectiion matrix class, or None

region_mapping

DataTypes for mapping some TVB DataTypes to a Connectivity (regions).

In FreeSurfer terms, a RegionMapping is a parcellation and a VolumeMapping is a segmentation.

class tvb.datatypes.region_mapping.RegionMapping(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.region_mapping.RegionMapping]

An array (of length Surface.vertices). Each value is representing the index in Connectivity regions to which the current vertex is mapped.

Attributes declared

array_data : tvb.datatypes.region_mapping.RegionMapping.array_data = NArray(label=’’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

connectivity : tvb.datatypes.region_mapping.RegionMapping.connectivity = Attr(field_type=<class ‘tvb.datatypes.connectivity.Connectivity’>, default=None, required=True)

surface : tvb.datatypes.region_mapping.RegionMapping.surface = Attr(field_type=<class ‘tvb.datatypes.surfaces.Surface’>, default=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

connectivity

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

static from_file(source_file='regionMapping_16k_76.txt')[source]
surface

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.region_mapping.RegionVolumeMapping(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.region_mapping.RegionVolumeMapping]

Each value is representing the index in Connectivity regions to which the current voxel is mapped.

Attributes declared

array_data : tvb.datatypes.region_mapping.RegionVolumeMapping.array_data = NArray(label=’’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

connectivity : tvb.datatypes.region_mapping.RegionVolumeMapping.connectivity = Attr(field_type=<class ‘tvb.datatypes.connectivity.Connectivity’>, default=None, required=True)

volume : tvb.datatypes.region_mapping.RegionVolumeMapping.volume = Attr(field_type=<class ‘tvb.datatypes.volumes.Volume’>, default=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

connectivity

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

volume

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

sensors

The Sensors dataType.

class tvb.datatypes.sensors.SensorTypesEnum(value)[source]

Bases: TVBEnum

An enumeration.

TYPE_EEG = 'EEG'
TYPE_INTERNAL = 'Internal'
TYPE_MEG = 'MEG'
class tvb.datatypes.sensors.Sensors(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.sensors.Sensors]

Base Sensors class. All sensors have locations. Some will have orientations, e.g. MEG.

Attributes declared

sensors_type : tvb.datatypes.sensors.Sensors.sensors_type = Attr(field_type=<class ‘str’>, default=None, required=False)

labels : tvb.datatypes.sensors.Sensors.labels = NArray(label=’Sensor labels’, dtype=<U128, default=None, dim_names=(), ndim=None, required=True)

locations : tvb.datatypes.sensors.Sensors.locations = NArray(label=’Sensor locations’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

has_orientation : tvb.datatypes.sensors.Sensors.has_orientation = Attr(field_type=<class ‘bool’>, default=False, required=True)

orientations : tvb.datatypes.sensors.Sensors.orientations = NArray(label=’’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

number_of_sensorstvb.datatypes.sensors.Sensors.number_of_sensors = Int(field_type=<class ‘int’>, default=0, required=True)

The number of sensors described by these Sensors.

usabletvb.datatypes.sensors.Sensors.usable = NArray(label=’Usable sensors’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

The sensors in set which are used for signal data.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

configure()[source]

Invoke the compute methods for computable attributes that haven’t been set during initialization.

classmethod from_bytes_stream(bytes_stream, content_type='.txt')[source]

Construct Sensors from source_file.

classmethod from_file(source_file='eeg_brainstorm_65.txt')[source]
has_orientation

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

labels

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

locations

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

number_of_sensors

Declares an integer This is different from Attr(field_type=int). The former enforces int subtypes This allows all integer types, including numpy ones that can be safely cast to the declared type according to numpy rules

orientations

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

sensors_to_surface(surface_to_map)[source]

Map EEG sensors onto the head surface (skin-air).

EEG sensor locations are typically only given on a unit sphere, that is, they are effectively only identified by their orientation with respect to a coordinate system. This method is used to map these unit vector sensor “locations” to a specific location on the surface of the skin.

Assumes coordinate systems are aligned, i.e. common x,y,z and origin.

sensors_type

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

usable

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

class tvb.datatypes.sensors.SensorsEEG(**kwargs)[source]

Bases: Sensors

Traited class [tvb.datatypes.sensors.SensorsEEG]

EEG sensor locations are represented as unit vectors, these need to be combined with a head(outer-skin) surface to obtain actual sensor locations

                      position
                         |
                        / \
                       /   \
file columns: labels, x, y, z

Attributes declared

sensors_type : tvb.datatypes.sensors.SensorsEEG.sensors_type = Final(field_type=<class ‘str’>, default=’EEG’, required=True)

has_orientation : tvb.datatypes.sensors.SensorsEEG.has_orientation = Attr(field_type=<class ‘bool’>, default=False, required=True)

labels : tvb.datatypes.sensors.Sensors.labels = NArray(label=’Sensor labels’, dtype=<U128, default=None, dim_names=(), ndim=None, required=True)

locations : tvb.datatypes.sensors.Sensors.locations = NArray(label=’Sensor locations’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

orientations : tvb.datatypes.sensors.Sensors.orientations = NArray(label=’’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

number_of_sensorstvb.datatypes.sensors.Sensors.number_of_sensors = Int(field_type=<class ‘int’>, default=0, required=True)

The number of sensors described by these Sensors.

usabletvb.datatypes.sensors.Sensors.usable = NArray(label=’Usable sensors’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

The sensors in set which are used for signal data.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

has_orientation

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

sensors_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

class tvb.datatypes.sensors.SensorsInternal(**kwargs)[source]

Bases: Sensors

Traited class [tvb.datatypes.sensors.SensorsInternal]

Sensors inside the brain…

Attributes declared

sensors_type : tvb.datatypes.sensors.SensorsInternal.sensors_type = Final(field_type=<class ‘str’>, default=’Internal’, required=True)

labels : tvb.datatypes.sensors.Sensors.labels = NArray(label=’Sensor labels’, dtype=<U128, default=None, dim_names=(), ndim=None, required=True)

locations : tvb.datatypes.sensors.Sensors.locations = NArray(label=’Sensor locations’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

has_orientation : tvb.datatypes.sensors.Sensors.has_orientation = Attr(field_type=<class ‘bool’>, default=False, required=True)

orientations : tvb.datatypes.sensors.Sensors.orientations = NArray(label=’’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

number_of_sensorstvb.datatypes.sensors.Sensors.number_of_sensors = Int(field_type=<class ‘int’>, default=0, required=True)

The number of sensors described by these Sensors.

usabletvb.datatypes.sensors.Sensors.usable = NArray(label=’Usable sensors’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

The sensors in set which are used for signal data.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

classmethod from_file(source_file='seeg_39.txt.bz2')[source]
static group_sensors_to_electrodes(labels)[source]
property grouped_electrodes
sensors_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

class tvb.datatypes.sensors.SensorsMEG(**kwargs)[source]

Bases: Sensors

Traited class [tvb.datatypes.sensors.SensorsMEG]

These are actually just SQUIDS. Axial or planar gradiometers are achieved by calculating lead fields for two sets of sensors and then subtracting…

                      position  orientation
                         |           |
                        / \         /  \
                       /   \       /    \
file columns: labels, x, y, z,   dx, dy, dz

Attributes declared

sensors_type : tvb.datatypes.sensors.SensorsMEG.sensors_type = Final(field_type=<class ‘str’>, default=’MEG’, required=True)

orientationstvb.datatypes.sensors.SensorsMEG.orientations = NArray(label=’Sensor orientations’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array representing the orientation of the MEG SQUIDs

has_orientation : tvb.datatypes.sensors.SensorsMEG.has_orientation = Attr(field_type=<class ‘bool’>, default=True, required=True)

labels : tvb.datatypes.sensors.Sensors.labels = NArray(label=’Sensor labels’, dtype=<U128, default=None, dim_names=(), ndim=None, required=True)

locations : tvb.datatypes.sensors.Sensors.locations = NArray(label=’Sensor locations’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

number_of_sensorstvb.datatypes.sensors.Sensors.number_of_sensors = Int(field_type=<class ‘int’>, default=0, required=True)

The number of sensors described by these Sensors.

usabletvb.datatypes.sensors.Sensors.usable = NArray(label=’Usable sensors’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

The sensors in set which are used for signal data.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

classmethod from_file(source_file='meg_151.txt.bz2')[source]
has_orientation

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

orientations

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

sensors_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

tvb.datatypes.sensors.make_sensors(sensors_type)[source]

Build a Sensors instance, based on an input type :param sensors_type: one of the supported subtypes :return: Instance of the corresponding sensors class, or None

spectral

The Spectral datatypes.

class tvb.datatypes.spectral.CoherenceSpectrum(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.spectral.CoherenceSpectrum]

Result of a NodeCoherence Analysis.

Attributes declared

array_data : tvb.datatypes.spectral.CoherenceSpectrum.array_data = NArray(label=’’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

sourcetvb.datatypes.spectral.CoherenceSpectrum.source = Attr(field_type=<class ‘tvb.datatypes.time_series.TimeSeries’>, default=None, required=True)

Links to the time-series on which the node_coherence is applied.

nffttvb.datatypes.spectral.CoherenceSpectrum.nfft = Int(field_type=<class ‘int’>, default=256, required=True)

NOTE: must be a power of 2

frequency : tvb.datatypes.spectral.CoherenceSpectrum.frequency = NArray(label=’Frequency’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

frequency

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

nfft

Declares an integer This is different from Attr(field_type=int). The former enforces int subtypes This allows all integer types, including numpy ones that can be safely cast to the declared type according to numpy rules

source

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

class tvb.datatypes.spectral.ComplexCoherenceSpectrum(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.spectral.ComplexCoherenceSpectrum]

Result of a NodeComplexCoherence Analysis.

Attributes declared

cross_spectrumtvb.datatypes.spectral.ComplexCoherenceSpectrum.cross_spectrum = NArray(label=’The cross spectrum’, dtype=complex128, default=None, dim_names=(), ndim=None, required=True)

A complex ndarray that contains the nodes x nodes cross spectrum for every frequency frequency and for every segment.

array_datatvb.datatypes.spectral.ComplexCoherenceSpectrum.array_data = NArray(label=’Complex Coherence’, dtype=complex128, default=None, dim_names=(), ndim=None, required=True)

The complex coherence coefficients calculated from the cross spectrum. The imaginary values of this complex ndarray represent the imaginary coherence.

sourcetvb.datatypes.spectral.ComplexCoherenceSpectrum.source = Attr(field_type=<class ‘tvb.datatypes.time_series.TimeSeries’>, default=None, required=True)

Links to the time-series on which the node_coherence is applied.

epoch_lengthtvb.datatypes.spectral.ComplexCoherenceSpectrum.epoch_length = Float(field_type=<class ‘float’>, default=0, required=True)

The timeseries was segmented into equally sized blocks (overlapping if necessary), prior to the application of the FFT. The segement length determines the frequency resolution of the resulting spectra.

segment_lengthtvb.datatypes.spectral.ComplexCoherenceSpectrum.segment_length = Float(field_type=<class ‘float’>, default=0, required=True)

The timeseries was segmented into equally sized blocks (overlapping if necessary), prior to the application of the FFT. The segement length determines the frequency resolution of the resulting spectra.

windowing_functiontvb.datatypes.spectral.ComplexCoherenceSpectrum.windowing_function = Attr(field_type=<class ‘str’>, default=None, required=True)

The windowing function applied to each time segment prior to application of the FFT.

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

cross_spectrum

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

epoch_length

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

property freq_step

Frequency step size of the Complex Coherence Spectrum.

property frequency

Frequencies represented in the Complex Coherence Spectrum.

property max_freq

Maximum frequency represented in the Complex Coherence Spectrum.

segment_length

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

source

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

spectrum_types = ['Imaginary', 'Real', 'Absolute']
summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

windowing_function

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.spectral.FourierSpectrum(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.spectral.FourierSpectrum]

Result of a Fourier Analysis.

Attributes declared

array_data : tvb.datatypes.spectral.FourierSpectrum.array_data = NArray(label=’’, dtype=complex128, default=None, dim_names=(), ndim=None, required=True)

sourcetvb.datatypes.spectral.FourierSpectrum.source = Attr(field_type=<class ‘tvb.datatypes.time_series.TimeSeries’>, default=None, required=True)

Links to the time-series on which the FFT is applied.

segment_lengthtvb.datatypes.spectral.FourierSpectrum.segment_length = Float(field_type=<class ‘float’>, default=0, required=True)

The timeseries was segmented into equally sized blocks (overlapping if necessary), prior to the application of the FFT. The segement length determines the frequency resolution of the resulting spectra.

windowing_functiontvb.datatypes.spectral.FourierSpectrum.windowing_function = EnumAttr(field_type=<enum ‘WindowingFunctionsEnum’>, default=<WindowingFunctionsEnum.HAMMING: ‘hamming’>, required=False)

The windowing function applied to each time segment prior to application of the FFT.

amplitude : tvb.datatypes.spectral.FourierSpectrum.amplitude = NArray(label=’Amplitude’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

phase : tvb.datatypes.spectral.FourierSpectrum.phase = NArray(label=’Phase’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

power : tvb.datatypes.spectral.FourierSpectrum.power = NArray(label=’Power’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

average_power : tvb.datatypes.spectral.FourierSpectrum.average_power = NArray(label=’Average Power’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

normalised_average_power : tvb.datatypes.spectral.FourierSpectrum.normalised_average_power = NArray(label=’Normalised Power’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

amplitude

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

average_power

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

compute_amplitude()[source]

Amplitude of the complex Fourier spectrum.

compute_average_power()[source]

Average-power of the complex Fourier spectrum.

compute_normalised_average_power()[source]

Normalised-average-power of the complex Fourier spectrum.

compute_phase()[source]

Phase of the Fourier spectrum.

compute_power()[source]

Power of the complex Fourier spectrum.

configure()[source]

compute dependent fields like amplitude

property freq_step

Frequency step size of the complex Fourier spectrum.

property frequency

Frequencies represented the complex Fourier spectrum.

property max_freq

Amplitude of the complex Fourier spectrum.

normalised_average_power

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

phase

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

power

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

segment_length

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

source

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

windowing_function
class tvb.datatypes.spectral.WaveletCoefficients(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.spectral.WaveletCoefficients]

This class bundles all the elements of a Wavelet Analysis into a single object, including the input TimeSeries datatype and the output results as arrays (FloatArray)

Attributes declared

array_data : tvb.datatypes.spectral.WaveletCoefficients.array_data = NArray(label=’’, dtype=complex128, default=None, dim_names=(), ndim=None, required=True)

source : tvb.datatypes.spectral.WaveletCoefficients.source = Attr(field_type=<class ‘tvb.datatypes.time_series.TimeSeries’>, default=None, required=True)

mothertvb.datatypes.spectral.WaveletCoefficients.mother = Attr(field_type=<class ‘str’>, default=’morlet’, required=True)

A string specifying the type of mother wavelet to use, default is ‘morlet’.

sample_period : tvb.datatypes.spectral.WaveletCoefficients.sample_period = Float(field_type=<class ‘float’>, default=0, required=True)

frequenciestvb.datatypes.spectral.WaveletCoefficients.frequencies = NArray(label=’Frequencies’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

A vector that maps scales to frequencies.

normalisation : tvb.datatypes.spectral.WaveletCoefficients.normalisation = Attr(field_type=<class ‘str’>, default=None, required=True)

q_ratio : tvb.datatypes.spectral.WaveletCoefficients.q_ratio = Float(field_type=<class ‘float’>, default=5.0, required=True)

amplitude : tvb.datatypes.spectral.WaveletCoefficients.amplitude = NArray(label=’Amplitude’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

phase : tvb.datatypes.spectral.WaveletCoefficients.phase = NArray(label=’Phase’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

power : tvb.datatypes.spectral.WaveletCoefficients.power = NArray(label=’Power’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

amplitude

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

compute_amplitude()[source]

Amplitude of the complex Wavelet coefficients.

compute_phase()[source]

Phase of the Wavelet coefficients.

compute_power()[source]

Power of the complex Wavelet coefficients.

frequencies

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

property frequency

Frequencies represented by the wavelet spectrogram.

mother

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

normalisation

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

phase

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

power

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

q_ratio

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

sample_period

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

source

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

class tvb.datatypes.spectral.WindowingFunctionsEnum(value)[source]

Bases: TVBEnum

An enumeration.

BARTLETT = 'bartlett'
BLACKMAN = 'blackman'
HAMMING = 'hamming'
HANNING = 'hanning'

structural

The Volume datatypes.

class tvb.datatypes.structural.StructuralMRI(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.structural.StructuralMRI]

Quantitative volumetric data recorded by means of Magnetic Resonance Imaging.

Attributes declared

array_data : tvb.datatypes.structural.StructuralMRI.array_data = NArray(label=’contrast’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

weighting : tvb.datatypes.structural.StructuralMRI.weighting = Attr(field_type=<class ‘str’>, default=None, required=True)

volume : tvb.datatypes.structural.StructuralMRI.volume = Attr(field_type=<class ‘tvb.datatypes.volumes.Volume’>, default=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

volume

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

weighting

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

surfaces

Surface relates DataTypes.

class tvb.datatypes.surfaces.BrainSkull(**kwargs)[source]

Bases: Surface

Traited class [tvb.datatypes.surfaces.BrainSkull]

Brain - inner skull interface surface.

Attributes declared

surface_type : tvb.datatypes.surfaces.BrainSkull.surface_type = Final(field_type=<class ‘str’>, default=’Brain Skull’, required=True)

verticestvb.datatypes.surfaces.Surface.vertices = NArray(label=’Vertex positions’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array specifying coordinates for the surface vertices.

trianglestvb.datatypes.surfaces.Surface.triangles = NArray(label=’Triangles’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

Array of indices into the vertices, specifying the triangles which define the surface.

vertex_normalstvb.datatypes.surfaces.Surface.vertex_normals = NArray(label=’Vertex normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces vertices.

triangle_normalstvb.datatypes.surfaces.Surface.triangle_normals = NArray(label=’Triangle normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces triangles.

geodesic_distance_matrixtvb.datatypes.surfaces.Surface.geodesic_distance_matrix = Attr(field_type=<class ‘scipy.sparse._csc.csc_matrix’>, default=None, required=False)

A sparse matrix of truncated geodesic distances

number_of_verticestvb.datatypes.surfaces.Surface.number_of_vertices = Int(field_type=<class ‘int’>, default=0, required=True)

The number of vertices making up this surface.

number_of_trianglestvb.datatypes.surfaces.Surface.number_of_triangles = Int(field_type=<class ‘int’>, default=0, required=True)

The number of triangles making up this surface.

edge_mean_length : tvb.datatypes.surfaces.Surface.edge_mean_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_min_length : tvb.datatypes.surfaces.Surface.edge_min_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_max_length : tvb.datatypes.surfaces.Surface.edge_max_length = Float(field_type=<class ‘float’>, default=0, required=True)

hemisphere_mask : tvb.datatypes.surfaces.Surface.hemisphere_mask = NArray(label=’An array specifying if a vertex belongs to the right hemisphere’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

zero_based_triangles : tvb.datatypes.surfaces.Surface.zero_based_triangles = Attr(field_type=<class ‘bool’>, default=None, required=True)

bi_hemispheric : tvb.datatypes.surfaces.Surface.bi_hemispheric = Attr(field_type=<class ‘bool’>, default=False, required=True)

valid_for_simulations : tvb.datatypes.surfaces.Surface.valid_for_simulations = Attr(field_type=<class ‘bool’>, default=True, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

classmethod from_file(source_file='inner_skull_4096.zip')[source]

Construct a Surface from source_file.

surface_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

class tvb.datatypes.surfaces.CorticalSurface(**kwargs)[source]

Bases: Surface

Traited class [tvb.datatypes.surfaces.CorticalSurface]

Cortical or pial surface.

Attributes declared

surface_type : tvb.datatypes.surfaces.CorticalSurface.surface_type = Final(field_type=<class ‘str’>, default=’Cortical Surface’, required=True)

verticestvb.datatypes.surfaces.Surface.vertices = NArray(label=’Vertex positions’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array specifying coordinates for the surface vertices.

trianglestvb.datatypes.surfaces.Surface.triangles = NArray(label=’Triangles’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

Array of indices into the vertices, specifying the triangles which define the surface.

vertex_normalstvb.datatypes.surfaces.Surface.vertex_normals = NArray(label=’Vertex normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces vertices.

triangle_normalstvb.datatypes.surfaces.Surface.triangle_normals = NArray(label=’Triangle normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces triangles.

geodesic_distance_matrixtvb.datatypes.surfaces.Surface.geodesic_distance_matrix = Attr(field_type=<class ‘scipy.sparse._csc.csc_matrix’>, default=None, required=False)

A sparse matrix of truncated geodesic distances

number_of_verticestvb.datatypes.surfaces.Surface.number_of_vertices = Int(field_type=<class ‘int’>, default=0, required=True)

The number of vertices making up this surface.

number_of_trianglestvb.datatypes.surfaces.Surface.number_of_triangles = Int(field_type=<class ‘int’>, default=0, required=True)

The number of triangles making up this surface.

edge_mean_length : tvb.datatypes.surfaces.Surface.edge_mean_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_min_length : tvb.datatypes.surfaces.Surface.edge_min_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_max_length : tvb.datatypes.surfaces.Surface.edge_max_length = Float(field_type=<class ‘float’>, default=0, required=True)

hemisphere_mask : tvb.datatypes.surfaces.Surface.hemisphere_mask = NArray(label=’An array specifying if a vertex belongs to the right hemisphere’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

zero_based_triangles : tvb.datatypes.surfaces.Surface.zero_based_triangles = Attr(field_type=<class ‘bool’>, default=None, required=True)

bi_hemispheric : tvb.datatypes.surfaces.Surface.bi_hemispheric = Attr(field_type=<class ‘bool’>, default=False, required=True)

valid_for_simulations : tvb.datatypes.surfaces.Surface.valid_for_simulations = Attr(field_type=<class ‘bool’>, default=True, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

surface_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

class tvb.datatypes.surfaces.EEGCap(**kwargs)[source]

Bases: Surface

Traited class [tvb.datatypes.surfaces.EEGCap]

EEG cap surface.

Attributes declared

surface_type : tvb.datatypes.surfaces.EEGCap.surface_type = Final(field_type=<class ‘str’>, default=’EEG Cap’, required=True)

verticestvb.datatypes.surfaces.Surface.vertices = NArray(label=’Vertex positions’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array specifying coordinates for the surface vertices.

trianglestvb.datatypes.surfaces.Surface.triangles = NArray(label=’Triangles’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

Array of indices into the vertices, specifying the triangles which define the surface.

vertex_normalstvb.datatypes.surfaces.Surface.vertex_normals = NArray(label=’Vertex normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces vertices.

triangle_normalstvb.datatypes.surfaces.Surface.triangle_normals = NArray(label=’Triangle normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces triangles.

geodesic_distance_matrixtvb.datatypes.surfaces.Surface.geodesic_distance_matrix = Attr(field_type=<class ‘scipy.sparse._csc.csc_matrix’>, default=None, required=False)

A sparse matrix of truncated geodesic distances

number_of_verticestvb.datatypes.surfaces.Surface.number_of_vertices = Int(field_type=<class ‘int’>, default=0, required=True)

The number of vertices making up this surface.

number_of_trianglestvb.datatypes.surfaces.Surface.number_of_triangles = Int(field_type=<class ‘int’>, default=0, required=True)

The number of triangles making up this surface.

edge_mean_length : tvb.datatypes.surfaces.Surface.edge_mean_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_min_length : tvb.datatypes.surfaces.Surface.edge_min_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_max_length : tvb.datatypes.surfaces.Surface.edge_max_length = Float(field_type=<class ‘float’>, default=0, required=True)

hemisphere_mask : tvb.datatypes.surfaces.Surface.hemisphere_mask = NArray(label=’An array specifying if a vertex belongs to the right hemisphere’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

zero_based_triangles : tvb.datatypes.surfaces.Surface.zero_based_triangles = Attr(field_type=<class ‘bool’>, default=None, required=True)

bi_hemispheric : tvb.datatypes.surfaces.Surface.bi_hemispheric = Attr(field_type=<class ‘bool’>, default=False, required=True)

valid_for_simulations : tvb.datatypes.surfaces.Surface.valid_for_simulations = Attr(field_type=<class ‘bool’>, default=True, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

classmethod from_file(source_file='scalp_1082.zip')[source]

Construct a Surface from source_file.

surface_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

class tvb.datatypes.surfaces.FaceSurface(**kwargs)[source]

Bases: Surface

Traited class [tvb.datatypes.surfaces.FaceSurface]

Face surface.

Attributes declared

surface_type : tvb.datatypes.surfaces.FaceSurface.surface_type = Final(field_type=<class ‘str’>, default=’Face’, required=True)

verticestvb.datatypes.surfaces.Surface.vertices = NArray(label=’Vertex positions’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array specifying coordinates for the surface vertices.

trianglestvb.datatypes.surfaces.Surface.triangles = NArray(label=’Triangles’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

Array of indices into the vertices, specifying the triangles which define the surface.

vertex_normalstvb.datatypes.surfaces.Surface.vertex_normals = NArray(label=’Vertex normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces vertices.

triangle_normalstvb.datatypes.surfaces.Surface.triangle_normals = NArray(label=’Triangle normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces triangles.

geodesic_distance_matrixtvb.datatypes.surfaces.Surface.geodesic_distance_matrix = Attr(field_type=<class ‘scipy.sparse._csc.csc_matrix’>, default=None, required=False)

A sparse matrix of truncated geodesic distances

number_of_verticestvb.datatypes.surfaces.Surface.number_of_vertices = Int(field_type=<class ‘int’>, default=0, required=True)

The number of vertices making up this surface.

number_of_trianglestvb.datatypes.surfaces.Surface.number_of_triangles = Int(field_type=<class ‘int’>, default=0, required=True)

The number of triangles making up this surface.

edge_mean_length : tvb.datatypes.surfaces.Surface.edge_mean_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_min_length : tvb.datatypes.surfaces.Surface.edge_min_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_max_length : tvb.datatypes.surfaces.Surface.edge_max_length = Float(field_type=<class ‘float’>, default=0, required=True)

hemisphere_mask : tvb.datatypes.surfaces.Surface.hemisphere_mask = NArray(label=’An array specifying if a vertex belongs to the right hemisphere’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

zero_based_triangles : tvb.datatypes.surfaces.Surface.zero_based_triangles = Attr(field_type=<class ‘bool’>, default=None, required=True)

bi_hemispheric : tvb.datatypes.surfaces.Surface.bi_hemispheric = Attr(field_type=<class ‘bool’>, default=False, required=True)

valid_for_simulations : tvb.datatypes.surfaces.Surface.valid_for_simulations = Attr(field_type=<class ‘bool’>, default=True, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

classmethod from_file(source_file='face_8614.zip')[source]

Construct a Surface from source_file.

surface_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

class tvb.datatypes.surfaces.SkinAir(**kwargs)[source]

Bases: Surface

Traited class [tvb.datatypes.surfaces.SkinAir]

Skin - air interface surface.

Attributes declared

surface_type : tvb.datatypes.surfaces.SkinAir.surface_type = Final(field_type=<class ‘str’>, default=’Skin Air’, required=True)

verticestvb.datatypes.surfaces.Surface.vertices = NArray(label=’Vertex positions’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array specifying coordinates for the surface vertices.

trianglestvb.datatypes.surfaces.Surface.triangles = NArray(label=’Triangles’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

Array of indices into the vertices, specifying the triangles which define the surface.

vertex_normalstvb.datatypes.surfaces.Surface.vertex_normals = NArray(label=’Vertex normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces vertices.

triangle_normalstvb.datatypes.surfaces.Surface.triangle_normals = NArray(label=’Triangle normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces triangles.

geodesic_distance_matrixtvb.datatypes.surfaces.Surface.geodesic_distance_matrix = Attr(field_type=<class ‘scipy.sparse._csc.csc_matrix’>, default=None, required=False)

A sparse matrix of truncated geodesic distances

number_of_verticestvb.datatypes.surfaces.Surface.number_of_vertices = Int(field_type=<class ‘int’>, default=0, required=True)

The number of vertices making up this surface.

number_of_trianglestvb.datatypes.surfaces.Surface.number_of_triangles = Int(field_type=<class ‘int’>, default=0, required=True)

The number of triangles making up this surface.

edge_mean_length : tvb.datatypes.surfaces.Surface.edge_mean_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_min_length : tvb.datatypes.surfaces.Surface.edge_min_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_max_length : tvb.datatypes.surfaces.Surface.edge_max_length = Float(field_type=<class ‘float’>, default=0, required=True)

hemisphere_mask : tvb.datatypes.surfaces.Surface.hemisphere_mask = NArray(label=’An array specifying if a vertex belongs to the right hemisphere’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

zero_based_triangles : tvb.datatypes.surfaces.Surface.zero_based_triangles = Attr(field_type=<class ‘bool’>, default=None, required=True)

bi_hemispheric : tvb.datatypes.surfaces.Surface.bi_hemispheric = Attr(field_type=<class ‘bool’>, default=False, required=True)

valid_for_simulations : tvb.datatypes.surfaces.Surface.valid_for_simulations = Attr(field_type=<class ‘bool’>, default=True, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

classmethod from_file(source_file='outer_skin_4096.zip')[source]

Construct a Surface from source_file.

surface_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

class tvb.datatypes.surfaces.SkullSkin(**kwargs)[source]

Bases: Surface

Traited class [tvb.datatypes.surfaces.SkullSkin]

Outer-skull - scalp interface surface.

Attributes declared

surface_type : tvb.datatypes.surfaces.SkullSkin.surface_type = Final(field_type=<class ‘str’>, default=’Skull Skin’, required=True)

verticestvb.datatypes.surfaces.Surface.vertices = NArray(label=’Vertex positions’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array specifying coordinates for the surface vertices.

trianglestvb.datatypes.surfaces.Surface.triangles = NArray(label=’Triangles’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

Array of indices into the vertices, specifying the triangles which define the surface.

vertex_normalstvb.datatypes.surfaces.Surface.vertex_normals = NArray(label=’Vertex normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces vertices.

triangle_normalstvb.datatypes.surfaces.Surface.triangle_normals = NArray(label=’Triangle normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces triangles.

geodesic_distance_matrixtvb.datatypes.surfaces.Surface.geodesic_distance_matrix = Attr(field_type=<class ‘scipy.sparse._csc.csc_matrix’>, default=None, required=False)

A sparse matrix of truncated geodesic distances

number_of_verticestvb.datatypes.surfaces.Surface.number_of_vertices = Int(field_type=<class ‘int’>, default=0, required=True)

The number of vertices making up this surface.

number_of_trianglestvb.datatypes.surfaces.Surface.number_of_triangles = Int(field_type=<class ‘int’>, default=0, required=True)

The number of triangles making up this surface.

edge_mean_length : tvb.datatypes.surfaces.Surface.edge_mean_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_min_length : tvb.datatypes.surfaces.Surface.edge_min_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_max_length : tvb.datatypes.surfaces.Surface.edge_max_length = Float(field_type=<class ‘float’>, default=0, required=True)

hemisphere_mask : tvb.datatypes.surfaces.Surface.hemisphere_mask = NArray(label=’An array specifying if a vertex belongs to the right hemisphere’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

zero_based_triangles : tvb.datatypes.surfaces.Surface.zero_based_triangles = Attr(field_type=<class ‘bool’>, default=None, required=True)

bi_hemispheric : tvb.datatypes.surfaces.Surface.bi_hemispheric = Attr(field_type=<class ‘bool’>, default=False, required=True)

valid_for_simulations : tvb.datatypes.surfaces.Surface.valid_for_simulations = Attr(field_type=<class ‘bool’>, default=True, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

classmethod from_file(source_file='outer_skull_4096.zip')[source]

Construct a Surface from source_file.

surface_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

class tvb.datatypes.surfaces.Surface(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.surfaces.Surface]

A base class for other surfaces.

Attributes declared

verticestvb.datatypes.surfaces.Surface.vertices = NArray(label=’Vertex positions’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array specifying coordinates for the surface vertices.

trianglestvb.datatypes.surfaces.Surface.triangles = NArray(label=’Triangles’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

Array of indices into the vertices, specifying the triangles which define the surface.

vertex_normalstvb.datatypes.surfaces.Surface.vertex_normals = NArray(label=’Vertex normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces vertices.

triangle_normalstvb.datatypes.surfaces.Surface.triangle_normals = NArray(label=’Triangle normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces triangles.

geodesic_distance_matrixtvb.datatypes.surfaces.Surface.geodesic_distance_matrix = Attr(field_type=<class ‘scipy.sparse._csc.csc_matrix’>, default=None, required=False)

A sparse matrix of truncated geodesic distances

number_of_verticestvb.datatypes.surfaces.Surface.number_of_vertices = Int(field_type=<class ‘int’>, default=0, required=True)

The number of vertices making up this surface.

number_of_trianglestvb.datatypes.surfaces.Surface.number_of_triangles = Int(field_type=<class ‘int’>, default=0, required=True)

The number of triangles making up this surface.

edge_mean_length : tvb.datatypes.surfaces.Surface.edge_mean_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_min_length : tvb.datatypes.surfaces.Surface.edge_min_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_max_length : tvb.datatypes.surfaces.Surface.edge_max_length = Float(field_type=<class ‘float’>, default=0, required=True)

hemisphere_mask : tvb.datatypes.surfaces.Surface.hemisphere_mask = NArray(label=’An array specifying if a vertex belongs to the right hemisphere’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

zero_based_triangles : tvb.datatypes.surfaces.Surface.zero_based_triangles = Attr(field_type=<class ‘bool’>, default=None, required=True)

bi_hemispheric : tvb.datatypes.surfaces.Surface.bi_hemispheric = Attr(field_type=<class ‘bool’>, default=False, required=True)

surface_type : tvb.datatypes.surfaces.Surface.surface_type = Final(field_type=<class ‘str’>, default=None, required=True)

valid_for_simulations : tvb.datatypes.surfaces.Surface.valid_for_simulations = Attr(field_type=<class ‘bool’>, default=True, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

bi_hemispheric

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

center()[source]

Compute the center of the surface as the mean spot on all the three axes.

compute_equation(focal_points, equation)[source]

focal_points - a list of focal points. Used for specifying the vertices from which the distance is calculated. equation - the equation which should be evaluated

compute_geodesic_distance_matrix(max_dist)[source]

Calculate a sparse matrix of the geodesic distance from each vertex to all vertices within max_dist of them on the surface,

max_dist: find the distance to vertices out as far as max_dist.

NOTE: Compute time increases rapidly with max_dist and the memory efficiency of the sparse matrices decreases, so, don’t use too large a value for max_dist…

compute_topological_constants()[source]
Returns a 4 tuple:
  • the Euler characteristic number

  • indices for any isolated vertices

  • indices of edges where the surface is pinched

  • indices of edges that border holes in the surface

We call isolated vertices those who do not belong to at least 3 triangles.

compute_triangle_normals()[source]

Calculates triangle normals.

compute_vertex_normals()[source]

Estimates vertex normals, based on triangle normals weighted by the angle they subtend at each vertex…

configure()[source]

Compute additional attributes on surface data required for full functionality.

property edge_lengths

The length of the edges defined in the edges attribute.

Calculate the Euclidean distance between the pair of vertices that define the edges in the edges attribute, when missing.

edge_max_length

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

edge_mean_length

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

edge_min_length

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

property edge_triangles

List of the pairs of triangles sharing an edge.

property edges

A sorted list of the two element tuples(vertex_0, vertex_1) representing the edges of the mesh.

classmethod from_bytes_stream(bytes_stream, content_type='.zip')[source]

Construct a Surface from a stream of bytes.

classmethod from_file(source_file='cortex_16384.zip')[source]

Construct a Surface from source_file.

geodesic_distance(sources, max_dist=None, targets=None)[source]

Calculate the geodesic distance between vertices of the surface,

sources: one or more indices into vertices, these are required,

they specify the vertices from which the distance is calculated. NOTE: if multiple sources are provided then the distance returned is the shortest from the closest source.

max_dist: find the distance to vertices out as far as max_dist. targets: one or more indices into vertices,.

NOTE: Either targets or max_dist should be specified, but not

both, specifying neither is equivalent to max_dist=1e100.

NOTE: when max_dist is specifed, distances > max_dist are returned as

numpy.inf

If end_vertex is omitted the distance from the starting vertex to all vertices within max_dist will be returned, if max_dist is also omitted the distance to all vertices on the surface will be returned.

geodesic_distance_matrix

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

hemisphere_mask

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

laplace_beltrami(fv, h=1.0)[source]

Evaluates the discrete Laplace-Beltrami operator for a given vertex-wise function and geodesic distance matrix. From Belkin 2008:

Let K be a mesh in R^3, with V its set of vertices. For face t in K, the number of vertices in t is #t, and V(t) is the set of vertices in t. For a function f : V -> R, this produces another function L_K^h f : V -> R, and L_K^h is computed for any w in V,

L_K^h f (w) = 1 / (4 pi h^2) sum_{t in K} area(t) / #t sum_{p in V(t)} exp(-||p - w||^2/(4*h)) (f(p) - f(w))

Parameters:
  • fv – a function evaluated on each vertex, shape (n, )

  • h – default 1.0

Returns:

matrix of evaluated L-B operator

nth_ring(vertex, neighbourhood=2, contains=False)[source]

Return the vertices of the nth ring around a given vertex, defaults to neighbourhood=2. NOTE: if you want neighbourhood=1 then you should directly access the property vertex_neighbours, ie use surf_obj.vertex_neighbours[vertex] setting contains=True returns all vertices from rings 1 to n inclusive.

property number_of_edges

The number of edges making up the mesh surface.

number_of_triangles

Declares an integer This is different from Attr(field_type=int). The former enforces int subtypes This allows all integer types, including numpy ones that can be safely cast to the declared type according to numpy rules

number_of_vertices

Declares an integer This is different from Attr(field_type=int). The former enforces int subtypes This allows all integer types, including numpy ones that can be safely cast to the declared type according to numpy rules

set_scaled_vertices(new_vertices)[source]
summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

surface_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

property triangle_angles

An array containing the inner angles for each triangle, same shape as triangles.

property triangle_areas

An array specifying the area of the triangles making up a surface.

property triangle_centres

An array specifying the location of triangle centres.

triangle_normals

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

triangles

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

valid_for_simulations

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

validate()[source]

Check that the internal invariants of this class are satisfied. Not meant to ensure that that is the case. Use configure for that. The default configure calls this before it returns. It complains about missing required attrs Can be overridden in subclasses

validate_topology_for_simulations()[source]

Validates if this surface can be used in simulations. The surface should be topologically equivalent to one or two closed spheres. It should not contain isolated vertices. It should not be pinched or have holes: all edges must belong to 2 triangles. The allowance for one or two closed surfaces is because the skull/etc should be represented by a single closed surface and we typically represent the cortex as one closed surface per hemisphere.

Returns:

a ValidationResult

property vertex_neighbours

List of the set of neighbours for each vertex.

vertex_normals

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

property vertex_triangles

List of the set of triangles surrounding each vertex.

vertices

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

zero_based_triangles

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.surfaces.SurfaceTypesEnum(value)[source]

Bases: TVBEnum

An enumeration.

BRAIN_SKULL_SURFACE = 'Brain Skull'
CORTICAL_SURFACE = 'Cortical Surface'
EEG_CAP_SURFACE = 'EEG Cap'
FACE_SURFACE = 'Face'
KEY_OPTION_READ_METADATA = 'Specified in the file metadata'
SKIN_AIR_SURFACE = 'Skin Air'
SKULL_SKIN_SURFACE = 'Skull Skin'
WHITE_MATTER_SURFACE = 'White Matter'
class tvb.datatypes.surfaces.ValidationResult(logger)[source]

Bases: object

Used by surface validate methods to report non-fatal failed validations

add_warning(message, data)[source]
merge(other)[source]
summary()[source]
class tvb.datatypes.surfaces.WhiteMatterSurface(**kwargs)[source]

Bases: Surface

Traited class [tvb.datatypes.surfaces.WhiteMatterSurface]

White matter - gray matter interface surface.

Attributes declared

surface_type : tvb.datatypes.surfaces.WhiteMatterSurface.surface_type = Final(field_type=<class ‘str’>, default=’White Matter’, required=True)

verticestvb.datatypes.surfaces.Surface.vertices = NArray(label=’Vertex positions’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array specifying coordinates for the surface vertices.

trianglestvb.datatypes.surfaces.Surface.triangles = NArray(label=’Triangles’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

Array of indices into the vertices, specifying the triangles which define the surface.

vertex_normalstvb.datatypes.surfaces.Surface.vertex_normals = NArray(label=’Vertex normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces vertices.

triangle_normalstvb.datatypes.surfaces.Surface.triangle_normals = NArray(label=’Triangle normal vectors’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of unit normal vectors for the surfaces triangles.

geodesic_distance_matrixtvb.datatypes.surfaces.Surface.geodesic_distance_matrix = Attr(field_type=<class ‘scipy.sparse._csc.csc_matrix’>, default=None, required=False)

A sparse matrix of truncated geodesic distances

number_of_verticestvb.datatypes.surfaces.Surface.number_of_vertices = Int(field_type=<class ‘int’>, default=0, required=True)

The number of vertices making up this surface.

number_of_trianglestvb.datatypes.surfaces.Surface.number_of_triangles = Int(field_type=<class ‘int’>, default=0, required=True)

The number of triangles making up this surface.

edge_mean_length : tvb.datatypes.surfaces.Surface.edge_mean_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_min_length : tvb.datatypes.surfaces.Surface.edge_min_length = Float(field_type=<class ‘float’>, default=0, required=True)

edge_max_length : tvb.datatypes.surfaces.Surface.edge_max_length = Float(field_type=<class ‘float’>, default=0, required=True)

hemisphere_mask : tvb.datatypes.surfaces.Surface.hemisphere_mask = NArray(label=’An array specifying if a vertex belongs to the right hemisphere’, dtype=bool, default=None, dim_names=(), ndim=None, required=False)

zero_based_triangles : tvb.datatypes.surfaces.Surface.zero_based_triangles = Attr(field_type=<class ‘bool’>, default=None, required=True)

bi_hemispheric : tvb.datatypes.surfaces.Surface.bi_hemispheric = Attr(field_type=<class ‘bool’>, default=False, required=True)

valid_for_simulations : tvb.datatypes.surfaces.Surface.valid_for_simulations = Attr(field_type=<class ‘bool’>, default=True, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

surface_type

An attribute that can only be set once. If a default is provided it counts as a set, so it cannot be written to. Note that if the default is a mutable type, the value is shared with all instances of the owning class. We cannot enforce true constancy in python

tvb.datatypes.surfaces.center_vertices(vertices)[source]

Centres the vertices using means along axes. :param vertices: a numpy array of shape (n, 3) :returns: the centered array

tvb.datatypes.surfaces.make_surface(surface_type)[source]

Build a Surface instance, based on an input type :param surface_type: one of the supported surface types :return: Instance of the corresponding surface lass, or None

temporal_correlations

The Temporal Correlation datatypes.

class tvb.datatypes.temporal_correlations.CrossCorrelation(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.temporal_correlations.CrossCorrelation]

Result of a CrossCorrelation Analysis.

Attributes declared

array_data : tvb.datatypes.temporal_correlations.CrossCorrelation.array_data = NArray(label=’’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

sourcetvb.datatypes.temporal_correlations.CrossCorrelation.source = Attr(field_type=<class ‘tvb.datatypes.time_series.TimeSeries’>, default=None, required=True)

Links to the time-series on which the cross_correlation is applied.

time : tvb.datatypes.temporal_correlations.CrossCorrelation.time = NArray(label=’Temporal Offsets’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

labels_orderingtvb.datatypes.temporal_correlations.CrossCorrelation.labels_ordering = List(of=<class ‘str’>, default=(‘Offsets’, ‘Node’, ‘Node’, ‘State Variable’, ‘Mode’), required=True)

List of strings representing names of each data dimension

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

array_data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

labels_ordering

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

source

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

time

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

time_series

The TimeSeries datatypes.

class tvb.datatypes.time_series.SensorsTSBase(**kwargs)[source]

Bases: TimeSeries

Traited class [tvb.datatypes.time_series.SensorsTSBase]

Attributes declared

title : tvb.datatypes.time_series.TimeSeries.title = Attr(field_type=<class ‘str’>, default=None, required=True)

datatvb.datatypes.time_series.TimeSeries.data = NArray(label=’Time-series data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array of time-series data, with a shape of [tpts, :], where ‘:’ represents 1 or more dimensions

labels_orderingtvb.datatypes.time_series.TimeSeries.labels_ordering = List(of=<class ‘object’>, default=(‘Time’, ‘State Variable’, ‘Space’, ‘Mode’), required=True)

List of strings representing names of each data dimension

labels_dimensionstvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class ‘dict’>, default={}, required=True)

A dictionary containing mappings of the form {‘dimension_name’ : [labels for this dimension] }

timetvb.datatypes.time_series.TimeSeries.time = NArray(label=’Time-series time’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of time values for the time-series, with a shape of [tpts,]. This is ‘time’ as returned by the simulator’s monitors.

start_time : tvb.datatypes.time_series.TimeSeries.start_time = Float(field_type=<class ‘float’>, default=0, required=True)

sample_period : tvb.datatypes.time_series.TimeSeries.sample_period = Float(field_type=<class ‘float’>, default=1.0, required=True)

sample_period_unit : tvb.datatypes.time_series.TimeSeries.sample_period_unit = Attr(field_type=<class ‘str’>, default=’ms’, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

class tvb.datatypes.time_series.TimeSeries(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.time_series.TimeSeries]

Base time-series dataType.

Attributes declared

title : tvb.datatypes.time_series.TimeSeries.title = Attr(field_type=<class ‘str’>, default=None, required=True)

datatvb.datatypes.time_series.TimeSeries.data = NArray(label=’Time-series data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array of time-series data, with a shape of [tpts, :], where ‘:’ represents 1 or more dimensions

labels_orderingtvb.datatypes.time_series.TimeSeries.labels_ordering = List(of=<class ‘object’>, default=(‘Time’, ‘State Variable’, ‘Space’, ‘Mode’), required=True)

List of strings representing names of each data dimension

labels_dimensionstvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class ‘dict’>, default={}, required=True)

A dictionary containing mappings of the form {‘dimension_name’ : [labels for this dimension] }

timetvb.datatypes.time_series.TimeSeries.time = NArray(label=’Time-series time’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of time values for the time-series, with a shape of [tpts,]. This is ‘time’ as returned by the simulator’s monitors.

start_time : tvb.datatypes.time_series.TimeSeries.start_time = Float(field_type=<class ‘float’>, default=0, required=True)

sample_period : tvb.datatypes.time_series.TimeSeries.sample_period = Float(field_type=<class ‘float’>, default=1.0, required=True)

sample_period_unit : tvb.datatypes.time_series.TimeSeries.sample_period_unit = Attr(field_type=<class ‘str’>, default=’ms’, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

data

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

duplicate(**kwargs)[source]
classmethod from_bytes_stream(bytes_stream, content_type='.npz')[source]
get_state_variable(sv_label)[source]
get_subspace_by_index(list_of_index, **kwargs)[source]
get_subspace_by_labels(list_of_labels)[source]
labels_dimensions

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

labels_ordering

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

property nr_dimensions
sample_period

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

property sample_period_ms

:returns sample_period is ms

sample_period_unit

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

property sample_rate

:returns samples per second [Hz]

property shape
property space_labels
start_time

Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.

Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

time

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

property time_unit
title

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

property variables_labels
class tvb.datatypes.time_series.TimeSeriesEEG(**kwargs)[source]

Bases: SensorsTSBase

Traited class [tvb.datatypes.time_series.TimeSeriesEEG]

A time series associated with a set of EEG sensors.

Attributes declared

sensors : tvb.datatypes.time_series.TimeSeriesEEG.sensors = Attr(field_type=<class ‘tvb.datatypes.sensors.SensorsEEG’>, default=None, required=True)

labels_ordering : tvb.datatypes.time_series.TimeSeriesEEG.labels_ordering = List(of=<class ‘str’>, default=(‘Time’, ‘SV’, ‘EEG Sensor’, ‘Mode’), required=True)

title : tvb.datatypes.time_series.TimeSeries.title = Attr(field_type=<class ‘str’>, default=None, required=True)

datatvb.datatypes.time_series.TimeSeries.data = NArray(label=’Time-series data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array of time-series data, with a shape of [tpts, :], where ‘:’ represents 1 or more dimensions

labels_dimensionstvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class ‘dict’>, default={}, required=True)

A dictionary containing mappings of the form {‘dimension_name’ : [labels for this dimension] }

timetvb.datatypes.time_series.TimeSeries.time = NArray(label=’Time-series time’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of time values for the time-series, with a shape of [tpts,]. This is ‘time’ as returned by the simulator’s monitors.

start_time : tvb.datatypes.time_series.TimeSeries.start_time = Float(field_type=<class ‘float’>, default=0, required=True)

sample_period : tvb.datatypes.time_series.TimeSeries.sample_period = Float(field_type=<class ‘float’>, default=1.0, required=True)

sample_period_unit : tvb.datatypes.time_series.TimeSeries.sample_period_unit = Attr(field_type=<class ‘str’>, default=’ms’, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

labels_ordering

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

sensors

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.time_series.TimeSeriesMEG(**kwargs)[source]

Bases: SensorsTSBase

Traited class [tvb.datatypes.time_series.TimeSeriesMEG]

A time series associated with a set of MEG sensors.

Attributes declared

sensors : tvb.datatypes.time_series.TimeSeriesMEG.sensors = Attr(field_type=<class ‘tvb.datatypes.sensors.SensorsMEG’>, default=None, required=True)

labels_ordering : tvb.datatypes.time_series.TimeSeriesMEG.labels_ordering = List(of=<class ‘str’>, default=(‘Time’, ‘SV’, ‘MEG Sensor’, ‘Mode’), required=True)

title : tvb.datatypes.time_series.TimeSeries.title = Attr(field_type=<class ‘str’>, default=None, required=True)

datatvb.datatypes.time_series.TimeSeries.data = NArray(label=’Time-series data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array of time-series data, with a shape of [tpts, :], where ‘:’ represents 1 or more dimensions

labels_dimensionstvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class ‘dict’>, default={}, required=True)

A dictionary containing mappings of the form {‘dimension_name’ : [labels for this dimension] }

timetvb.datatypes.time_series.TimeSeries.time = NArray(label=’Time-series time’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of time values for the time-series, with a shape of [tpts,]. This is ‘time’ as returned by the simulator’s monitors.

start_time : tvb.datatypes.time_series.TimeSeries.start_time = Float(field_type=<class ‘float’>, default=0, required=True)

sample_period : tvb.datatypes.time_series.TimeSeries.sample_period = Float(field_type=<class ‘float’>, default=1.0, required=True)

sample_period_unit : tvb.datatypes.time_series.TimeSeries.sample_period_unit = Attr(field_type=<class ‘str’>, default=’ms’, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

labels_ordering

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

sensors

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.time_series.TimeSeriesRegion(**kwargs)[source]

Bases: TimeSeries

Traited class [tvb.datatypes.time_series.TimeSeriesRegion]

A time-series associated with the regions of a connectivity.

Attributes declared

connectivity : tvb.datatypes.time_series.TimeSeriesRegion.connectivity = Attr(field_type=<class ‘tvb.datatypes.connectivity.Connectivity’>, default=None, required=True)

region_mapping_volume : tvb.datatypes.time_series.TimeSeriesRegion.region_mapping_volume = Attr(field_type=<class ‘tvb.datatypes.region_mapping.RegionVolumeMapping’>, default=None, required=False)

region_mapping : tvb.datatypes.time_series.TimeSeriesRegion.region_mapping = Attr(field_type=<class ‘tvb.datatypes.region_mapping.RegionMapping’>, default=None, required=False)

labels_ordering : tvb.datatypes.time_series.TimeSeriesRegion.labels_ordering = List(of=<class ‘str’>, default=(‘Time’, ‘State Variable’, ‘Region’, ‘Mode’), required=True)

title : tvb.datatypes.time_series.TimeSeries.title = Attr(field_type=<class ‘str’>, default=None, required=True)

datatvb.datatypes.time_series.TimeSeries.data = NArray(label=’Time-series data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array of time-series data, with a shape of [tpts, :], where ‘:’ represents 1 or more dimensions

labels_dimensionstvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class ‘dict’>, default={}, required=True)

A dictionary containing mappings of the form {‘dimension_name’ : [labels for this dimension] }

timetvb.datatypes.time_series.TimeSeries.time = NArray(label=’Time-series time’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of time values for the time-series, with a shape of [tpts,]. This is ‘time’ as returned by the simulator’s monitors.

start_time : tvb.datatypes.time_series.TimeSeries.start_time = Float(field_type=<class ‘float’>, default=0, required=True)

sample_period : tvb.datatypes.time_series.TimeSeries.sample_period = Float(field_type=<class ‘float’>, default=1.0, required=True)

sample_period_unit : tvb.datatypes.time_series.TimeSeries.sample_period_unit = Attr(field_type=<class ‘str’>, default=’ms’, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

connectivity

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

labels_ordering

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

region_mapping

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

region_mapping_volume

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

class tvb.datatypes.time_series.TimeSeriesSEEG(**kwargs)[source]

Bases: SensorsTSBase

Traited class [tvb.datatypes.time_series.TimeSeriesSEEG]

A time series associated with a set of Internal sensors.

Attributes declared

sensors : tvb.datatypes.time_series.TimeSeriesSEEG.sensors = Attr(field_type=<class ‘tvb.datatypes.sensors.SensorsInternal’>, default=None, required=True)

labels_ordering : tvb.datatypes.time_series.TimeSeriesSEEG.labels_ordering = List(of=<class ‘str’>, default=(‘Time’, ‘SV’, ‘sEEG Sensor’, ‘Mode’), required=True)

title : tvb.datatypes.time_series.TimeSeries.title = Attr(field_type=<class ‘str’>, default=None, required=True)

datatvb.datatypes.time_series.TimeSeries.data = NArray(label=’Time-series data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array of time-series data, with a shape of [tpts, :], where ‘:’ represents 1 or more dimensions

labels_dimensionstvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class ‘dict’>, default={}, required=True)

A dictionary containing mappings of the form {‘dimension_name’ : [labels for this dimension] }

timetvb.datatypes.time_series.TimeSeries.time = NArray(label=’Time-series time’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of time values for the time-series, with a shape of [tpts,]. This is ‘time’ as returned by the simulator’s monitors.

start_time : tvb.datatypes.time_series.TimeSeries.start_time = Float(field_type=<class ‘float’>, default=0, required=True)

sample_period : tvb.datatypes.time_series.TimeSeries.sample_period = Float(field_type=<class ‘float’>, default=1.0, required=True)

sample_period_unit : tvb.datatypes.time_series.TimeSeries.sample_period_unit = Attr(field_type=<class ‘str’>, default=’ms’, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

labels_ordering

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

sensors

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.time_series.TimeSeriesSurface(**kwargs)[source]

Bases: TimeSeries

Traited class [tvb.datatypes.time_series.TimeSeriesSurface]

A time-series associated with a Surface.

Attributes declared

surface : tvb.datatypes.time_series.TimeSeriesSurface.surface = Attr(field_type=<class ‘tvb.datatypes.surfaces.CorticalSurface’>, default=None, required=True)

labels_ordering : tvb.datatypes.time_series.TimeSeriesSurface.labels_ordering = List(of=<class ‘str’>, default=(‘Time’, ‘State Variable’, ‘Vertex’, ‘Mode’), required=True)

title : tvb.datatypes.time_series.TimeSeries.title = Attr(field_type=<class ‘str’>, default=None, required=True)

datatvb.datatypes.time_series.TimeSeries.data = NArray(label=’Time-series data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array of time-series data, with a shape of [tpts, :], where ‘:’ represents 1 or more dimensions

labels_dimensionstvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class ‘dict’>, default={}, required=True)

A dictionary containing mappings of the form {‘dimension_name’ : [labels for this dimension] }

timetvb.datatypes.time_series.TimeSeries.time = NArray(label=’Time-series time’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of time values for the time-series, with a shape of [tpts,]. This is ‘time’ as returned by the simulator’s monitors.

start_time : tvb.datatypes.time_series.TimeSeries.start_time = Float(field_type=<class ‘float’>, default=0, required=True)

sample_period : tvb.datatypes.time_series.TimeSeries.sample_period = Float(field_type=<class ‘float’>, default=1.0, required=True)

sample_period_unit : tvb.datatypes.time_series.TimeSeries.sample_period_unit = Attr(field_type=<class ‘str’>, default=’ms’, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

labels_ordering

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

surface

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

class tvb.datatypes.time_series.TimeSeriesVolume(**kwargs)[source]

Bases: TimeSeries

Traited class [tvb.datatypes.time_series.TimeSeriesVolume]

A time-series associated with a Volume.

Attributes declared

volume : tvb.datatypes.time_series.TimeSeriesVolume.volume = Attr(field_type=<class ‘tvb.datatypes.volumes.Volume’>, default=None, required=True)

labels_ordering : tvb.datatypes.time_series.TimeSeriesVolume.labels_ordering = List(of=<class ‘str’>, default=(‘Time’, ‘X’, ‘Y’, ‘Z’), required=True)

title : tvb.datatypes.time_series.TimeSeries.title = Attr(field_type=<class ‘str’>, default=None, required=True)

datatvb.datatypes.time_series.TimeSeries.data = NArray(label=’Time-series data’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array of time-series data, with a shape of [tpts, :], where ‘:’ represents 1 or more dimensions

labels_dimensionstvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class ‘dict’>, default={}, required=True)

A dictionary containing mappings of the form {‘dimension_name’ : [labels for this dimension] }

timetvb.datatypes.time_series.TimeSeries.time = NArray(label=’Time-series time’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)

An array of time values for the time-series, with a shape of [tpts,]. This is ‘time’ as returned by the simulator’s monitors.

start_time : tvb.datatypes.time_series.TimeSeries.start_time = Float(field_type=<class ‘float’>, default=0, required=True)

sample_period : tvb.datatypes.time_series.TimeSeries.sample_period = Float(field_type=<class ‘float’>, default=1.0, required=True)

sample_period_unit : tvb.datatypes.time_series.TimeSeries.sample_period_unit = Attr(field_type=<class ‘str’>, default=’ms’, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

labels_ordering

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

summary_info()[source]

Gather scientifically interesting summary information from an instance of this datatype.

volume

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

tracts

module docstring .. moduleauthor:: Mihai Andrei <mihai.andrei@codemart.ro>

class tvb.datatypes.tracts.Tracts(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.tracts.Tracts]

Datatype for results of diffusion imaging tractography.

Attributes declared

verticestvb.datatypes.tracts.Tracts.vertices = NArray(label=’Vertex positions’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

An array specifying coordinates for the tracts vertices.

tract_start_idxtvb.datatypes.tracts.Tracts.tract_start_idx = NArray(label=’Tract starting indices’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

Where is the first vertex of a tract in the vertex array

tract_region : tvb.datatypes.tracts.Tracts.tract_region = NArray(label=’Tract region index’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)

An index used to find quickly all tract emerging from a region tract_region[i] is the region of the i’th tract. -1 represents the background

region_volume_map : tvb.datatypes.tracts.Tracts.region_volume_map = Attr(field_type=<class ‘tvb.datatypes.region_mapping.RegionVolumeMapping’>, default=None, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

region_volume_map

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

tract_region

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

tract_start_idx

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

property tracts_count
vertices

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

volumes

The Volume datatypes.

class tvb.datatypes.volumes.Volume(**kwargs)[source]

Bases: HasTraits

Traited class [tvb.datatypes.volumes.Volume]

Data defined on a regular grid in three dimensions.

Attributes declared

origin : tvb.datatypes.volumes.Volume.origin = NArray(label=’Volume origin coordinates’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

voxel_size : tvb.datatypes.volumes.Volume.voxel_size = NArray(label=’Voxel size’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

voxel_unit : tvb.datatypes.volumes.Volume.voxel_unit = Attr(field_type=<class ‘str’>, default=’mm’, required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

origin

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

summary_info()[source]

A more structured __str__ A 2 column table represented as a dict of str->str The default __str__ and html representations of this object are derived from this table. Override this method and return such a table filled with instance information that informs the user about your instance

voxel_size

Declares a numpy array. dtype enforces the dtype. The default dtype is float64. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.

voxel_unit

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.