creators Package

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

Interface between Brain Connectivity Toolbox of Olaf Sporns and TVB Framework. This adapter requires BCT deployed locally, and Matlab or Octave installed separately of TVB.

build_connectivity_measure(result, key, connectivity, title='', label_x='', label_y='')[source]
build_float_value_wrapper(result, key, title='')[source]
build_int_value_wrapper(result, key, title='')[source]
static can_be_active()[source]
execute_matlab(matlab_code, **kwargs)[source]
get_input_tree()[source]
get_output()[source]
get_required_disk_size(**kwargs)[source]
get_required_memory_size(**kwargs)[source]
launch(connectivity, **kwargs)[source]
get_input_tree()[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]

launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]

launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]

launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]
launch(connectivity, **kwargs)[source]

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

TVB adapter for calling the CrossCorrelate algorithm.

configure(time_series)[source]

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

Parameters: time_series – the input time-series for which cross correlation should be computed
get_input_tree()[source]

Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining a simulation.

get_output()[source]
get_required_disk_size(**kwargs)[source]

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

get_required_memory_size(**kwargs)[source]

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

launch(time_series)[source]

Launch algorithm and build results.

Parameters: time_series – the input time series for which the correlation should be computed the cross correlation for the given time series CrossCorrelation

TVB adapter for calling the Pearson CrossCorrelation algorithm.

configure(time_series, t_start, t_end)[source]

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

Parameters: time_series – the input time-series for which correlation coefficient should be computed t_start – the physical time interval start for the analysis t_end – physical time, interval end
get_input_tree()[source]

Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining a simulation.

get_output()[source]
get_required_disk_size(**kwargs)[source]

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

get_required_memory_size(**kwargs)[source]

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

launch(time_series, t_start, t_end)[source]

Launch algorithm and build results.

Parameters: time_series – the input time-series for which correlation coefficient should be computed t_start – the physical time interval start for the analysis t_end – physical time, interval end the correlation coefficient for the given time series CorrelationCoefficients

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

TVB adapter for calling the Pearson CrossCorrelation algorithm.

configure(time_series, sw, sp)[source]

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

Parameters: time_series – the input time-series for which fcd matrix should be computed sw – length of the sliding window sp – spanning time: distance between two consecutive sliding window
get_input_tree()[source]

Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining a simulation.

get_output()[source]
get_required_disk_size(**kwargs)[source]
get_required_memory_size(**kwargs)[source]
launch(time_series, sw, sp)[source]

Launch algorithm and build results.

Parameters: time_series – the input time-series for which correlation coefficient should be computed sw – length of the sliding window sp – spanning time: distance between two consecutive sliding window the fcd matrix for the given time-series, with that sw and that sp Fcd,ConnectivityMeasure

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

TVB adapter for calling the BalloonModel algorithm.

configure(time_series, dt=None, bold_model=None, RBM=None, neural_input_transformation=None)[source]

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

get_input_tree()[source]

Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining current analysis.

get_output()[source]
get_required_disk_size(**kwargs)[source]

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

get_required_memory_size(**kwargs)[source]

Return the required memory to run this algorithm.

launch(time_series, dt=None, bold_model=None, RBM=None, neural_input_transformation=None)[source]

Launch algorithm and build results.

Parameters: time_series – the input time-series used as neural activation in the Balloon Model the simulated BOLD signal TimeSeries

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

TVB adapter for calling the FFT algorithm.

configure(time_series, segment_length=None, window_function=None, detrend=None)[source]

Do any configuration needed before launching.

Parameters: 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 (None; ‘hamming’; ‘bartlett’; ‘blackman’; ‘hanning’) – windowing functions can be applied before the FFT is performed detrend – None; specify if detrend is performed on the time series
get_input_tree()[source]

Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining a simulation.

get_output()[source]
get_required_disk_size(**kwargs)[source]

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

get_required_memory_size(**kwargs)[source]

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

launch(time_series, segment_length=None, window_function=None, detrend=None)[source]

Launch algorithm and build results.

Parameters: 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 (None; ‘hamming’; ‘bartlett’; ‘blackman’; ‘hanning’) – windowing functions can be applied before the FFT is performed the fourier spectrum for the specified time series FourierSpectrum

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

TVB adapter for calling the ICA algorithm.

configure(time_series, n_components=None)[source]

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

get_input_tree()[source]

Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining a simulation.

get_output()[source]
get_required_disk_size(**kwargs)[source]

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

get_required_memory_size(**kwargs)[source]

Return the required memory to run this algorithm.

launch(time_series, n_components=None)[source]

Launch algorithm and build results.

## matlab_worker¶

This module implements a class for executing arbitray MATLAB code

Conversion between Python types and MATLAB types is handled and dependent on scipy.io’s loadmat and savemat function.

Bases: object

MatlabAnalyzer is an helper class for calling arbitrary MATLAB code with arbitrary parameters.

Specific analyzers should derive from this class and implement the interface and launch methods inherited from Asynchronous Adapter.

Add a path to the list of paths that will be added to the path in the MATLAB session

cleanup()[source]

Make sure Matlab is closed after execution.

matlab(code, data=None, work_dir=None, cleanup=True)[source]

method matlab takes as arguments:

code: MATLAB code in a string data: a dict of data that scipy.io.savemat knows how to deal with work_dir: working directory to be used by MATLAB cleanup: set to False to keep files

and returns a tuple:

[0] string of code exec’d by MATLAB [1] string of log produced by MATLAB [2] dict of data from MATLAB’s workspace
matlab_paths = []

## metrics_group_timeseries¶

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

TVB adapter for exposing as a group the measure algorithm.

available_algorithms = {'VarianceNodeVariance': <class 'tvb.analyzers.metric_variance_of_node_variance.VarianceNodeVariance'>, 'KuramotoIndex': <class 'tvb.analyzers.metric_kuramoto_index.KuramotoIndex'>, 'GlobalVariance': <class 'tvb.analyzers.metric_variance_global.GlobalVariance'>, 'ProxyMetastabilitySynchrony': <class 'tvb.analyzers.metric_proxy_metastability.ProxyMetastabilitySynchrony'>}
configure(time_series, **kwargs)[source]

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

get_input_tree()[source]

Compute interface based on introspected algorithms found.

get_output()[source]
get_required_disk_size(**kwargs)[source]

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

get_required_memory_size(**kwargs)[source]

Return the required memory to run this algorithm.

launch(time_series, algorithms=None, start_point=None, segment=None)[source]

Launch algorithm and build results.

Parameters: time_series – the time series on which the algorithms are run algorithms (any subclass of BaseTimeseriesMetricAlgorithm (KuramotoIndex, GlobalVariance, VarianceNodeVariance)) – the algorithms to be run for computing measures on the time series DatatypeMeasure

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

TVB adapter for calling the NodeCoherence algorithm.

configure(time_series, nfft=None)[source]

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

get_input_tree()[source]

Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining a simulation.

get_output()[source]
get_required_disk_size(**kwargs)[source]

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

get_required_memory_size(**kwargs)[source]

Return the required memory to run this algorithm.

launch(time_series, nfft=None)[source]

Launch algorithm and build results.

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

TVB adapter for calling the NodeComplexCoherence algorithm.

configure(time_series)[source]

Do any configuration needed before launching and create an instance of the algorithm.

get_input_tree()[source]

Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining a simulation.

get_output()[source]
get_required_disk_size(**kwargs)[source]

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

get_required_memory_size(**kwargs)[source]

Return the required memory to run this algorithm.

launch(time_series)[source]

Launch algorithm and build results.

Returns: the ComplexCoherenceSpectrum built with the given time-series

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

TVB adapter for calling the NodeCovariance algorithm.

configure(time_series)[source]

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

get_input_tree()[source]

Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining a simulation.

get_output()[source]
get_required_disk_size(**kwargs)[source]

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

get_required_memory_size(**kwargs)[source]

Return the required memory to run this algorithm.

launch(time_series)[source]

Launch algorithm and build results.

Returns: the Covariance built with the given timeseries as source

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

TVB adapter for calling the PCA algorithm.

configure(time_series)[source]

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

get_input_tree()[source]

Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining a simulation.

get_output()[source]
get_required_disk_size(**kwargs)[source]

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

get_required_memory_size(**kwargs)[source]

Return the required memory to run this algorithm.

launch(time_series)[source]

Launch algorithm and build results.

Returns: the PrincipalComponents object built with the given timeseries as source

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

TVB adapter for calling the ContinuousWaveletTransform algorithm.

configure(time_series, mother=None, sample_period=None, normalisation=None, q_ratio=None, frequencies='Range', frequencies_parameters=None)[source]

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

get_input_tree()[source]

Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining current analysis.

get_output()[source]
get_required_disk_size(**kwargs)[source]

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

get_required_memory_size(**kwargs)[source]

Return the required memory to run this algorithm.

launch(time_series, mother=None, sample_period=None, normalisation=None, q_ratio=None, frequencies='Range', frequencies_parameters=None)[source]

Launch algorithm and build results.