The Virtual Brain Project

Table Of Contents

Previous topic

controllers Package

Next topic

help Package

This Page

burst Package


class tvb.interfaces.web.controllers.burst.base_controller.BurstBaseController[source]

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

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


Control code for Main-Burst Page.

class tvb.interfaces.web.controllers.burst.burst_controller.BurstController[source]

Bases: tvb.interfaces.web.controllers.burst.base_controller.BurstBaseController

Controller class for Burst-Pages.


Cache Simulator’s input tree, for performance issues. Anyway, without restart, the introspected tree will not be different on multiple executions. :returns: Simulator’s Input Tree (copy from cache or just loaded)


Cancel or Remove the burst entity given by burst_id. :returns ‘reset-new’: When currently selected burst was removed. JS will need to reset selection to a new entry :returns ‘canceled’: When current burst was still running and was just stopped. :returns ‘done’: When no action is required on the client.


Set :param tab_nr: as the currently selected tab in the stored burst configuration.

check_status_for_visualizer(selected_tab, index_in_tab, width='800', height='600')[source]

This call is used to check on a regular basis if the data for a certain portlet is available for visualization. Should return the status and the HTML to be displayed.


Return the required input tree to generate the simulator interface for the burst page in ‘configuration mode’, meaning with checkboxes next to each input that are checked or not depending on if the user selected them so, and with the user filled defaults.


When currently selected entry is a valid Burst, create a clone of that Burst.


Return the portlets for one given tab. This is used when changing from tab to tab and selecting which portlets will be displayed.


For each burst id received, get the status and return it.


From the position given by the tab index and the index from that tab, get the portlet configuration and build the configurable interface for that portlet.


Get the current configuration of portlets stored in session for this burst, as a json.


Retrieve Rangers, if any previously selected in Burst.


Get a simulator interface that only contains the inputs that are marked as KEY_PARAMETER_CHECKED in the current session.


Return the burst that is currently stored in session. This is one alternative to ‘chrome-back problem’.


Get the selected portlets for the loaded burst.

get_visualizers_for_operation_id(op_id, width, height)[source]

Method called from parameters exploration page in case a burst with a range of parameters for the simulator was launched. :param op_id: the selected operation id from the parameter space exploration. :param width: the width of the right side display :param height: the height of the right side display

Given these parameters first get the workflow to which op_id belongs, then load the portlets from that workflow as the current burst configuration. Width and height are used to get the proper sizes for the visualization iFrames.


Get on burst main page

launch_burst(launch_mode, burst_name, **data)[source]

Do the actual burst launch, using the configuration saved in current session. :param launch_mode: new/branch/continue :param burst_name: user-given burst name. It can be empty (case in which we will fill with simulation_x) :param data: kwargs for simulation input parameters.


Launch the full scale visualizer from a small preview from the burst cockpit.

launch_visualization(index_in_tab, frame_width, frame_height)[source]

Launch the visualization for this tab and index in tab. The width and height represent the maximum of the inner visualization canvas so that it can fit in the iFrame.


Given a burst id return its running status, weather it was a operation group and the selected tab. This is called when a burst is selected in the history, when returning from a burst config page (model param or noise) and when the status of running simulations is polled. Besides returning these values it updates the session stored burst.

A burst configuration has 2 meanings. It is a staging configuration for a new burst (stored in transients in the session). It is the configuration used to launch a simulation and it’s running status (stored in the db). This method has to merge the two meanings. If the requested burst_id is different from the one held in the session, then the burst config is loaded from the db, discarding any session stored config. If the id is the same then the session config is kept.


Upload Burst from previously exported JSON file


Load the available burst that are stored in the database at this time. This is one alternative to ‘chrome-back problem’.

load_configured_visualizers(width='800', height='600')[source]

Load all the visualization steps for this tab. Width and height represent the dimensions of the right side Div, so that we can compute for each iFrame the maximum size it’s visualizer can take.


When saving a new configuration of tabs, check if any of the old portlets are still present, and if that is the case use their parameters configuration.

For all the new portlets add entries in the burst configuration. Also remove old portlets that are no longer saved.

rename_burst(burst_id, burst_name)[source]

Rename the burst given by burst_id, setting it’s new name to burst_name.


Called when click on “New Burst” entry happens from UI. This will generate an empty new Burst Configuration.

save_parameters(index_in_tab, **data)[source]

Save parameters

  • tab_nr – the index of the selected tab
  • index_in_tab – the index of the configured portlet in the selected tab
  • data – the {“portlet_parameters”: json_string} Where json_string is a Jsonified dictionary {“name”: value}, representing the configuration of the current portlet

Having these inputs, current method updated the configuration of the portlet in the corresponding tab position form the burst configuration in session.

save_simulator_configuration(exclude_ranges, **data)[source]
Parameters:exclude_ranges – should be a boolean value. If it is True than the ranges will be excluded from the simulation parameters.
Data is a dictionary with pairs in one of the forms:
{ ‘simulator_parameters’ : { $name$ : { ‘value’ : $value$, ‘is_disabled’ : true/false } },
‘burstName’: $burst_name}

The names for the checkboxes next to the parameter with name $name$ is always $name$_checked Save this dictionary in an easy to process form from which you could rebuild either only the selected entries, or all of the simulator tree with the given default values.


class tvb.interfaces.web.controllers.burst.dynamic_model_controller.Dynamic(model=None, integrator=None)[source]

Bases: builtins.object

Groups a model and an integrator.

class tvb.interfaces.web.controllers.burst.dynamic_model_controller.DynamicModelController[source]

Bases: tvb.interfaces.web.controllers.burst.base_controller.BurstBaseController

KEY_CACHED_DYNAMIC_MODEL = 'cache.DynamicModelController'

Creating the model per request will be expensive. So we cache it in session. If there is nothing cached it returns the default dynamic.

graph_changed(dynamic_gid, graph_state)[source]
integrator_changed(dynamic_gid, **kwargs)[source]
model_changed(dynamic_gid, name)[source]

Resets the phase plane and returns the ui model for the slider area.

parameters_changed(dynamic_gid, params)[source]
submit(dynamic_gid, dynamic_name)[source]
trajectories(dynamic_gid, starting_points, integration_steps)[source]
class tvb.interfaces.web.controllers.burst.dynamic_model_controller.SessionCache[source]

Bases: builtins.object

A simple cache backed by the current cherrypy session. It does not expire it’s contents.

SESSION_KEY = 'session_cache'


class tvb.interfaces.web.controllers.burst.exploration_controller.ParameterExplorationController[source]

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

Controller to handle PSE actions.

draw_discrete_exploration(datatype_group_gid, back_page, color_metric=None, size_metric=None)[source]

Create new data for when the user chooses to refresh from the UI.


For a given DataTypeGroup, check first if the discrete PSE is compatible. If this is not the case fallback to the continous PSE viewer. If none are available return: None.

get_metric_matrix(datatype_group_gid, metric_name=None)[source]
get_series_array_discrete(datatype_group_gid, backPage, color_metric=None, size_metric=None)[source]

Create new data for when the user chooses to refresh from the UI.

pse_error(adapter_name, message)[source]


class tvb.interfaces.web.controllers.burst.noise_configuration_controller.NoiseConfigurationController[source]

Bases: tvb.interfaces.web.controllers.burst.base_controller.BurstBaseController

Controller class for placing noise parameters in nodes.

static group_noise_array_by_state_var(noise_values, state_vars, number_of_regions)[source]
static init_noise_config_values(model, integrator, connectivity)[source]

Initialize a state var x number of nodes array with noise values.


Submit noise dispersions :param node_values: A map from state variable names to noise dispersion arrays. Ex {‘V’: [1,2...74]}


class tvb.interfaces.web.controllers.burst.region_model_parameters_controller.RegionsModelParametersController[source]

Bases: tvb.interfaces.web.controllers.burst.base_controller.BurstBaseController

Controller class for placing model parameters in nodes.


Collects the model parameters values from all the models used for the connectivity nodes. Assumes that the array indices are consistent with the node order.