spatial
Package¶
base_spatio_temporal_controller
¶
- class tvb.interfaces.web.controllers.spatial.base_spatio_temporal_controller.SpatioTemporalController[source]¶
Bases:
BaseController
Base class which contains methods related to spatio-temporal actions.
- MSG_MISSING_SURFACE = 'There is no surface in the current project. Please upload a CORTICAL one to continue!'¶
- static display_surface(surface_gid, region_mapping_gid=None)[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.
- static get_series_json(data, label)[source]¶
For each data point entry, build the FLOT specific JSON.
local_connectivity_controller
¶
- class tvb.interfaces.web.controllers.spatial.local_connectivity_controller.LocalConnectivityController[source]¶
Bases:
SpatioTemporalController
Controller layer for displaying/creating a LocalConnectivity entity.
- CUTOFF_FIELD = 'set_cutoff_value'¶
- DISPLAY_NAME_FIELD = 'set_display_name'¶
- EQUATION_FIELD = 'set_equation'¶
- EQUATION_PARAMS_FIELD = 'set_equation_param'¶
- SURFACE_FIELD = 'set_surface'¶
- base_url = '/spatial/localconnectivity'¶
- compute_data_for_gradient_view(local_connectivity_gid, selected_triangle)[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.
- fill_default_attributes(template_dictionary)[source]¶
Overwrite base controller to add required parameters for adapter templates.
- get_equation_chart()[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.
- load_local_connectivity(local_connectivity_gid, from_step=None)[source]¶
Loads an existing local connectivity.
- reset_local_connectivity(from_step)[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.
region_stimulus_controller
¶
- class tvb.interfaces.web.controllers.spatial.region_stimulus_controller.RegionStimulusController[source]¶
Bases:
SpatioTemporalController
Control layer for defining Stimulus entities on Regions.
- CONNECTIVITY_FIELD = 'set_connectivity'¶
- DISPLAY_NAME_FIELD = 'set_display_name'¶
- MSG_MISSING_CONNECTIVITY = 'There is no structural Connectivity in the current project. Please upload one to continue!'¶
- TEMPORAL_FIELD = 'set_temporal'¶
- TEMPORAL_PARAMS_FIELD = 'set_temporal_param'¶
- base_url = '/spatial/stimulus/region'¶
- 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(**form_data)[source]¶
Returns the html which contains the plot with the temporal equation.
- load_region_stimulus(region_stimulus_gid, from_step=None)[source]¶
Loads the interface for the selected region stimulus.
- reset_region_stimulus(from_step)[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_submit(next_step, do_reset=0, **kwargs)[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.
surface_model_parameters_controller
¶
- class tvb.interfaces.web.controllers.spatial.surface_model_parameters_controller.SurfaceModelParametersController[source]¶
Bases:
SpatioTemporalController
Control for defining parameters of a model in a visual manner. Here we focus on model-parameters spread over a brain surface.
- EQUATION_FIELD = 'set_equation'¶
- EQUATION_PARAMS_FIELD = 'set_equation_param'¶
- MODEL_PARAM_FIELD = 'set_model_parameter'¶
- apply_focal_point(model_param, triangle_index)[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.
- base_url = '/spatial/modelparameters/surface'¶
- 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(**form_data)[source]¶
Returns the html which contains the plot with the equation selected by the user for a certain model param.
- get_focal_points(model_param)[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.
surface_stimulus_controller
¶
- class tvb.interfaces.web.controllers.spatial.surface_stimulus_controller.SurfaceStimulusController[source]¶
Bases:
SpatioTemporalController
Control layer for defining Stimulus entities on a cortical surface.
- DISPLAY_NAME_FIELD = 'set_display_name'¶
- SPATIAL_FIELD = 'set_spatial'¶
- SPATIAL_PARAMS_FIELD = 'set_spatial_param'¶
- SURFACE_FIELD = 'set_surface'¶
- TEMPORAL_FIELD = 'set_temporal'¶
- TEMPORAL_PARAMS_FIELD = 'set_temporal_param'¶
- base_url = '/spatial/stimulus/surface'¶
- 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(**form_data)[source]¶
Returns the HTML which contains the chart in which is plotted the spatial equation.
- get_temporal_equation_chart(**form_data)[source]¶
Returns the HTML which contains the chart in which is plotted the temporal equation.
- load_surface_stimulus(surface_stimulus_gid, from_step)[source]¶
Loads the interface for the selected surface stimulus.
- reload_default(from_step)[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_submit(next_step, do_reset=0, **kwargs)[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.