PokesPlot is a plugin used to graphically display state, poke, scheduled wave and neural spike information for any instant and to perform basic analysis. PokesPlot2 is an upgrade from the previous version of pokesplot, completely rewritten. It incorporates a number of new features including display of scheduled waves, use of wildcards to retrieve information about multiple states, a window displaying the states/pokes/waves present under the cursor at any given coordinate on the PokesPlot axes, the ability to programmatically align all elements on the pokesplot axes at any desired time, and various fixes concerning the display of all elements on the axes. Pokesplot2 is completely compatible with existing data files and settings files.
Architecture And Working
In order to understand the working of pokesplot2, you might want to become familiar with the parsed_events, latest_parsed_events, and parsed_events_history variables. These variables are instantiated by Dispatcher.
PokesPlot2 operates in one of two modes:
- Displaying data as it is accumulated while the protocol is running: In this mode, pokesplot2 analyzes the latest_parsed_events structure for every update cycle of the protocol. Data about the entry and exit times of each state, poke, and scheduled wave is displayed on the pokesplot axes as it is retrieved from the Real-Time Linux State Machine Server. Spikes are not displayed in this mode, as retrieval of spiking data requires additional offline processing.
- Displaying historical experiment data from an existing data file: Historical experiment data can be displayed using pokesplot2 using either dispatcher or neurobrowser. When using dispatcher, simply load the desired data file from the saveload plugin. Historical data will be displayed and saved GUI element settings will be restored for all GUI elements once the data file is loaded. In order to load data from Neurobrowser, select the session you wish to display data for and hit the 'Send Data to PokesPlot' button. If spiking data is available, it will be shown on the PokesPlot axes as vertical lines, black by default.
A note about scheduled waves: At the time of this writing (May 5, 2010), only the sustain period of scheduled waves is available in the parsed_events structure. It is not possible to obtain the instants of the preamble and refractory periods of each scheduled wave with the current parsed_events structure. However, it will be possible to display the preamble and refractory periods by modifying the code only slightly if the parsed_events structure is modified at a later stage.
States and pokes are displayed as patch objects, whereas scheduled waves and spikes are displayed as line objects.
Step 1: Inherit from the pokesplot2 plugin:
obj = class(struct, mfilename, pokesplot2, <other plugins>);
Step 2: Call
in your protocol's 'init' section. This will initialize the PokesPlotSection GUI and the PokesPlot Preferences Pane, and restore saved GUI element settings if available.
Step 3: Prepare the function files state_colors.m and wave_colors.m. Optionally, you may also want to prepare poke_colors.m and spike_color.m. The files should evaluate to a structure having the following format:
state_color_struct = struct('statename1', <normalized RGB triplet>, 'statename2', <normalized RGB triplet>, ...) wave_color_struct = struct('wavename1', <normalized RGB triplet>, 'wavename2', <normalized RGB triplet>, ...) poke_color_struct = struct('C', <normalized RGB triplet>, 'L', <normalized RGB triplet>, 'R', <normalized RGB triplet>) spike_color = <normalized RGB triplet>
Step 4: Call
in your protocol's 'update' section. This will allow PokesPlot to continuously update its display as the protocol runs ahead.
PokesPlotSection Figure Window
PokesPlot Preferences Pane
The figure below shows the PokesPlot Preferences Pane showing default values for Main_Sort, Sub_Sort, and Trial_Selector. The aforementioned fields are evaluated for every trial if the 'Use Custom Preferences' checkbox on the main PokesPlot window is checked. This feature is disabled while the protocol is running, as it is to be used only while analyzing historical data from an experiment.
Main Sort: Trials are sorted into groups based on the result of evaluating this expression. Sorting is done in ascending order only (to sort in descending order, use the negative of the sorting criterion used while sorting in ascending order).
Sub Sort: Within each group obtained from Main Sort, trials are sorted by this sorting criterion. Again, sorting is done in ascending order only.
Trial Selector: Only trials for which this field evaluates to true will be shown.
Collapse Selection: When this setting is on, invisible trials will be moved to the bottom and visible trials will be moved to the top. This setting has no effect if the Trial Selector field evaluates to 'true' for every trial.
Export: Clicking this button exports the Major Sort Value (MSV) and Spike Count (SC) in the base workspace for every trial, as a vector of length equal to n_done_trials.
PlotPSTH: It uses the 'smoother' parameter to plot the PeriStimulus Time Histogram (PSTH).
In addition to making selected trials invisible, a new feature allows the user to select only specific states, pokes, and scheduled waves to be displayed. The states, pokes, and scheduled waves which are selected in their respective listboxes will be displayed. The lists of visible states, pokes, and scheduled waves are saved with data files, so they are preserved across training sessions.