DataBlock Viewer¶
Viewer for myokit.DataBlock1d
or myokit.DataBlock2d
objects.
Allows loading blocks from disk, and then visualising as interactive movies.
Any point in the movie can be clicked to obtain the local action potential (or
other variables).
Implementation¶
- class myokit.gui.datablock_viewer.DataBlockViewer(filename=None)¶
Graphical interface for viewing DataBlock data.
- action_about()¶
Displays the about dialog.
- action_clear_graphs()¶
Removes all graphs from the graph area.
- action_depause_timer()¶
De-pauses the timer, restarting it if was paused, not affecting it if it wasn’t.
- action_extract_colormap_image()¶
Extracts the current colormap to an image file.
- action_extract_frame()¶
Extracts the current frame to a csv file.
- action_extract_frame_image()¶
Extracts the current frame to an image file.
- action_extract_graphs()¶
Extracts the currently displayed graphs to a csv file.
- action_license()¶
Displays this program’s licensing information.
- action_next_frame(e=None)¶
Move to next frame!
- action_open()¶
Let the user select a data file to load.
- action_pause_timer()¶
Pauses the timer (if running). Only meant to be used for very short periods!
- action_recent_file()¶
Opens a recent file.
- action_set_colormap(name)¶
Loads the ColorMap specified by
name
.If data is loaded, this will also call
action_set_variable()
to update the video frames.
- action_set_frame(frame)¶
Move to a specific frame.
This method updates the display to show a video frame created by an earlier call to
action_set_variable()
.
- action_set_variable(var)¶
Loads the variable specified by the name
var
into the main display.This method is also responsible for converting the data into frames to be displayed on the video widget.
- action_start_stop()¶
Toggles the started/stopped state of the timer.
- action_start_timer()¶
Starts the timer.
- closeEvent(self, a0: QCloseEvent | None)¶
Creates this widget’s menu.
- display_exception()¶
Displays the last exception in a messagebox.
- event_colormap_selected()¶
Colormap is selected by user.
- event_graph_mouse_move(x, y)¶
Graph cursur moved: Display the current cursor position on the graph scene in the status bar.
- event_rate_changed(e=None)¶
User changed frame interval.
- event_variable_selected()¶
Variable is selected by user.
- event_video_double_click(x, y)¶
Video double clicked: Add a frozen graph at the location of the click
- event_video_mouse_move(x, y)¶
Video cursur moved: Display the current cursor position on the video scene in the status bar.
- event_video_single_click(x, y)¶
Video clicked: Add a graph at the location of the click.
- keyPressEvent(self, a0: QKeyEvent | None)¶
- load_config()¶
Loads the user configuration from an ini file.
- load_data_file(fname)¶
Attempts to load the given data block 2d file.
- save_config()¶
Saves the user configuration to an ini file.
Updates the recent files menu.
- update_window_title()¶
Sets this window’s title based on the current state.
- myokit.gui.datablock_viewer.icon()¶
Widgets¶
- class myokit.gui.datablock_viewer.AutoFloatField(parent=None)¶
A QLineEdit that requires floats as input, but will show “(Auto)” when a non-float is entered and return
None
as its value.- focusInEvent(self, a0: QFocusEvent | None)¶
- class myokit.gui.datablock_viewer.GraphArea¶
Area that can draw several graphs.
- clear()¶
Removes all graphs from the widget.
- freeze()¶
Adds the temporary graph to the set of frozen graphs.
- graph(variable, x, y)¶
Adds temporary graph to this widget.
- log()¶
Returns a myokit DataLog containing the data currently displayed in the graph area.
- minimumSizeHint()¶
Returns a minimum size.
- mouseMoveEvent(event)¶
Trigger mouse moved event with graph coordinates.
- paintEvent(event)¶
Draws all the graphs.
- resizeEvent(e=None)¶
Resized.
- set_data(data)¶
Passes in the DataBlock2d this graph area extracts its data from.
- set_position(pos)¶
Sets the position of the time indicator.
- sizeHint()¶
Returns a size suggestion.
- sizePolicy()¶
Tells Qt that this widget shout expand.
- class myokit.gui.datablock_viewer.VideoScene(*args)¶
Color data display scene.
Note that, despite the name, this item does not manage the conversion from data to the image. The actual drawing happens by calling
setPixmap
on aQGraphicsPixmapItem
that gets added to this scene.See
DataBlockViewer.action_set_variable()
andDataBlockViewer.action_set_frame()
.- mouseDoubleClickEvent(self, event: QGraphicsSceneMouseEvent | None)¶
- mouseMoveEvent(self, event: QGraphicsSceneMouseEvent | None)¶
- mousePressEvent(self, event: QGraphicsSceneMouseEvent | None)¶
- resize(w, h)¶
Resize the scene to match the given dimensions.
- class myokit.gui.datablock_viewer.VideoView(scene)¶
Views a color data scene.
- fitInView(rect, keepAspect=False)¶
For some reason, Qt has a stupid bug in it that gives the scene a (hardcoded) margin of 2px. To remove, this is a re-implementation of the fitInView method, loosely based on the original C.
- resizeEvent(self, event: QResizeEvent | None)¶