The Virtual Brain Project

Table Of Contents

Previous topic

analyzers Package

Next topic

datatypes Package

This Page

creators Package

allen_creator

The adapters in this module create new connectivities from the Allen Institute data using their SDK.

class tvb.adapters.creators.allen_creator.AllenConnectModel(**kwargs)[source]

Bases: tvb.core.neotraits.view_model.ViewModel

resolution : tvb.adapters.creators.allen_creator.AllenConnectModel.resolution = Int(field_type=<class ‘int’>, default=100, required=True)
Definition of the weights of the connectivity :

weighting : tvb.adapters.creators.allen_creator.AllenConnectModel.weighting = Int(field_type=<class ‘int’>, default=1, required=True)

inj_f_thresh : tvb.adapters.creators.allen_creator.AllenConnectModel.inj_f_thresh = Float(field_type=<class ‘float’>, default=80, required=True)
To build the volume and the connectivity select only the areas that have a volume greater than (micron^3):
vol_thresh : tvb.adapters.creators.allen_creator.AllenConnectModel.vol_thresh = Float(field_type=<class ‘float’>, default=1000000000, required=True)
To build the connectivity select only the experiment where the percentage of infected voxels in the injection structure is greater than:

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

inj_f_thresh

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.

resolution

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

vol_thresh

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.

weighting

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

class tvb.adapters.creators.allen_creator.AllenConnectomeBuilder[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapter

Handler for uploading a mouse connectivity from Allen dataset using AllenSDK.

get_form_class()[source]
get_output()[source]
get_required_disk_size(view_model)[source]
get_required_memory_size(view_model)[source]
launch(view_model)[source]
class tvb.adapters.creators.allen_creator.AllenConnectomeBuilderForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapterForm

static get_filters()[source]
static get_input_name()[source]
static get_required_datatype()[source]
static get_view_model()[source]
tvb.adapters.creators.allen_creator.areas_volume_threshold(tvb_mcc, projmaps, vol_thresh, resolution)[source]

the method includes in the parcellation only brain regions whose volume is greater than vol_thresh

tvb.adapters.creators.allen_creator.construct_centres(tvb_mcc, order, key_ord)[source]
tvb.adapters.creators.allen_creator.construct_structural_conn(projmaps, order, key_ord)[source]
tvb.adapters.creators.allen_creator.construct_tract_lengths(centres)[source]
tvb.adapters.creators.allen_creator.create_file_order(projmaps, structure_tree)[source]

the method creates file order and keyord that will be the link between the structural conn order and the id key in the Allen database

tvb.adapters.creators.allen_creator.dictionary_builder(tvb_mcc, transgenic_line)[source]
tvb.adapters.creators.allen_creator.download_an_construct_matrix(tvb_mcc, weighting, ist2e, transgenic_line)[source]
tvb.adapters.creators.allen_creator.infected_threshold(tvb_mcc, projmaps, inj_f_threshold)[source]
tvb.adapters.creators.allen_creator.mouse_brain_visualizer(vol, order, key_ord, unique_parents, unique_grandparents, structure_tree, projmaps)[source]

the method returns a volume indexed between 0 and N-1, with N=tot brain areas in the parcellation. -1=background and areas that are not in the parcellation

tvb.adapters.creators.allen_creator.parents_and_grandparents_finder(tvb_mcc, order, key_ord, structure_tree)[source]
tvb.adapters.creators.allen_creator.pms_cleaner(projmaps)[source]
tvb.adapters.creators.allen_creator.rotate_reference(allen)[source]

connectivity_creator

class tvb.adapters.creators.connectivity_creator.ConnectivityCreator[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapter

This adapter creates a Connectivity.

get_form_class()[source]
get_output()[source]
get_required_disk_size(view_model)[source]
get_required_memory_size(view_model)[source]
launch(view_model)[source]

Method to be called when user submits changes on the Connectivity matrix in the Visualizer.

class tvb.adapters.creators.connectivity_creator.ConnectivityCreatorForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapterForm

static get_filters()[source]
static get_input_name()[source]
static get_required_datatype()[source]
static get_view_model()[source]
class tvb.adapters.creators.connectivity_creator.ConnectivityCreatorModel(**kwargs)[source]

Bases: tvb.core.neotraits.view_model.ViewModel

original_connectivity : tvb.adapters.creators.connectivity_creator.ConnectivityCreatorModel.original_connectivity = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

new_weights : tvb.adapters.creators.connectivity_creator.ConnectivityCreatorModel.new_weights = NArray(label=’Weights json array’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

new_tracts : tvb.adapters.creators.connectivity_creator.ConnectivityCreatorModel.new_tracts = NArray(label=’Tracts json array’, dtype=float64, default=None, dim_names=(), ndim=None, required=True)

interest_area_indexes : tvb.adapters.creators.connectivity_creator.ConnectivityCreatorModel.interest_area_indexes = NArray(label=’Indices of selected nodes as json array’, dtype=int64, default=None, dim_names=(), ndim=None, required=True)

is_branch : tvb.adapters.creators.connectivity_creator.ConnectivityCreatorModel.is_branch = Attr(field_type=<class ‘bool’>, default=None, required=False)

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

interest_area_indexes

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

is_branch

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.

new_tracts

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

new_weights

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

original_connectivity

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

create_algorithm_category_config

local_connectivity_creator

class tvb.adapters.creators.local_connectivity_creator.LocalConnectivityCreator[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapter

The purpose of this adapter is create a LocalConnectivity.

KEY_CUTOFF = 'cutoff'
KEY_DISPLAY_NAME = 'display_name'
KEY_EQUATION = 'equation'
KEY_SURFACE = 'surface'
get_form_class()[source]
get_output()[source]

Describes the 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)[source]

Used for creating a LocalConnectivity

class tvb.adapters.creators.local_connectivity_creator.LocalConnectivityCreatorForm(equation_choices, prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapterForm

NAME_EQUATION_PARAMS_DIV = 'spatial_params'
fill_from_trait(trait)[source]
static get_filters()[source]
static get_input_name()[source]
get_rendering_dict()[source]
static get_required_datatype()[source]
get_traited_datatype()[source]
static get_view_model()[source]
class tvb.adapters.creators.local_connectivity_creator.LocalConnectivityCreatorModel(**kwargs)[source]

Bases: tvb.core.neotraits.view_model.ViewModel, tvb.datatypes.local_connectivity.LocalConnectivity

surface : tvb.adapters.creators.local_connectivity_creator.LocalConnectivityCreatorModel.surface = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

display_name : tvb.adapters.creators.local_connectivity_creator.LocalConnectivityCreatorModel.display_name = Str(field_type=<class ‘str’>, default=None, required=False)

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

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

cutoff : tvb.datatypes.local_connectivity.LocalConnectivity.cutoff = Float(field_type=<class ‘float’>, default=40.0, required=True)
Distance at which to truncate the evaluation in mm.

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

display_name
surface

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

class tvb.adapters.creators.local_connectivity_creator.LocalConnectivitySelectorForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapterForm

static get_filters()[source]
static get_input_name()[source]
get_rendering_dict()[source]
static get_required_datatype()[source]

stimulus_creator

class tvb.adapters.creators.stimulus_creator.RegionStimulusCreator[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapter

The purpose of this adapter is to create a StimuliRegion.

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

Describes the 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)[source]

Used for creating a StimuliRegion instance

launch_mode = <AdapterLaunchModeEnum.SYNC_SAME_MEM: 'sync_same_mem'>
class tvb.adapters.creators.stimulus_creator.RegionStimulusCreatorForm(project_id=None)[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapterForm

NAME_TEMPORAL_PARAMS_DIV = 'temporal_params'
choices = {'Linear': <class 'tvb.datatypes.equations.Linear'>, 'Gaussian': <class 'tvb.datatypes.equations.Gaussian'>, 'Mexican-hat': <class 'tvb.datatypes.equations.DoubleGaussian'>, 'Sigmoid': <class 'tvb.datatypes.equations.Sigmoid'>, 'GeneralizedSigmoid': <class 'tvb.datatypes.equations.GeneralizedSigmoid'>, 'Sinusoid': <class 'tvb.datatypes.equations.Sinusoid'>, 'Cosine': <class 'tvb.datatypes.equations.Cosine'>, 'Alpha': <class 'tvb.datatypes.equations.Alpha'>, 'PulseTrain': <class 'tvb.datatypes.equations.PulseTrain'>}
default_temporal

alias of PulseTrain

fill_from_trait(trait)[source]
static get_filters()[source]
static get_input_name()[source]
get_rendering_dict()[source]
static get_required_datatype()[source]
static get_view_model()[source]
class tvb.adapters.creators.stimulus_creator.RegionStimulusCreatorModel(**kwargs)[source]

Bases: tvb.core.neotraits.view_model.ViewModel, tvb.datatypes.patterns.StimuliRegion

temporal : tvb.adapters.creators.stimulus_creator.RegionStimulusCreatorModel.temporal = Attr(field_type=<class ‘tvb.datatypes.equations.TemporalApplicableEquation’>, default=<tvb.datatypes.equations.PulseTrain object at 0x7fc765091610>, required=True)

connectivity : tvb.adapters.creators.stimulus_creator.RegionStimulusCreatorModel.connectivity = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

display_name : tvb.adapters.creators.stimulus_creator.RegionStimulusCreatorModel.display_name = Str(field_type=<class ‘str’>, default=None, required=False)

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

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

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

connectivity

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

display_name
temporal

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

class tvb.adapters.creators.stimulus_creator.StimulusRegionSelectorForm(project_id=None)[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapterForm

get_rendering_dict()[source]
class tvb.adapters.creators.stimulus_creator.StimulusSurfaceSelectorForm(project_id=None)[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapterForm

get_rendering_dict()[source]
class tvb.adapters.creators.stimulus_creator.SurfaceStimulusCreator[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapter

The purpose of this adapter is to create a StimuliSurface.

KEY_FOCAL_POINTS_TRIANGLES = 'focal_points_triangles'
KEY_SPATIAL = 'spatial'
KEY_SURFACE = 'surface'
KEY_TEMPORAL = 'temporal'
get_form_class()[source]
get_output()[source]

Describes the 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)[source]

Used for creating a StimuliSurface instance

launch_mode = <AdapterLaunchModeEnum.SYNC_SAME_MEM: 'sync_same_mem'>
static prepare_stimuli_surface_from_view_model(view_model, load_full_surface=False)[source]
class tvb.adapters.creators.stimulus_creator.SurfaceStimulusCreatorForm(project_id=None)[source]

Bases: tvb.core.adapters.abcadapter.ABCAdapterForm

NAME_SPATIAL_PARAMS_DIV = 'spatial_params'
NAME_TEMPORAL_PARAMS_DIV = 'temporal_params'
choices_spatial = {'Gaussian': <class 'tvb.datatypes.equations.Gaussian'>, 'Mexican-hat': <class 'tvb.datatypes.equations.DoubleGaussian'>, 'Sigmoid': <class 'tvb.datatypes.equations.Sigmoid'>}
choices_temporal = {'Linear': <class 'tvb.datatypes.equations.Linear'>, 'Gaussian': <class 'tvb.datatypes.equations.Gaussian'>, 'Mexican-hat': <class 'tvb.datatypes.equations.DoubleGaussian'>, 'Sigmoid': <class 'tvb.datatypes.equations.Sigmoid'>, 'GeneralizedSigmoid': <class 'tvb.datatypes.equations.GeneralizedSigmoid'>, 'Sinusoid': <class 'tvb.datatypes.equations.Sinusoid'>, 'Cosine': <class 'tvb.datatypes.equations.Cosine'>, 'Alpha': <class 'tvb.datatypes.equations.Alpha'>, 'PulseTrain': <class 'tvb.datatypes.equations.PulseTrain'>}
default_spatial

alias of Sigmoid

default_temporal

alias of PulseTrain

fill_from_trait(trait)[source]
static get_filters()[source]
static get_input_name()[source]
get_rendering_dict()[source]
static get_required_datatype()[source]
static get_view_model()[source]
class tvb.adapters.creators.stimulus_creator.SurfaceStimulusCreatorModel(**kwargs)[source]

Bases: tvb.core.neotraits.view_model.ViewModel, tvb.datatypes.patterns.StimuliSurface

spatial : tvb.adapters.creators.stimulus_creator.SurfaceStimulusCreatorModel.spatial = Attr(field_type=<class ‘tvb.datatypes.equations.FiniteSupportEquation’>, default=<tvb.datatypes.equations.Sigmoid object at 0x7fc7650910d0>, required=True)

temporal : tvb.adapters.creators.stimulus_creator.SurfaceStimulusCreatorModel.temporal = Attr(field_type=<class ‘tvb.datatypes.equations.TemporalApplicableEquation’>, default=<tvb.datatypes.equations.PulseTrain object at 0x7fc765091050>, required=True)

surface : tvb.adapters.creators.stimulus_creator.SurfaceStimulusCreatorModel.surface = DataTypeGidAttr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

display_name : tvb.adapters.creators.stimulus_creator.SurfaceStimulusCreatorModel.display_name = Str(field_type=<class ‘str’>, default=None, required=False)

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

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

display_name
spatial

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

surface

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

temporal

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