analyzers Package

This is the module where all TVB Analyzers are hooked into the framework.

Define in __all__ attribute, modules to be introspected for finding adapters.

bct_adapters

class tvb.adapters.analyzers.bct_adapters.BaseBCT[source]

Bases: ABCAdapter

Interface between Brain Connectivity Toolbox of Olaf Sporns and TVB Framework.

build_connectivity_measure(array_data, connectivity, title='', label_x='', label_y='')[source]
build_float_value_wrapper(result_value, title='')[source]
build_int_value_wrapper(result_int, title='')[source]
get_connectivity(view_model)[source]
get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model)[source]

Abstract method to be implemented in each adapter. Should return the required memory for launching the adapter in kilo-Bytes.

get_required_memory_size(view_model)[source]

Abstract method to be implemented in each adapter. Should return the required memory for launching the adapter.

abstract launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_adapters.BaseBCTForm[source]

Bases: ABCAdapterForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.bct_adapters.BaseBCTModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.bct_adapters.BaseBCTModel]

Attributes declared

connectivity : tvb.adapters.analyzers.bct_adapters.BaseBCTModel.connectivity = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

connectivity

Keep a GID but also link the type of DataType it should point to

class tvb.adapters.analyzers.bct_adapters.BaseUndirected[source]

Bases: BaseBCT

get_form_class()[source]
abstract launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_adapters.BaseUnidirectedBCTForm[source]

Bases: BaseBCTForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

class tvb.adapters.analyzers.bct_adapters.DistanceDBIN[source]

Bases: BaseBCT

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_adapters.DistanceDWEI[source]

Bases: DistanceDBIN

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_adapters.DistanceNETW[source]

Bases: DistanceDBIN

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_adapters.DistanceRDA[source]

Bases: DistanceRDM

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_adapters.DistanceRDM[source]

Bases: DistanceDBIN

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_adapters.ModularityOCSM[source]

Bases: BaseBCT

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_adapters.ModularityOpCSMU[source]

Bases: ModularityOCSM

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

bct_centrality_adapters

class tvb.adapters.analyzers.bct_centrality_adapters.CentralityEigenVector[source]

Bases: BaseUndirected

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_centrality_adapters.CentralityKCoreness[source]

Bases: BaseUndirected

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_centrality_adapters.CentralityKCorenessBD[source]

Bases: CentralityNodeBinary

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_centrality_adapters.CentralityNodeBinary[source]

Bases: BaseBCT

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_centrality_adapters.CentralityNodeWeighted[source]

Bases: BaseBCT

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_centrality_adapters.CentralityShortcuts[source]

Bases: CentralityNodeBinary

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_centrality_adapters.FlowCoefficients[source]

Bases: CentralityNodeBinary

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_centrality_adapters.ParticipationCoefficient[source]

Bases: BaseBCT

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_centrality_adapters.ParticipationCoefficientSign[source]

Bases: ParticipationCoefficient

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_centrality_adapters.SubgraphCentrality[source]

Bases: CentralityNodeBinary

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

bct_clustering_adapters

class tvb.adapters.analyzers.bct_clustering_adapters.ClusteringCoefficient[source]

Bases: BaseBCT

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_clustering_adapters.ClusteringCoefficientBU[source]

Bases: BaseUndirected

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_clustering_adapters.ClusteringCoefficientWD[source]

Bases: ClusteringCoefficient

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_clustering_adapters.ClusteringCoefficientWU[source]

Bases: BaseUndirected

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_clustering_adapters.TransitivityBinaryDirected[source]

Bases: BaseBCT

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_clustering_adapters.TransitivityBinaryUnDirected[source]

Bases: BaseUndirected

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_clustering_adapters.TransitivityWeightedDirected[source]

Bases: TransitivityBinaryDirected

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_clustering_adapters.TransitivityWeightedUnDirected[source]

Bases: TransitivityBinaryUnDirected

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

bct_degree_adapters

class tvb.adapters.analyzers.bct_degree_adapters.Degree[source]

Bases: BaseBCT

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_degree_adapters.DegreeIOD[source]

Bases: Degree

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_degree_adapters.DensityDirected[source]

Bases: BaseBCT

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_degree_adapters.DensityUndirected[source]

Bases: DensityDirected

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_degree_adapters.MatchingIndex[source]

Bases: Degree

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_degree_adapters.Strength[source]

Bases: Degree

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_degree_adapters.StrengthISOS[source]

Bases: Strength

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

class tvb.adapters.analyzers.bct_degree_adapters.StrengthWeights[source]

Bases: Strength

launch(view_model)[source]

To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.

Parameters:

view_model – the data model corresponding to the current adapter

cross_correlation_adapter

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

class tvb.adapters.analyzers.cross_correlation_adapter.CrossCorrelateAdapter[source]

Bases: ABCAdapter

TVB adapter for calling the CrossCorrelate algorithm.

configure(view_model: CrossCorrelateAdapterModel) None[source]

Store the input shape to be later used to estimate memory usage.

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model: CrossCorrelateAdapterModel) int[source]

Returns the required disk size to be able to run the adapter (in kB).

get_required_memory_size(view_model: CrossCorrelateAdapterModel) int[source]

Returns the required memory to be able to run the adapter.

launch(view_model: CrossCorrelateAdapterModel) [CrossCorrelationIndex][source]

Launch algorithm and build results. Compute the node-pairwise cross-correlation of the source 4D TimeSeries represented by the index given as input.

Return a CrossCorrelationIndex. Create a CrossCorrelationH5 that contains the cross-correlation sequences for all possible combinations of the nodes.

See: http://www.scipy.org/doc/api_docs/SciPy.signal.signaltools.html#correlate

Parameters:

view_model – the ViewModel keeping the algorithm inputs

Returns:

the cross correlation index for the given time series

Return type:

CrossCorrelationIndex

class tvb.adapters.analyzers.cross_correlation_adapter.CrossCorrelateAdapterForm[source]

Bases: ABCAdapterForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.cross_correlation_adapter.CrossCorrelateAdapterModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.cross_correlation_adapter.CrossCorrelateAdapterModel]

Attributes declared

time_seriestvb.adapters.analyzers.cross_correlation_adapter.CrossCorrelateAdapterModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The time-series for which the cross correlation sequences are calculated.

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

time_series

Keep a GID but also link the type of DataType it should point to

class tvb.adapters.analyzers.cross_correlation_adapter.PearsonCorrelationCoefficientAdapter[source]

Bases: ABCAdapter

TVB adapter for calling the Pearson correlation coefficients algorithm.

configure(view_model: PearsonCorrelationCoefficientAdapterModel) None[source]

Store the input shape to be later used to estimate memory usage.

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model: PearsonCorrelationCoefficientAdapterModel) int[source]

Returns the required disk size to be able to run the adapter (in kB).

get_required_memory_size(view_model: PearsonCorrelationCoefficientAdapterModel) int[source]

Returns the required memory to be able to run this adapter.

launch(view_model: PearsonCorrelationCoefficientAdapterModel) [CorrelationCoefficientsIndex][source]

Launch algorithm and build results. Compute the node-pairwise pearson correlation coefficient of the given input 4D TimeSeries datatype.

The result will contain values between -1 and 1, inclusive.

Parameters:

view_model – the ViewModel keeping the algorithm inputs

Returns:

the correlation coefficient for the given time series

class tvb.adapters.analyzers.cross_correlation_adapter.PearsonCorrelationCoefficientAdapterForm[source]

Bases: ABCAdapterForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.cross_correlation_adapter.PearsonCorrelationCoefficientAdapterModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.cross_correlation_adapter.PearsonCorrelationCoefficientAdapterModel]

Attributes declared

time_seriestvb.adapters.analyzers.cross_correlation_adapter.PearsonCorrelationCoefficientAdapterModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The time-series for which the cross correlation matrices are calculated.

t_starttvb.adapters.analyzers.cross_correlation_adapter.PearsonCorrelationCoefficientAdapterModel.t_start = Float(field_type=<class ‘float’>, default=0.9765625, required=True)

Time start point (ms). By default it uses the default Monitor sample period. The starting time point of a time series is not zero, but the monitor’s sample period.

t_endtvb.adapters.analyzers.cross_correlation_adapter.PearsonCorrelationCoefficientAdapterModel.t_end = Float(field_type=<class ‘float’>, default=1000.0, required=True)

End time point (ms)

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

t_end

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.

t_start

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.

time_series

Keep a GID but also link the type of DataType it should point to

fcd_adapter

Adapter that uses the traits model to generate interfaces for FCD Analyzer.

class tvb.adapters.analyzers.fcd_adapter.FCDAdapterForm[source]

Bases: ABCAdapterForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.fcd_adapter.FCDAdapterModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.fcd_adapter.FCDAdapterModel]

Attributes declared

time_seriestvb.adapters.analyzers.fcd_adapter.FCDAdapterModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The time-series for which the fcd matrices are calculated.

swtvb.adapters.analyzers.fcd_adapter.FCDAdapterModel.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 data-points within each window, centered at time ti, are used to calculate FC(ti) as Pearson correlation. The ij element of the FCD matrix is calculated as the Pearson Correlation between FC(ti) and FC(tj) arranged in a vector.

sptvb.adapters.analyzers.fcd_adapter.FCDAdapterModel.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 data-points 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

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

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.

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.

time_series

Keep a GID but also link the type of DataType it should point to

class tvb.adapters.analyzers.fcd_adapter.FunctionalConnectivityDynamicsAdapter[source]

Bases: ABCAdapter

TVB adapter for calling the Pearson CrossCorrelation algorithm.

The present class will do the following actions:

  • Compute the the fcd of the timeseries; the fcd 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 data-points 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) -in a vector

  • Apply to the fcd the spectral embedding algorithm in order to calculate epochs of stability of the fcd

    (length of time during which FC matrix are high correlated).

The algorithm can produce 2 kind of results:

  • case 1: the algorithm is able to identify the epochs of stability

    – fcs calculated over the epochs of stability (excluded the first one = artifact, due to initial conditions) – 3 eigenvectors, associated to the 3 largest eigenvalues, of the fcs are extracted

  • case 2: the algorithm is not able to identify the epochs of stability

    – fc over the all time series is calculated – 3 first eigenvectors, associated to the 3 largest eigenvalues, of the fcs are extracted

:return
  • fcd matrix whose values are between -1 and 1, inclusive.

  • in case 1: fcd matrix segmented i.e. fcd whose values are between -1 and 1.1, inclusive.

    (Value=1.1 for time not belonging to epochs of stability identified with spectral embedding algorithm) in case 2: fcd matrix segmented identical to the fcd matrix not segmented

  • dictionary containing the eigenvectors.

  • dictionary containing the eigenvalues

  • connectivity associated to the TimeSeriesRegions

configure(view_model: FCDAdapterModel) None[source]

Store the input shape to be later used to estimate memory usage

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model: FCDAdapterModel) int[source]

Abstract method to be implemented in each adapter. Should return the required memory for launching the adapter in kilo-Bytes.

get_required_memory_size(view_model: FCDAdapterModel) int[source]

Abstract method to be implemented in each adapter. Should return the required memory for launching the adapter.

launch(view_model: FCDAdapterModel) [FcdIndex, ConnectivityMeasureIndex][source]

Launch algorithm and build results. :param view_model: the ViewModel keeping the algorithm inputs :return: the fcd index for the computed fcd matrix on the given time-series, with that sw and that sp

fmri_balloon_adapter

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

class tvb.adapters.analyzers.fmri_balloon_adapter.BalloonModelAdapter[source]

Bases: ABCAdapter

TVB adapter for calling the BalloonModel algorithm.

configure(view_model: BalloonModelAdapterModel) None[source]

Store the input shape to be later used to estimate memory usage. Also create the algorithm instance.

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model: BalloonModelAdapterModel) int[source]

Returns the required disk size to be able to run the adapter.(in kB)

get_required_memory_size(view_model: BalloonModelAdapterModel) int[source]

Return the required memory to run this algorithm.

launch(view_model: BalloonModelAdapterModel) [TimeSeriesRegionIndex][source]

Launch algorithm and build results. :param view_model: the ViewModel keeping the algorithm inputs :return: the simulated BOLD signal

class tvb.adapters.analyzers.fmri_balloon_adapter.BalloonModelAdapterForm[source]

Bases: ABCAdapterForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.fmri_balloon_adapter.BalloonModelAdapterModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.fmri_balloon_adapter.BalloonModelAdapterModel]

Attributes declared

time_seriestvb.adapters.analyzers.fmri_balloon_adapter.BalloonModelAdapterModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The timeseries that represents the input neural activity

tau_stvb.adapters.analyzers.fmri_balloon_adapter.BalloonModelAdapterModel.tau_s = Float(field_type=<class ‘float’>, default=1.54, required=True)

Balloon model parameter. Time of signal decay (s)

tau_ftvb.adapters.analyzers.fmri_balloon_adapter.BalloonModelAdapterModel.tau_f = Float(field_type=<class ‘float’>, default=1.44, required=True)

Balloon model parameter. Time of flow-dependent elimination or feedback regulation (s). The average time blood take to traverse the venous compartment. It is the ratio of resting blood volume (V0) to resting blood flow (F0).

neural_input_transformationtvb.adapters.analyzers.fmri_balloon_adapter.BalloonModelAdapterModel.neural_input_transformation = EnumAttr(field_type=<enum ‘NeuralInputTransformations’>, default=<NeuralInputTransformations.NONE: ‘none’>, required=True)

This represents the operation to perform on the state-variable(s) of the model used to generate the input TimeSeries. none takes the first state-variable as neural input; `` abs_diff`` is the absolute value of the derivative (first order difference) of the first state variable; sum: sum all the state-variables of the input TimeSeries.

bold_modeltvb.adapters.analyzers.fmri_balloon_adapter.BalloonModelAdapterModel.bold_model = EnumAttr(field_type=<enum ‘BoldModels’>, default=<BoldModels.NONLINEAR: ‘nonlinear’>, required=True)

Select the set of equations for the BOLD model.

RBMtvb.adapters.analyzers.fmri_balloon_adapter.BalloonModelAdapterModel.RBM = Attr(field_type=<class ‘bool’>, default=True, required=True)

Select classical vs revised BOLD model (CBM or RBM). Coefficients k1, k2 and k3 will be derived accordingly.

normalize_neural_inputtvb.adapters.analyzers.fmri_balloon_adapter.BalloonModelAdapterModel.normalize_neural_input = Attr(field_type=<class ‘bool’>, default=False, required=True)

Set if the mean should be subtracted from the neural input.

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

RBM

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.

bold_model
neural_input_transformation
normalize_neural_input

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.

tau_f

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.

tau_s

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.

time_series

Keep a GID but also link the type of DataType it should point to

fourier_adapter

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

class tvb.adapters.analyzers.fourier_adapter.FFTAdapterForm[source]

Bases: ABCAdapterForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.fourier_adapter.FFTAdapterModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.fourier_adapter.FFTAdapterModel]

Parameters have the following meaning: - time_series: the input time series to which the fft is to be applied - segment_length: the block size which determines the frequency resolution of the resulting power spectra - window_function: windowing functions can be applied before the FFT is performed - detrend: None; specify if detrend is performed on the time series

Attributes declared

time_seriestvb.adapters.analyzers.fourier_adapter.FFTAdapterModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The TimeSeries to which the FFT is to be applied.

segment_lengthtvb.adapters.analyzers.fourier_adapter.FFTAdapterModel.segment_length = Float(field_type=<class ‘float’>, default=1000.0, required=False)

The TimeSeries can be segmented into equally sized blocks (overlapping if necessary). The segment length determines the frequency resolution of the resulting power spectra – longer windows produce finer frequency resolution.

window_functiontvb.adapters.analyzers.fourier_adapter.FFTAdapterModel.window_function = EnumAttr(field_type=<enum ‘WindowingFunctionsEnum’>, default=<WindowingFunctionsEnum.HAMMING: ‘hamming’>, required=False)

Windowing functions can be applied before the FFT is performed. Default is None, possibilities are: ‘hamming’; ‘bartlett’; ‘blackman’; and ‘hanning’. See, numpy.<function_name>.

detrendtvb.adapters.analyzers.fourier_adapter.FFTAdapterModel.detrend = Attr(field_type=<class ‘bool’>, default=True, required=False)

Detrending is not always appropriate. Default is True, False means no detrending is performed on the time series

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

detrend

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.

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.

time_series

Keep a GID but also link the type of DataType it should point to

window_function
class tvb.adapters.analyzers.fourier_adapter.FourierAdapter[source]

Bases: ABCAdapter

TVB adapter for calling the FFT algorithm.

configure(view_model: FFTAdapterModel) None[source]

Do any configuration needed before launching.

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model: FFTAdapterModel) int[source]

Returns the required disk size to be able to run the adapter (in kB).

get_required_memory_size(view_model: FFTAdapterModel) int[source]

Returns the required memory to be able to run the adapter.

launch(view_model: FFTAdapterModel) [FourierSpectrumIndex][source]

Launch algorithm and build results. :param view_model: the ViewModel keeping the algorithm inputs :return: the fourier spectrum for the specified time series

static result_shape(input_shape, segment_length, sample_period)[source]

Returns the shape of the main result (complex array) of the FFT.

result_size(input_shape, segment_length, sample_period)[source]

Returns the storage size in Bytes of the main result (complex array) of the FFT.

ica_adapter

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

class tvb.adapters.analyzers.ica_adapter.ICAAdapter[source]

Bases: ABCAdapter

TVB adapter for calling the ICA algorithm.

configure(view_model: ICAAdapterModel) None[source]

Store the input shape to be later used to estimate memory usage. Also create the algorithm instance.

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model: ICAAdapterModel) int[source]

Returns the required disk size to be able to run the adapter (in kB).

get_required_memory_size(view_model: ICAAdapterModel) int[source]

Return the required memory to run this algorithm.

launch(view_model: ICAAdapterModel) [IndependentComponentsIndex][source]

Launch algorithm and build results. :param view_model: the ViewModel keeping the algorithm inputs :return: the ica index for the specified time series

static result_shape(input_shape, n_components)[source]

Returns the shape of the mixing matrix.

result_size(input_shape, n_components)[source]

Returns the storage size in bytes of the mixing matrix of the ICA analysis, assuming 64-bit float.

class tvb.adapters.analyzers.ica_adapter.ICAAdapterForm[source]

Bases: ABCAdapterForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.ica_adapter.ICAAdapterModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.ica_adapter.ICAAdapterModel]

Attributes declared

time_seriestvb.adapters.analyzers.ica_adapter.ICAAdapterModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The timeseries to which the ICA is to be applied.

n_componentstvb.adapters.analyzers.ica_adapter.ICAAdapterModel.n_components = Int(field_type=<class ‘int’>, default=None, required=False)

Number of principal components to unmix.

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

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

time_series

Keep a GID but also link the type of DataType it should point to

metrics_group_timeseries

Adapter that uses the traits module to generate interfaces for group of Analyzer used to calculate a single measure for TimeSeries.

class tvb.adapters.analyzers.metrics_group_timeseries.TimeseriesMetricsAdapter[source]

Bases: ABCAdapter

TVB adapter for exposing as a group the measure algorithm.

configure(view_model: TimeseriesMetricsAdapterModel) None[source]

Store the input shape to be later used to estimate memory usage.

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model: TimeseriesMetricsAdapterModel) int[source]

Returns the required disk size to be able to run the adapter (in kB).

get_required_memory_size(view_model: TimeseriesMetricsAdapterModel) int[source]

Return the required memory to run this algorithm.

input_shape = ()
launch(view_model: TimeseriesMetricsAdapterModel) [DatatypeMeasureIndex][source]

Launch algorithm and build results. :param view_model: the ViewModel keeping the algorithm inputs

class tvb.adapters.analyzers.metrics_group_timeseries.TimeseriesMetricsAdapterForm[source]

Bases: ABCAdapterForm

static get_extra_algorithm_filters()[source]
static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.metrics_group_timeseries.TimeseriesMetricsAdapterModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.metrics_group_timeseries.TimeseriesMetricsAdapterModel]

Attributes declared

time_seriestvb.adapters.analyzers.metrics_group_timeseries.TimeseriesMetricsAdapterModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The TimeSeries for which the metric(s) will be computed.

algorithmstvb.adapters.analyzers.metrics_group_timeseries.TimeseriesMetricsAdapterModel.algorithms = List(of=<class ‘str’>, default=(), required=True)

The selected algorithms will all be applied on the input TimeSeries

start_pointtvb.adapters.analyzers.metrics_group_timeseries.TimeseriesMetricsAdapterModel.start_point = Float(field_type=<class ‘float’>, default=500.0, required=False)

The start point determines how many points of the TimeSeries will be discarded before computing the metric. By default it drops the first 500 ms.

segmenttvb.adapters.analyzers.metrics_group_timeseries.TimeseriesMetricsAdapterModel.segment = Int(field_type=<class ‘int’>, default=4, required=False)

Divide the input time-series into discrete equally sized sequences and use the last segment to compute the metric. It is only used when the start point is larger than the time-series length.

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

algorithms

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

segment

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

start_point

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.

time_series

Keep a GID but also link the type of DataType it should point to

node_coherence_adapter

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

class tvb.adapters.analyzers.node_coherence_adapter.NodeCoherenceAdapter[source]

Bases: ABCAdapter

TVB adapter for calling the NodeCoherence algorithm.

configure(view_model: NodeCoherenceModel) None[source]

Store the input shape to be later used to estimate memory usage.

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model: NodeCoherenceModel) int[source]

Returns the required disk size to be able to run the adapter (in kB).

get_required_memory_size(view_model: NodeCoherenceModel) int[source]

Return the required memory to run this algorithm.

launch(view_model: NodeCoherenceModel) [CoherenceSpectrumIndex][source]

Launch algorithm and build results. :param view_model: the ViewModel keeping the algorithm inputs :return: the node coherence for the specified time series

static result_shape(input_shape, nfft)[source]

Returns the shape of the main result of NodeCoherence.

result_size(input_shape, nfft)[source]

Returns the storage size in Bytes of the main result of NodeCoherence.

class tvb.adapters.analyzers.node_coherence_adapter.NodeCoherenceForm[source]

Bases: ABCAdapterForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.node_coherence_adapter.NodeCoherenceModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.node_coherence_adapter.NodeCoherenceModel]

Attributes declared

time_seriestvb.adapters.analyzers.node_coherence_adapter.NodeCoherenceModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The timeseries to which the Cross Coherence is to be applied.

nffttvb.adapters.analyzers.node_coherence_adapter.NodeCoherenceModel.nfft = Int(field_type=<class ‘int’>, default=256, required=True)

Should be a power of 2…

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

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

time_series

Keep a GID but also link the type of DataType it should point to

node_complex_coherence_adapter

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

class tvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceAdapter[source]

Bases: ABCAdapter

TVB adapter for calling the NodeComplexCoherence algorithm.

configure(view_model: NodeComplexCoherenceModel) None[source]

Do any configuration needed before launching

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model: NodeComplexCoherenceModel) int[source]

Returns the required disk size to be able to run the adapter (in kB).

get_required_memory_size(view_model: NodeComplexCoherenceModel) int[source]

Return the required memory to run this algorithm.

launch(view_model: NodeComplexCoherenceModel) [ComplexCoherenceSpectrumIndex][source]

Launch algorithm and build results. :param view_model: the ViewModel keeping the algorithm inputs :return: the complex coherence for the specified time series

static result_size(input_shape, max_freq, epoch_length, segment_length, segment_shift, sample_period, zeropad, average_segments)[source]

Returns the storage size in Bytes of the main result (complex array) of the ComplexCoherence

class tvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceForm[source]

Bases: ABCAdapterForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel]

Attributes declared

time_seriestvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The timeseries for which the CrossCoherence and ComplexCoherence is to be computed.

epoch_lengthtvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel.epoch_length = Float(field_type=<class ‘float’>, default=1000.0, required=False)

In general for lengthy EEG recordings (~30 min), the timeseries are divided into equally sized segments (~ 20-40s). These contain the event that is to be characterized by means of the cross coherence. Additionally each epoch block will be further divided into segments to which the FFT will be applied.

segment_lengthtvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel.segment_length = Float(field_type=<class ‘float’>, default=500.0, required=False)

The timeseries can be segmented into equally sized blocks (overlapping if necessary). The segment length determines the frequency resolution of the resulting power spectra – longer windows produce finer frequency resolution.

segment_shifttvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel.segment_shift = Float(field_type=<class ‘float’>, default=250.0, required=False)

Time length by which neighboring segments are shifted. e.g. segment shift = segment_length / 2 means 50% overlapping segments.

window_functiontvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel.window_function = Attr(field_type=<class ‘str’>, default=’hanning’, required=False)

Windowing functions can be applied before the FFT is performed. Default is hanning, possibilities are: ‘hamming’; ‘bartlett’; ‘blackman’; and ‘hanning’. See, numpy.<function_name>.

average_segmentstvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel.average_segments = Attr(field_type=<class ‘bool’>, default=True, required=False)

Flag. If True, compute the mean Cross Spectrum across segments.

subtract_epoch_averagetvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel.subtract_epoch_average = Attr(field_type=<class ‘bool’>, default=True, required=False)

Flag. If True and if the number of epochs is > 1, you can optionally subtract the mean across epochs before computing the complex coherence.

zeropadtvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel.zeropad = Int(field_type=<class ‘int’>, default=0, required=False)

Adds n zeros at the end of each segment and at the end of window_function. It is not yet functional.

detrend_tstvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel.detrend_ts = Attr(field_type=<class ‘bool’>, default=False, required=False)

Flag. If True removes linear trend along the time dimension before applying FFT.

max_freqtvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel.max_freq = Float(field_type=<class ‘float’>, default=1024.0, required=False)

Maximum frequency points (e.g. 32., 64., 128.) represented in the output. Default is segment_length / 2 + 1.

npattvb.adapters.analyzers.node_complex_coherence_adapter.NodeComplexCoherenceModel.npat = Float(field_type=<class ‘float’>, default=1.0, required=False)

This attribute appears to be related to an input projection matrix… Which is not yet implemented

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

average_segments

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.

detrend_ts

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.

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.

max_freq

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.

npat

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.

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.

segment_shift

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.

subtract_epoch_average

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.

time_series

Keep a GID but also link the type of DataType it should point to

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

zeropad

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

node_covariance_adapter

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

class tvb.adapters.analyzers.node_covariance_adapter.NodeCovarianceAdapter[source]

Bases: ABCAdapter

TVB adapter for calling the NodeCovariance algorithm.

configure(view_model: NodeCovarianceAdapterModel) None[source]

Store the input shape to be later used to estimate memory usage.

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model: NodeCovarianceAdapterModel) int[source]

Returns the required disk size to be able to run the adapter ( in kB).

get_required_memory_size(view_model: NodeCovarianceAdapterModel) int[source]

Return the required memory to run this algorithm.

launch(view_model: NodeCovarianceAdapterModel) [CovarianceIndex][source]

Launch algorithm and build results. :param view_model: the ViewModel keeping the algorithm inputs :return: the CovarianceIndex built with the given time_series index as source

class tvb.adapters.analyzers.node_covariance_adapter.NodeCovarianceAdapterForm[source]

Bases: ABCAdapterForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.node_covariance_adapter.NodeCovarianceAdapterModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.node_covariance_adapter.NodeCovarianceAdapterModel]

Attributes declared

time_seriestvb.adapters.analyzers.node_covariance_adapter.NodeCovarianceAdapterModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The timeseries to which the NodeCovariance is to be applied.

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

time_series

Keep a GID but also link the type of DataType it should point to

pca_adapter

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

class tvb.adapters.analyzers.pca_adapter.PCAAdapter[source]

Bases: ABCAdapter

TVB adapter for calling the PCA algorithm.

configure(view_model: PCAAdapterModel) None[source]

Store the input shape to be later used to estimate memory usage

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model: PCAAdapterModel) int[source]

Returns the required disk size to be able to run the adapter (in kB).

get_required_memory_size(view_model: PCAAdapterModel) int[source]

Return the required memory to run this algorithm.

launch(view_model: PCAAdapterModel) [PrincipalComponentsIndex][source]

Launch algorithm and build results. :param view_model: the ViewModel keeping the algorithm inputs :return: the PrincipalComponentsIndex object built with the given timeseries as source

static result_shape(input_shape)[source]

Returns the shape of the main result of the PCA analysis – compnnent weights matrix and a vector of fractions.

result_size(input_shape)[source]

Returns the storage size in Bytes of the results of the PCA analysis.

class tvb.adapters.analyzers.pca_adapter.PCAAdapterForm[source]

Bases: ABCAdapterForm

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.pca_adapter.PCAAdapterModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.pca_adapter.PCAAdapterModel]

Attributes declared

time_seriestvb.adapters.analyzers.pca_adapter.PCAAdapterModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The timeseries to which the PCA is to be applied. NOTE: The TimeSeries must be longer(more time-points) than the number of nodes – Mostly a problem for surface times-series, which, if sampled at 1024Hz, would need to be greater than 16 seconds long.

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

time_series

Keep a GID but also link the type of DataType it should point to

wavelet_adapter

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

class tvb.adapters.analyzers.wavelet_adapter.ContinuousWaveletTransformAdapter[source]

Bases: ABCAdapter

TVB adapter for calling the ContinuousWaveletTransform algorithm.

configure(view_model)[source]

Store the input shape to be later used to estimate memory usage

get_form_class()[source]
get_output()[source]

Describes inputs and outputs of the launch method.

get_required_disk_size(view_model)[source]

Returns the required disk size to be able to run the adapter.(in kB)

get_required_memory_size(view_model)[source]

Return the required memory to run this algorithm.

launch(view_model: WaveletAdapterModel) WaveletCoefficientsIndex[source]

Launch algorithm and build results. :param view_model: the ViewModel keeping the algorithm inputs :return: the wavelet coefficients for the specified time series

static result_shape(frequencies, sample_period, input_shape, input_sample_period)[source]

Returns the shape of the main result (complex array) of the continuous wavelet transform.

result_size(frequencies, sample_period, input_shape, input_sample_period)[source]

Returns the storage size in Bytes of the main result (complex array) of the continuous wavelet transform.

class tvb.adapters.analyzers.wavelet_adapter.ContinuousWaveletTransformAdapterForm[source]

Bases: ABCAdapterForm

fill_trait(datatype)[source]

Copies the value of the TraitFields to the corresponding Attr-ibutes of the given trait instance Note that FormFields are not TraitFields, so this does not work recursively Override to fill in sub-forms

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class

class tvb.adapters.analyzers.wavelet_adapter.RangeForm[source]

Bases: Form

class tvb.adapters.analyzers.wavelet_adapter.WaveletAdapterModel(**kwargs)[source]

Bases: ViewModel

Traited class [tvb.adapters.analyzers.wavelet_adapter.WaveletAdapterModel]

Attributes declared

time_seriestvb.adapters.analyzers.wavelet_adapter.WaveletAdapterModel.time_series = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

The timeseries to which the wavelet is to be applied.

mothertvb.adapters.analyzers.wavelet_adapter.WaveletAdapterModel.mother = Attr(field_type=<class ‘str’>, default=’morlet’, required=True)

The mother wavelet function used in the transform. Default is ‘morlet’, possibilities are: ‘morlet’…

sample_periodtvb.adapters.analyzers.wavelet_adapter.WaveletAdapterModel.sample_period = Float(field_type=<class ‘float’>, default=7.8125, required=True)

The sampling period of the computed wavelet spectrum. NOTE: This should be an integral multiple of the of the sampling period of the source time series, otherwise the actual resulting sample period will be the first correct value below that requested.

frequenciestvb.adapters.analyzers.wavelet_adapter.WaveletAdapterModel.frequencies = Attr(field_type=<class ‘tvb.basic.neotraits._attr.Range’>, default=Range(lo=0.008, hi=0.06, step=0.002), required=True)

The frequency resolution and range returned. Requested frequencies are converted internally into appropriate scales.

normalisationtvb.adapters.analyzers.wavelet_adapter.WaveletAdapterModel.normalisation = Attr(field_type=<class ‘str’>, default=’energy’, required=True)

The type of normalisation for the resulting wavet spectrum. Default is ‘energy’, options are: ‘energy’; ‘gabor’.

q_ratiotvb.adapters.analyzers.wavelet_adapter.WaveletAdapterModel.q_ratio = Float(field_type=<class ‘float’>, default=5.0, required=True)

NFC. Must be greater than 5. Ratios of the center frequencies to bandwidths.

operation_group_gid : tvb.core.neotraits.view_model.ViewModel.operation_group_gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=False)

ranges : tvb.core.neotraits.view_model.ViewModel.ranges = Attr(field_type=<class ‘str’>, default=None, required=False)

range_values : tvb.core.neotraits.view_model.ViewModel.range_values = Attr(field_type=<class ‘str’>, default=None, required=False)

is_metric_operation : tvb.core.neotraits.view_model.ViewModel.is_metric_operation = Attr(field_type=<class ‘bool’>, default=False, required=True)

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

frequencies

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.

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.

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.

time_series

Keep a GID but also link the type of DataType it should point to