14.8.9. API Reference: steps.API_1.visual (Visualization Toolkit)

Visualization toolkit module for STEPS

14.8.9.1. Sim Control

class SimControl(sims, sim_displays, plot_displays, Control', start_time=0.0, end_time=10, upd_interval=0.1)[source]

Simulation Control for the visualization toolkit

Parameters:
  • sims List of STEPS simulation solvers

  • sim_displays List of SimDisplay objects

  • plot_displays List of PlotDisplay objects

  • title Title of the control interface

  • start_time Initial start time of the simulation

  • end_time Initial end time of the simulation

  • upd_interval Initial update interval of the simulation

closeEvent(QCloseEvent)[source]

14.8.9.2. Sim Display

class SimDisplay(id, x=100, y=100, w=800, h=600, scale=1000000.0)[source]

Simulation Display Parameters:

  • id ID of the display

  • x X cordinate of the display

  • y Y cordinate of the display

  • w Width of the display

  • h Height of the display

  • scale Scaling between STEPS mesurement and display pixel

closeEvent(QCloseEvent)[source]
addItem(item)[source]

Add a visual component to the display.

Parameters:

  • item The adding visual component

Return:

None

addItems(items)[source]

Add a list of visual components to the display.

Parameters:

  • items List of the adding visual components

Return:

None

getItems()[source]

Get a list of visual components in the display.

Parameters:

None

Return:

List of the visual components in the display

removeItem(item_id)[source]

Remove a visual components in the display.

Parameters:

  • item_id ID of the removing component

Return:

None

hideItem(item_id)[source]

Hide a visual components in the display.

Parameters:

  • item_id ID of the hidding component

Return:

None

showItem(item_id)[source]

Show a visual components in the display.

Parameters:

  • item_id ID of the showing component

Return:

None

updateItems()[source]

Update visual components in the display.

Parameters:

None

Return:

None

refresh()[source]

Refresh the display.

Parameters:

None

Return:

None

rotateItems(angle, x, y, z, local=False)[source]

Rotate all items in the display.

Parameters:

  • angle Angle for the rotation

  • x X for the rotation vector

  • y Y for the rotation vector

  • z Z for the rotation vector

  • local True if the rotation is local, False if it is global

Return:

None

rotateItem(item_id, angle, x, y, z, local=False)[source]

Rotate all items in the display.

Parameters:

  • item_id ID of the rotating component

  • angle Angle for the rotation

  • x X for the rotation vector

  • y Y for the rotation vector

  • z Z for the rotation vector

  • local True if the rotation is local, False if it is global

Return:

None

14.8.9.3. Dynamic Component

class VisualTetsSpec(id, display, mesh, sim, tets, spec_id, spec_color=None, spec_size=0.2, max_nspec=10000, max_density=1e+21, auto_adjust=True)[source]

Visualization component for species in tetrahedrons. Parameters:

  • id ID of the component

  • display Parent SimDisplay object

  • mesh STEPS Tetmesh object

  • sim STEPS solver object

  • tets List of tetrahedron indices

  • spec_id ID of the species

  • spec_color Color of the species

  • spec_size Size of the species

  • max_nspec Maximum number of species can be visualized in the component

  • max_density Maximum density of species can be visualized in the component

  • auto_adjust Boolean flag for auto adjustment of visualized species counts

updateItem()[source]

Update the component.

setMaxNSpec(new_value)[source]

Set the maximum number of species can be visualized in the component

getMaxNSpec()[source]

Get the maximum number of species can be visualized in the component

setSpecColor(color)[source]

Set the color of the species

getSpecColor()[source]

Get the color of the species

setAutoAdjust(condition)[source]

Set if the component automatically adjust the number of visualizing points according the maximum count and maximum density

getAutoAdjust()[source]

Get if the component automatically adjust the number of visualizing points according the maximum count and maximum density

setMaxDensity(density)[source]

Set the maximum density of species can be visualized in the component

getMaxDensity()[source]

Get the maximum density of species can be visualized in the component

setSpecSize(size)[source]

Set the size of the points

getSpecSize()[source]

Get the size of the points

class VisualCompSpec(id, display, mesh, sim, comp_id, spec_id, spec_color=None, spec_size=0.2, max_nspec=100000, max_density=1e+21, auto_adjust=True)[source]

Visualization component for species in compartment.

Parameters:

  • id ID of the component

  • display Parent SimDisplay object

  • mesh STEPS Tetmesh object

  • sim STEPS solver object

  • comp_id ID of the compartment

  • spec_id ID of the species

  • spec_color Color of the species

  • spec_size Size of the species

  • max_nspec Maximum number of species can be visualized in the component

  • max_density Maximum density of species can be visualized in the component

  • auto_adjust Boolean flag for auto adjustment of visualized species counts

class VisualROITetsSpec(id, display, mesh, sim, roi_id, spec_id, spec_color=None, spec_size=0.2, max_nspec=100000, max_density=1e+21, auto_adjust=True)[source]

Visualization component for species in Region of Interest tetrahedrons. Parameters:

  • id ID of the component

  • display Parent SimDisplay object

  • mesh STEPS Tetmesh object

  • sim STEPS solver object

  • roi_id ID of the Region of Interest

  • spec_id ID of the species

  • spec_color Color of the species

  • spec_size Size of the species

  • max_nspec Maximum number of species can be visualized in the component

  • max_density Maximum density of species can be visualized in the component

  • auto_adjust Boolean flag for auto adjustment of visualized species counts

class VisualTrisSpec(id, display, mesh, sim, tris, spec_id, spec_color=None, spec_size=0.2, max_nspec=100000, max_density=1000000000000000.0, auto_adjust=True)[source]

Visualization component for species in triangles.

Parameters:

  • id ID of the component

  • display Parent SimDisplay object

  • mesh STEPS Tetmesh object

  • sim STEPS solver object

  • tris List of triangle indices

  • spec_id ID of the species

  • spec_color Color of the species

  • spec_size Size of the species

  • max_nspec Maximum number of species can be visualized in the component

  • max_density Maximum density of species can be visualized in the component

  • auto_adjust Boolean flag for auto adjustment of visualized species counts

updateItem()[source]

Update the component.

setMaxNSpec(new_value)[source]

Set the maximum number of species can be visualized in the component

getMaxNSpec()[source]

Get the maximum number of species can be visualized in the component

setSpecColor(color)[source]

Set the color of the species

getSpecColor()[source]

Get the color of the species

setAutoAdjust(condition)[source]

Set if the component automatically adjust the number of visualizing points according the maximum count and maximum density

getAutoAdjust()[source]

Get if the component automatically adjust the number of visualizing points according the maximum count and maximum density

setMaxDensity(density)[source]

Set the maximum density of species can be visualized in the component

getMaxDensity()[source]

Get the maximum density of species can be visualized in the component

setSpecSize(size)[source]

Set the size of the points

getSpecSize()[source]

Get the size of the points

class VisualPatchSpec(id, display, mesh, sim, patch_id, spec_id, spec_color=None, spec_size=0.2, max_nspec=100000, max_density=1000000000000000.0, auto_adjust=True)[source]

Visualization component for species in patch. Parameters:

  • id ID of the component

  • display Parent SimDisplay object

  • mesh STEPS Tetmesh object

  • sim STEPS solver object

  • patch_id ID of the patch

  • spec_id ID of the species

  • spec_color Color of the species

  • spec_size Size of the species

  • max_nspec Maximum number of species can be visualized in the component

  • max_density Maximum density of species can be visualized in the component

  • auto_adjust Boolean flag for auto adjustment of visualized species counts

class VisualROITrisSpec(id, display, mesh, sim, roi_id, spec_id, spec_color=None, spec_size=0.2, max_nspec=100000, max_density=1000000000000000.0, auto_adjust=True)[source]

Visualization component for species in Region of Interest triangles.

Parameters:

  • id ID of the component

  • display Parent SimDisplay object

  • mesh STEPS Tetmesh object

  • sim STEPS solver object

  • roi_id ID of the Region of Interest

  • spec_id ID of the species

  • spec_color Color of the species

  • spec_size Size of the species

  • max_nspec Maximum number of species can be visualized in the component

  • max_density Maximum density of species can be visualized in the component

  • auto_adjust Boolean flag for auto adjustment of visualized species counts

class VisualTrisChannel(id, display, mesh, sim, tris, specs_colors, spec_size=0.1)[source]

Visualization component for channel species in triangles.

Parameters:

  • id ID of the component

  • display Parent SimDisplay object

  • mesh STEPS Tetmesh object

  • sim STEPS solver object

  • tris List of triangle indices

  • specs_colors Species-Color mapping dictionary

  • spec_size Size of the species

updateItem()[source]

Update the component.

setSpecColor(spec, color)[source]

Set the color of the species

getSpecColor(spec)[source]

Get the color of the species

setSpecSize(size)[source]

Set the size of the points

getSpecSize()[source]

Get the size of the points

class VisualPatchChannel(id, display, mesh, sim, patch_id, specs_colors, spec_size=0.1)[source]

Visualization component for channel species in a patch.

Parameters:

  • id ID of the component

  • display Parent SimDisplay object

  • mesh STEPS Tetmesh object

  • sim STEPS solver object

  • patch_id ID of the patch

  • specs_colors Species-Color mapping dictionary

  • spec_size Size of the species

class VisualROITrisChannel(id, display, mesh, sim, roi_id, specs_colors, spec_size=0.1)[source]

Visualization component for channel species in Region of Interest trangles. Parameters:

  • id ID of the component

  • display Parent SimDisplay object

  • mesh STEPS Tetmesh object

  • sim STEPS solver object

  • roi_id ID of the Region of Interest

  • specs_colors Species-Color mapping dictionary

  • spec_size Size of the species

14.8.9.4. Static Component

class VisualCompMesh(id, display, steps_mesh, comp_id, color=None)[source]

Static mesh component for a compartment Parameters:

  • id ID of the component

  • display Parent display

  • steps_mesh STEPS mesh

  • comp_id ID of the compartment

  • color Color of the component

class VisualPatchMesh(id, display, steps_mesh, patch_id, color=None)[source]

Static mesh component for a patch

Parameters:

  • id ID of the component

  • display Parent display

  • steps_mesh STEPS mesh

  • patch_id ID of the patch

  • color Color of the component

14.8.9.5. Plotting

class PlotDisplay(title=None, size=(800, 600)[source]

Visualization plot display.

Parameters:

  • title Title of the display

  • size Size of the display

addCompSpecPlot(title, sim, comp_id, spec_id, data_size=1000, x_range=None, y_range=None, measure='count', **kwargs)[source]

Add plot to display the amount changes of species in a compartment.

Parameters:

  • title Title of the plot

  • sim STEPS solver

  • comp_id ID of the compartment

  • spec_id ID of the species

  • data_size Size of the data history

  • x_range Range of X axis

  • y_range Range of y axis

  • measure Measure type

  • **kwargs Other keywords that are supported by pygraph.GraphicsWindow class

Return:

pyqtgraph.PlotItem object

addTetsSpecPlot(title, sim, tets, spec_id, data_size=1000, x_range=None, y_range=None, measure='count', **kwargs)[source]

Add plot to display the amount changes of species in a list of tetrahedrons.

Parameters:

  • title Title of the plot

  • sim STEPS solver

  • tets List of tetrahedron indices

  • spec_id ID of the species

  • data_size Size of the data history

  • x_range Range of X axis

  • y_range Range of y axis

  • **kwargs Other keywords that are supported by pygraph.GraphicsWindow class

Return:

pyqtgraph.PlotItem object

addPatchSpecPlot(title, sim, patch_id, spec_id, data_size=1000, x_range=None, y_range=None, **kwargs)[source]

Add plot to display the amount changes of species in a patch.

Parameters:

  • title Title of the plot

  • sim STEPS solver

  • patch_id ID of the patch

  • spec_id ID of the species

  • data_size Size of the data history

  • x_range Range of X axis

  • y_range Range of y axis

  • **kwargs Other keywords that are supported by pygraph.GraphicsWindow class

Return:

pyqtgraph.PlotItem object

addTrisSpecPlot(title, sim, tris, spec_id, data_size=1000, x_range=None, y_range=None, **kwargs)[source]

Add plot to display the amount changes of species in a list of triangles.

Parameters:

  • title Title of the plot

  • sim STEPS solver

  • tris List of triangle indices

  • spec_id ID of the species

  • data_size Size of the data history

  • x_range Range of X axis

  • y_range Range of y axis

  • **kwargs Other keywords that are supported by pygraph.GraphicsWindow class

Return:

pyqtgraph.PlotItem object

addCompSumSpecsPlot(title, sim, comp_id, spec_ids, data_size=1000, x_range=None, y_range=None, **kwargs)[source]

Add plot to display the sum-up amount changes of species in a compartment.

Parameters:

  • title Title of the plot

  • sim STEPS solver

  • comp_id ID of the compartment

  • spec_id ID of the species

  • data_size Size of the data history

  • x_range Range of X axis

  • y_range Range of y axis

  • **kwargs Other keywords that are supported by pygraph.GraphicsWindow class

Return:

pyqtgraph.PlotItem object

addPatchSumSpecsPlot(title, sim, patch_id, spec_ids, data_size=1000, x_range=None, y_range=None, **kwargs)[source]

Add plot to display the sum-up amount changes of species in a patch.

Parameters:

  • title Title of the plot

  • sim STEPS solver

  • patch_id ID of the patch

  • spec_id ID of the species

  • data_size Size of the data history

  • x_range Range of X axis

  • y_range Range of y axis

  • **kwargs Other keywords that are supported by pygraph.GraphicsWindow class

Return:

pyqtgraph.PlotItem object

addCompSpecDist(title, mesh, sim, comp_id, spec_id, axis='x', nbins=20, y_range=None, **kwargs)[source]

Add plot to display the distribution of species in a compartment.

Parameters:

  • title Title of the plot

  • sim STEPS solver

  • comp_id ID of the compartment

  • spec_id ID of the species

  • axis Spatial direction of the distribution

  • nbins Number of bins for the data

  • y_range Range of y axis

  • **kwargs Other keywords that are supported by pygraph.GraphicsWindow class

Return:

pyqtgraph.PlotItem object

addPatchSpecDist(title, mesh, sim, patch_id, spec_id, axis='x', nbins=20, y_range=None, **kwargs)[source]

Add plot to display the distribution of species in a patch.

Parameters:

  • title Title of the plot

  • sim STEPS solver

  • mesh STEPS mesh

  • patch_id ID of the patch

  • spec_id ID of the species

  • axis Spatial direction of the distribution

  • nbins Number of bins for the data

  • y_range Range of y axis

  • **kwargs Other keywords that are supported by pygraph.GraphicsWindow class

Return:

pyqtgraph.PlotItem object

addTetsSpecDist(title, mesh, sim, tets, spec_id, axis='x', nbins=20, y_range=None, **kwargs)[source]

Add plot to display the distribution of species in a list of tetrahedrons.

Parameters:

  • title Title of the plot

  • sim STEPS solver

  • mesh STEPS mesh

  • tets List of tetrahedron indices

  • spec_id ID of the species

  • axis Spatial direction of the distribution

  • nbins Number of bins for the data

  • y_range Range of y axis

  • **kwargs Other keywords that are supported by pygraph.GraphicsWindow class

Return:

pyqtgraph.PlotItem object

addTrisSpecDist(title, mesh, sim, tris, spec_id, axis='x', nbins=20, y_range=None, **kwargs)[source]

Add plot to display the distribution of species in a list of triangles.

Parameters:

  • title Title of the plot

  • sim STEPS solver

  • mesh STEPS mesh

  • tris List of triangle indices

  • spec_id ID of the species

  • axis Spatial direction of the distribution

  • nbins Number of bins for the data

  • y_range Range of y axis

  • **kwargs Other keywords that are supported by pygraph.GraphicsWindow class

Return:

pyqtgraph.PlotItem object

addROISpecDist(title, mesh, sim, roi_id, spec_id, axis='x', nbins=20, y_range=None, **kwargs)[source]

Add plot to display the distribution of species in a Region of Interest.

Parameters:

  • title Title of the plot

  • sim STEPS solver

  • mesh STEPS mesh

  • roi_id ID of the Region of Interest

  • spec_id ID of the species

  • axis Spatial direction of the distribution

  • nbins Number of bins for the data

  • y_range Range of y axis

  • **kwargs Other keywords that are supported by pygraph.GraphicsWindow class

Return:

pyqtgraph.PlotItem object

14.8.9.6. Color

pickColorF()[source]

Pick a color and return it as a (0,1) floating point [r,g,b,a] list

Parameters:

None

Return:

List of the color

printColorF()[source]

Pick a color and print(out the list)

Parameters:

None

Return:

None

14.8.9.7. Partition Viewer

createColorMap(partitions)[source]

Genrate a random color map for a partition. Parameter:

  • partitions Partitions for a list of elements. The partition can be either a list, or a dict.

Return:

Return a dict color_map, for each partion in partitions, color_map[partition] gives a randomly generated color.

class TetPartitionDisplay(mesh, tet_partitions, title='TetPartitionDisplay', x=100, y=100, w=800, h=600, scale=1000000.0, color_map=None, morph_sections=None, show_list=None)[source]

Partition Display Parameters:

  • mesh STEPS Tetmesh

  • tet_partitions Partition of tetrahedrons

  • title Display title

  • x X cordinate of the display

  • y Y cordinate of the display

  • w Width of the display

  • h Height of the display

  • scale Scaling between STEPS mesurement and display pixel

  • color_map Color map for each partition, it is a Python dict with key-value pairs as color_map[partition_id] = [red, green, blue, alpha], where partition_id is the data stored in tet_partitions. The color is defined by four parameters [red, green, blue, alpha], each with range from 0.0 to 1.0. If the partition name is not in the color map a random color will be generated. A partition assigned to None will always be colored as nontransparent red [1.0, 0.0, 0.0, 1.0].

  • morph_sections NEURON hoc morphology data of the mesh

  • show_list List of sections to be visualized

class TriPartitionDisplay(mesh, tri_partitions, title='TriPartitionDisplay', x=100, y=100, w=800, h=600, scale=1000000.0, color_map=None, morph_sections=None, show_list=None)[source]

Partition Display Parameters:

  • mesh STEPS Tetmesh

  • tri_partitions Partition of triangles

  • title Display title

  • x X cordinate of the display

  • y Y cordinate of the display

  • w Width of the display

  • h Height of the display

  • scale Scaling between STEPS mesurement and display pixel

  • color_map Color map for each partition, it is a Python dict with key-value pairs as color_map[partition_id] = [red, green, blue, alpha], where partition_id is the data stored in tet_partitions. The color is defined by four parameters [red, green, blue, alpha], each with range from 0.0 to 1.0. If the partition name is not in the color map a random color will be generated. A partition assigned to None will always be colored as nontransparent red [1.0, 0.0, 0.0, 1.0].

  • morph_sections NEURON hoc morphology data of the mesh

  • show_list List of sections to be visualized