The Virtual Brain Project

Table Of Contents

Previous topic

project Package

Next topic

entities Package

This Page

spatial Package

base_spatio_temporal_controller

class tvb.interfaces.web.controllers.spatial.base_spatio_temporal_controller.SpatioTemporalController[source]

Bases: tvb.interfaces.web.controllers.base_controller.BaseController

Base class which contains methods related to spatio-temporal actions.

static add_interface_to_session(left_input_tree, right_input_tree)[source]

left_input_tree and right_input_tree are expected to be lists of dictionaries.

Those 2 given lists will be concatenated and added to session. In order to work the filters, the interface should be added to session.

static display_surface(surface_gid)[source]

Generates the HTML for displaying the surface with the given ID.

fill_default_attributes(template_dictionary, subsection='stimulus')[source]

Overwrite base controller to add required parameters for adapter templates.

get_creator_and_interface(creator_module, creator_class, datatype_instance, lock_midpoint_for_eq=None)[source]

Returns a Tuple: a creator instance and a dictionary for the creator interface. The interface is prepared for rendering, it is populated with existent data, in case of a parameter of type DataType. The name of the attributes are also prefixed to identify groups.

get_select_existent_entities(label, entity_type, entity_gid=None)[source]

Returns the dictionary needed for drawing the select which display all the created entities of the specified type.

static get_series_json(data, label)[source]

For each data point entry, build the FLOT specific JSON.

static get_ui_message(list_of_equation_names)[source]

The message returned by this method should be displayed if the equation with the given name couldn’t be evaluated in all points.

get_x_axis_range(min_x_str, max_x_str)[source]

Fill range for the X-axis displayed in 2D graph.

index(*a, **b)[source]

Displays the main page for the spatio temporal section.

static prepare_entity_interface(input_list)[source]

Prepares the input tree obtained from a creator.

local_connectivity_controller

class tvb.interfaces.web.controllers.spatial.local_connectivity_controller.LocalConnectivityController[source]

Bases: tvb.interfaces.web.controllers.spatial.base_spatio_temporal_controller.SpatioTemporalController

Controller layer for displaying/creating a LocalConnectivity entity.

compute_data_for_gradient_view(*a, **b)[source]

When the user loads an existent local connectivity and he picks a vertex from the used surface, this method computes the data needed for drawing a gradient view corresponding to that vertex.

Returns a json which contains the data needed for drawing a gradient view for the selected vertex.

create_local_connectivity(*a, **b)[source]

Used for creating and storing a local connectivity.

fill_default_attributes(template_dictionary)[source]

Overwrite base controller to add required parameters for adapter templates.

get_equation_chart(*a, **b)[source]

Returns the html which contains the plot with the equations specified into ‘plotted_equations_prefixes’ field.

static get_series_json(ideal_case, average_case, worst_case, best_case, vertical_line)[source]

Gather all the separate data arrays into a single flot series.

get_template_from_context()[source]

Return the parameters for the local connectivity in case one is stored in context. Load the entity and use it to populate the defaults from the interface accordingly.

load_local_connectivity(*a, **b)[source]

Loads the interface for an existing local connectivity.

reset_local_connectivity(*a, **b)[source]

Reset the context and reset to the first step. This method is called when the None entry is selected from the select. :param from_step: is not used in local connectivity case since we don’t want to remain in step 2 in case none was selected. We are keeping it so far to remain compatible with the stimulus pages.

step_1(*a, **b)[source]

Generate the html for the first step of the local connectivity page. :param do_reset: Boolean telling to start from empty page or not :param kwargs: not actually used, but parameters are still submitted from UI since we just use the same js function for this. TODO: do this in a smarter way

step_2(*a, **b)[source]

Generate the html for the second step of the local connectivity page. :param kwargs: not actually used, but parameters are still submitted from UI since we just use the same js function for this. TODO: do this in a smarter way

region_stimulus_controller

class tvb.interfaces.web.controllers.spatial.region_stimulus_controller.RegionStimulusController[source]

Bases: tvb.interfaces.web.controllers.spatial.base_spatio_temporal_controller.SpatioTemporalController

Control layer for defining Stimulus entities on Regions.

create_stimulus()[source]

Creates a stimulus from the given data.

static display_connectivity(connectivity_gid)[source]

Generates the html for displaying the connectivity matrix.

do_step(step_idx, from_step=None)[source]

Go to the step given by :param step_idx. In case the next step is the create one (3), we want to remain on the same step as before so that is handled differently depending on the :param from_step.

fill_default_attributes(template_dictionary)[source]

Overwrite base controller to add required parameters for adapter templates.

get_equation_chart(*a, **b)[source]

Returns the html which contains the plot with the temporal equation.

load_region_stimulus(*a, **b)[source]

Loads the interface for the selected region stimulus.

reset_region_stimulus(*a, **b)[source]

Just reload default data as if stimulus is None.

from_step
not actually used here since when the user selects None from the stimulus entities select we want to take him back to step 1 always. Kept just for compatibility with the normal load entity of a stimulus where we want to stay in the same page.
step_1()[source]

Generate the required template dictionary for the first step.

step_1_submit(*a, **b)[source]

Any submit from the first step should be handled here. Update the context then go to the next step as required. In case a reset is needed create a clear context.

step_2()[source]

Generate the required template dictionary for the second step.

step_2_submit(*a, **b)[source]

Any submit from the second step should be handled here. Update the context and then do the next step as required.

update_scaling(*a, **b)[source]

Update the scaling according to the UI.

surface_model_parameters_controller

class tvb.interfaces.web.controllers.spatial.surface_model_parameters_controller.SurfaceModelParametersController[source]

Bases: tvb.interfaces.web.controllers.spatial.base_spatio_temporal_controller.SpatioTemporalController

Control for defining parameters of a model in a visual manner. Here we focus on model-parameters spread over a brain surface.

apply_equation(*a, **b)[source]

Applies an equations for computing a model parameter.

apply_focal_point(*a, **b)[source]

Adds the given focal point to the list of focal points specified for the equation used for computing the values for the specified model param.

edit_model_parameters(*a, **b)[source]

Main method, to initialize Model-Parameter visual-set.

fill_default_attributes(template_dictionary)[source]

Overwrite base controller to add required parameters for adapter templates.

get_data_from_burst_configuration()[source]

Returns the model and surface instances from the burst configuration.

get_equation_chart(*a, **b)[source]

Returns the html which contains the plot with the equation selected by the user for a certain model param.

get_focal_points(*a, **b)[source]

Returns the html which displays the list of focal points selected for the equation used for computing the values for the given model parameter.

get_surface_model_parameters_data(default_selected_model_param=None)[source]

Returns a dictionary which contains all the data needed for drawing the model parameters.

remove_focal_point(*a, **b)[source]

Removes the given focal point from the list of focal points specified for the equation used for computing the values for the specified model param.

submit_model_parameters(*a, **b)[source]

Collects the model parameters values from all the models used for the surface vertices. @:param submit_action: a post parameter. It distinguishes if this request is a cancel or a submit

surface_stimulus_controller

class tvb.interfaces.web.controllers.spatial.surface_stimulus_controller.SurfaceStimulusController[source]

Bases: tvb.interfaces.web.controllers.spatial.base_spatio_temporal_controller.SpatioTemporalController

Control layer for defining Stimulus entities on a cortical surface.

create_stimulus()[source]

Creates a stimulus from the given data.

do_step(step_idx, from_step=None)[source]

Go to the step given by :param step_idx. In case the next step is the create one (3), we want to remain on the same step as before so that is handled differently depending on the :param from_step.

fill_default_attributes(template_specification)[source]

Add some entries that are used in both steps then fill the default required attributes.

get_spatial_equation_chart(*a, **b)[source]

Returns the HTML which contains the chart in which is plotted the temporal equation.

get_stimulus_chunk(*a, **b)[source]

Get the next chunk of the stimulus data.

get_temporal_equation_chart(*a, **b)[source]

Returns the HTML which contains the chart in which is plotted the temporal equation.

load_surface_stimulus(*a, **b)[source]

Loads the interface for the selected surface stimulus.

reload_default(*a, **b)[source]

Just reload default data as if stimulus is None.

from_step:
not actually used here since when the user selects None from the stimulus entities select we want to take him back to step 1 always. Kept just for compatibility with the normal load entity of a stimulus where we want to stay in the same page.
step_1()[source]

Used for generating the interface which allows the user to define a stimulus.

step_1_submit(*a, **b)[source]

Any submit from the first step should be handled here. Update the context then go to the next step as required. In case a reset is needed create a clear context.

step_2()[source]

Used for generating the interface which allows the user to define a stimulus.

step_2_submit(*a, **b)[source]

Any submit from the second step should be handled here. Update the context and then do the next step as required.

view_stimulus(*a, **b)[source]

Just create the stimulus to view the actual data, don’t store to db. Hold the entity in session without the surface, so the next time you need data just get from that one.