#### Previous topic

neotraits Package

dsl Package

# datatypes Package¶

TVB DataTypes, as a dictionary between multiple algorithms.

## connectivity¶

The Connectivity datatype.

class tvb.datatypes.connectivity.Connectivity(**kwargs)[source]
region_labels : tvb.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.
weights : tvb.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.
undirected : tvb.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_lengths : tvb.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.
speed : tvb.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.
centres : tvb.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.
cortical : tvb.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.
hemispheres : tvb.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
orientations : tvb.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.
areas : tvb.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.
idelays : tvb.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.
delays : tvb.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_regions : tvb.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_connections : tvb.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 float32. 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.

binarized_weights[source]
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 float32. 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.

The nodes are lying inside an annulus.

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.

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

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 float32. 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]

delays

Declares a numpy array. dtype enforces the dtype. The default dtype is float32. 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.

static 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])]
hemisphere_order_indices[source]

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 float32. 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.

horizon[source]

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 float32. 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 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.

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

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

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

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

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

ordered_centres[source]

Similar to :method:ordered_weights

ordered_labels[source]

Similar to ordered_weights()

ordered_tracts[source]

Similar to ordered_weights()

ordered_weights[source]

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 float32. 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 float32. 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

saved_selection_labels[source]

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_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...
idelays (numpy.array): Transmission delay between brain regions in integration steps.
speed

Declares a numpy array. dtype enforces the dtype. The default dtype is float32. 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]
tract_lengths

Declares a numpy array. dtype enforces the dtype. The default dtype is float32. 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 float32. 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]
Wrapper Class to gather necessary entities for a surface-based simulation. To be used when preparing a simulation launch.
local_connectivity : tvb.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_data : tvb.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_strength : tvb.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 float32. 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.

number_of_triangles[source]

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

number_of_vertices[source]

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.

region_mapping[source]

Define shortcut for retrieving RegionMapping map array.

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.

surface[source]

Define shortcut for retrieving the surface held by a RegionMapping.

triangles[source]

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

vertex_normals[source]

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

vertices[source]

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

## equations¶

The Equation datatypes.

class tvb.datatypes.equations.Alpha(**kwargs)[source]
An Alpha function belonging to the Exponential function family.
equation : tvb.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 0x7f014ab4fc20>, 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]
A Cosine equation.
equation : tvb.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 0x7f014ab4fb90>, 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]
A special case for ‘discrete’ spaces, such as the regions, where each point in the space is effectively just assigned a value.
equation : tvb.datatypes.equations.DiscreteEquation.equation = Attr(field_type=<class ‘str’>, default=’var’, required=True)
The equation defines a function of $$x$$
parameters : tvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f014d5b8560>, 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]

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
equation : tvb.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 0x7f014ab4fef0>, 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]
A Mexican-hat function approximated by the difference of Gaussians functions.
equation : tvb.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 0x7f014ab4f8c0>, 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]

Base class for Equation data types.

equation : tvb.datatypes.equations.Equation.equation = Attr(field_type=<class ‘str’>, default=None, required=True)
the equation as it should be interpreted by numexpr
parameters : tvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f014d5b8560>, 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.FiniteSupportEquation(**kwargs)[source]
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).
equation : tvb.datatypes.equations.Equation.equation = Attr(field_type=<class ‘str’>, default=None, required=True)
the equation as it should be interpreted by numexpr
parameters : tvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f014d5b8560>, 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]

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.
equation : tvb.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 0x7f014ab53050>, 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]

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.

equation : tvb.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 0x7f014ab4fd40>, 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]
A Gaussian equation. offset: parameter to extend the behaviour of this function when spatializing model parameters.
equation : tvb.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 0x7f014ab1e680>, 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]
A General Sigmoid equation.
equation : tvb.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 0x7f014ab4fa70>, 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]

Base class for hemodynamic response functions.

equation : tvb.datatypes.equations.Equation.equation = Attr(field_type=<class ‘str’>, default=None, required=True)
the equation as it should be interpreted by numexpr
parameters : tvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f014d5b8560>, 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.Linear(**kwargs)[source]
A linear equation.
equation : tvb.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 0x7f014ab1e5f0>, 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.MixtureOfGammas(**kwargs)[source]

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

equation : tvb.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 0x7f014ab530e0>, 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]

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

Parameters:

• $$\tau$$ : pulse width or pulse duration
• $$T$$ : pulse repetition period
• $$f$$ : pulse repetition frequency (1/T)
• duty cycle : :math:\frac{\tau}{T} (for a square wave: 0.5)
• onset time :
equation : tvb.datatypes.equations.PulseTrain.equation = Final(field_type=<class ‘str’>, default=’where((var % T) < tau, amp, 0)’, required=True)
$$\frac{\tau}{T} +\sum_{n=1}^{\infty}\frac{2}{n\pi} \sin\left(\frac{\pi\,n\tau}{T}\right) \cos\left(\frac{2\pi\,n}{T} var\right)$$. The starting time is halfway through the first pulse. The phase can be offset t with t - tau/2

parameters : tvb.datatypes.equations.PulseTrain.parameters = Attr(field_type=<class ‘dict’>, default=<function PulseTrain.<lambda> at 0x7f014ab4fcb0>, 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.

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...

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]
A Sigmoid equation. offset: parameter to extend the behaviour of this function when spatializing model parameters.
equation : tvb.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 0x7f014ab4f950>, 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]
A Sinusoid equation.
equation : tvb.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 0x7f014ab4fb00>, 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]
Abstract class introduced just for filtering what equations to be displayed in UI, for setting model parameters on the Surface level.
equation : tvb.datatypes.equations.Equation.equation = Attr(field_type=<class ‘str’>, default=None, required=True)
the equation as it should be interpreted by numexpr
parameters : tvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f014d5b8560>, 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]
Abstract class introduced just for filtering what equations to be displayed in UI, for setting the temporal component in Stimulus on region and surface.
equation : tvb.datatypes.equations.Equation.equation = Attr(field_type=<class ‘str’>, default=None, required=True)
the equation as it should be interpreted by numexpr
parameters : tvb.datatypes.equations.Equation.parameters = Attr(field_type=<class ‘dict’>, default=<function Equation.<lambda> at 0x7f014d5b8560>, 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]

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

source : tvb.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.
sw : tvb.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.
sp : tvb.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_ordering : tvb.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 float32. 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]

Measurement of based on a connectivity.

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 float32. 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]
class tvb.datatypes.graph.CorrelationCoefficients(**kwargs)[source]

Correlation coefficients datatype.

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

source : tvb.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_ordering : tvb.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 float32. 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]
class tvb.datatypes.graph.Covariance(**kwargs)[source]

Covariance datatype.

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

source : tvb.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 float32. 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]

## local_connectivity¶

class tvb.datatypes.local_connectivity.LocalConnectivity(**kwargs)[source]
A sparse matrix for representing the local connectivity within the Cortex.

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 0x7f01487dc690>, required=False)

cutoff : tvb.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]
Result of an Independent Component Analysis.
source : tvb.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_matrix : tvb.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_matrix : tvb.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_components : tvb.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 float32. 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 float32. 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 float32. 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 float32. 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 float32. 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 float32. 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]
Result of a Principal Component Analysis (PCA).
source : tvb.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.
weights : tvb.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.
fractions : tvb.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 float32. 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 float32. 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 float32. 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 float32. 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 float32. 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]
Equation for space variation.

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.

spatial_pattern[source]

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]
A spatio-temporal pattern defined in a volume.

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 float32. 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]
Combine space and time equations.

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.

temporal_pattern[source]

Return a discrete representation of the temporal pattern.

time = None
class tvb.datatypes.patterns.StimuliRegion(**kwargs)[source]
A class that bundles the temporal profile of the stimulus, together with the list of scaling weights of the regions where it will applied.

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 0x7f01485c8310>, 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 float32. 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.

weight_array[source]

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

class tvb.datatypes.patterns.StimuliSurface(**kwargs)[source]
A spatio-temporal pattern defined in a Surface DataType. It includes the list of focal points.

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.

focal_points_surface[source]
focal_points_triangles

Declares a numpy array. dtype enforces the dtype. The default dtype is float32. 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]
Base DataType for representing a ProjectionMatrix. The projection is between a source of type CorticalSurface and a set of Sensors.

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

brain_skull : tvb.datatypes.projections.ProjectionMatrix.brain_skull = Attr(field_type=<class ‘tvb.datatypes.surfaces.BrainSkull’>, default=None, required=False)
Boundary between skull and cortex domains.
skull_skin : tvb.datatypes.projections.ProjectionMatrix.skull_skin = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkullSkin’>, default=None, required=False)
Boundary between skull and skin domains.
skin_air : tvb.datatypes.projections.ProjectionMatrix.skin_air = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkinAir’>, default=None, required=False)
Boundary between skin and air domains.
conductances : tvb.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)

sensors : tvb.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 float32. 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 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

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.

shape[source]
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]
Specific projection, from a CorticalSurface to EEG sensors.

projection_type : tvb.datatypes.projections.ProjectionSurfaceEEG.projection_type = Attr(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_skull : tvb.datatypes.projections.ProjectionMatrix.brain_skull = Attr(field_type=<class ‘tvb.datatypes.surfaces.BrainSkull’>, default=None, required=False)
Boundary between skull and cortex domains.
skull_skin : tvb.datatypes.projections.ProjectionMatrix.skull_skin = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkullSkin’>, default=None, required=False)
Boundary between skull and skin domains.
skin_air : tvb.datatypes.projections.ProjectionMatrix.skin_air = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkinAir’>, default=None, required=False)
Boundary between skin and air domains.
conductances : tvb.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 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

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]
Specific projection, from a CorticalSurface to MEG sensors.

projection_type : tvb.datatypes.projections.ProjectionSurfaceMEG.projection_type = Attr(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_skull : tvb.datatypes.projections.ProjectionMatrix.brain_skull = Attr(field_type=<class ‘tvb.datatypes.surfaces.BrainSkull’>, default=None, required=False)
Boundary between skull and cortex domains.
skull_skin : tvb.datatypes.projections.ProjectionMatrix.skull_skin = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkullSkin’>, default=None, required=False)
Boundary between skull and skin domains.
skin_air : tvb.datatypes.projections.ProjectionMatrix.skin_air = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkinAir’>, default=None, required=False)
Boundary between skin and air domains.
conductances : tvb.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 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

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]
Specific projection, from a CorticalSurface to SEEG sensors.

projection_type : tvb.datatypes.projections.ProjectionSurfaceSEEG.projection_type = Attr(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_skull : tvb.datatypes.projections.ProjectionMatrix.brain_skull = Attr(field_type=<class ‘tvb.datatypes.surfaces.BrainSkull’>, default=None, required=False)
Boundary between skull and cortex domains.
skull_skin : tvb.datatypes.projections.ProjectionMatrix.skull_skin = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkullSkin’>, default=None, required=False)
Boundary between skull and skin domains.
skin_air : tvb.datatypes.projections.ProjectionMatrix.skin_air = Attr(field_type=<class ‘tvb.datatypes.surfaces.SkinAir’>, default=None, required=False)
Boundary between skin and air domains.
conductances : tvb.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 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

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.ProjectionsType[source]

Bases: enum.Enum

An enumeration.

EEG = <ProjectionsType.EEG: 'projEEG'>
MEG = <ProjectionsType.MEG: 'projMEG'>
SEEG = <ProjectionsType.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]
An array (of length Surface.vertices). Each value is representing the index in Connectivity regions to which the current vertex is mapped.

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 float32. 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]
Each value is representing the index in Connectivity regions to which the current voxel is mapped.

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 float32. 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.SensorTypes[source]

Bases: enum.Enum

An enumeration.

TYPE_EEG = <SensorTypes.TYPE_EEG: 'EEG'>
TYPE_INTERNAL = <SensorTypes.TYPE_INTERNAL: 'Internal'>
TYPE_MEG = <SensorTypes.TYPE_MEG: 'MEG'>
class tvb.datatypes.sensors.Sensors(**kwargs)[source]
Base Sensors class. All sensors have locations. Some will have orientations, e.g. MEG.

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_sensors : tvb.datatypes.sensors.Sensors.number_of_sensors = Int(field_type=<class ‘int’>, default=0, required=True)
The number of sensors described by these Sensors.
usable : tvb.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_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 float32. 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 float32. 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 float32. 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 float32. 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]

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


sensors_type : tvb.datatypes.sensors.SensorsEEG.sensors_type = Attr(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_sensors : tvb.datatypes.sensors.Sensors.number_of_sensors = Int(field_type=<class ‘int’>, default=0, required=True)
The number of sensors described by these Sensors.
usable : tvb.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 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.sensors.SensorsInternal(**kwargs)[source]
Sensors inside the brain...

sensors_type : tvb.datatypes.sensors.SensorsInternal.sensors_type = Attr(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_sensors : tvb.datatypes.sensors.Sensors.number_of_sensors = Int(field_type=<class ‘int’>, default=0, required=True)
The number of sensors described by these Sensors.
usable : tvb.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]
grouped_electrodes[source]
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.

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

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


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

orientations : tvb.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_sensors : tvb.datatypes.sensors.Sensors.number_of_sensors = Int(field_type=<class ‘int’>, default=0, required=True)
The number of sensors described by these Sensors.
usable : tvb.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 float32. 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 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.

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]
Result of a NodeCoherence Analysis.

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

source : tvb.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.
nfft : tvb.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 float32. 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 float32. 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]
Result of a NodeComplexCoherence Analysis.
cross_spectrum : tvb.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_data : tvb.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.
source : tvb.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_length : tvb.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_length : tvb.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_function : tvb.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 float32. 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 float32. 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.

freq_step[source]

Frequency step size of the Complex Coherence Spectrum.

frequency[source]

Frequencies represented in the Complex Coherence Spectrum.

max_freq[source]

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]
Result of a Fourier Analysis.

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

source : tvb.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_length : tvb.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_function : tvb.datatypes.spectral.FourierSpectrum.windowing_function = Attr(field_type=<class ‘str’>, default=None, 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 float32. 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 float32. 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 float32. 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

freq_step[source]

Frequency step size of the complex Fourier spectrum.

frequency[source]

Frequencies represented the complex Fourier spectrum.

max_freq[source]

Amplitude of the complex Fourier spectrum.

normalised_average_power

Declares a numpy array. dtype enforces the dtype. The default dtype is float32. 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 float32. 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 float32. 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

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.WaveletCoefficients(**kwargs)[source]
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)

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)

mother : tvb.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)

frequencies : tvb.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 float32. 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 float32. 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 float32. 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[source]

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 float32. 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 float32. 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.

## structural¶

The Volume datatypes.

class tvb.datatypes.structural.StructuralMRI(**kwargs)[source]
Quantitative volumetric data recorded by means of Magnetic Resonance Imaging.

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 float32. 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]

Brain - inner skull interface surface.

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

vertices : tvb.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.
triangles : tvb.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_normals : tvb.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_normals : tvb.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_matrix : tvb.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_vertices : tvb.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_triangles : tvb.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]
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]

Cortical or pial surface.

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

vertices : tvb.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.
triangles : tvb.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_normals : tvb.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_normals : tvb.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_matrix : tvb.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_vertices : tvb.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_triangles : tvb.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 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.EEGCap(**kwargs)[source]

EEG cap surface.

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

vertices : tvb.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.
triangles : tvb.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_normals : tvb.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_normals : tvb.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_matrix : tvb.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_vertices : tvb.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_triangles : tvb.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]
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]

Face surface.

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

vertices : tvb.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.
triangles : tvb.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_normals : tvb.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_normals : tvb.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_matrix : tvb.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_vertices : tvb.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_triangles : tvb.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]
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]

Skin - air interface surface.

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

vertices : tvb.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.
triangles : tvb.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_normals : tvb.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_normals : tvb.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_matrix : tvb.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_vertices : tvb.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_triangles : tvb.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]
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]

Outer-skull - scalp interface surface.

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

vertices : tvb.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.
triangles : tvb.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_normals : tvb.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_normals : tvb.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_matrix : tvb.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_vertices : tvb.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_triangles : tvb.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]
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]

A base class for other surfaces.

vertices : tvb.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.
triangles : tvb.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_normals : tvb.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_normals : tvb.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_matrix : tvb.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_vertices : tvb.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_triangles : tvb.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 = Attr(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.

edge_lengths[source]

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.

edge_triangles[source]

List of the pairs of triangles sharing an edge.

edges[source]

A sorted list of the two element tuples(vertex_0, vertex_1) representing the edges of the mesh.

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.

Declares a numpy array. dtype enforces the dtype. The default dtype is float32. 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 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.

number_of_edges[source]

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

summary_info()[source]

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

surface_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.

triangle_angles[source]

An array containing the inner angles for each triangle, same shape as triangles.

triangle_areas[source]

An array specifying the area of the triangles making up a surface.

triangle_centres[source]

An array specifying the location of triangle centres.

triangle_normals

Declares a numpy array. dtype enforces the dtype. The default dtype is float32. 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 float32. 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]
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
vertex_neighbours[source]

List of the set of neighbours for each vertex.

vertex_normals

Declares a numpy array. dtype enforces the dtype. The default dtype is float32. 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.

vertex_triangles[source]

List of the set of triangles surrounding each vertex.

vertices

Declares a numpy array. dtype enforces the dtype. The default dtype is float32. 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.ValidationResult(logger)[source]

Bases: builtins.object

Used by surface validate methods to report non-fatal failed validations

merge(other)[source]
summary()[source]
class tvb.datatypes.surfaces.WhiteMatterSurface(**kwargs)[source]

White matter - gray matter interface surface.

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

vertices : tvb.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.
triangles : tvb.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_normals : tvb.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_normals : tvb.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_matrix : tvb.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_vertices : tvb.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_triangles : tvb.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]
Result of a CrossCorrelation Analysis.

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

source : tvb.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_ordering : tvb.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 float32. 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 float32. 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]

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

data : tvb.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_ordering : tvb.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_dimensions : tvb.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] }
time : tvb.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]
Base time-series dataType.

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

data : tvb.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_ordering : tvb.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_dimensions : tvb.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] }
time : tvb.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 float32. 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]
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

nr_dimensions[source]
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.

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.

sample_rate[source]

:returns samples per second [kHz]

shape[source]
space_labels[source]
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 float32. 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_unit[source]
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.

variables_labels[source]
class tvb.datatypes.time_series.TimeSeriesEEG(**kwargs)[source]
A time series associated with a set of EEG sensors.

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’, ‘1’, ‘EEG Sensor’, ‘1’), required=True)

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

data : tvb.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_dimensions : tvb.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] }
time : tvb.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]
A time series associated with a set of MEG sensors.

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’, ‘1’, ‘MEG Sensor’, ‘1’), required=True)

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

data : tvb.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_dimensions : tvb.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] }
time : tvb.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]
A time-series associated with the regions of a connectivity.

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)

data : tvb.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_dimensions : tvb.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] }
time : tvb.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]
A time series associated with a set of Internal sensors.

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’, ‘1’, ‘sEEG Sensor’, ‘1’), required=True)

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

data : tvb.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_dimensions : tvb.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] }
time : tvb.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]
A time-series associated with a Surface.

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)

data : tvb.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_dimensions : tvb.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] }
time : tvb.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]
A time-series associated with a Volume.

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)

data : tvb.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_dimensions : tvb.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] }
time : tvb.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]

Datatype for results of diffusion imaging tractography.

vertices : tvb.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_idx : tvb.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 float32. 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 float32. 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.

tracts_count[source]
vertices

Declares a numpy array. dtype enforces the dtype. The default dtype is float32. 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]
Data defined on a regular grid in three dimensions.

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 float32. 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]
voxel_size

Declares a numpy array. dtype enforces the dtype. The default dtype is float32. 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.