MATLAB FUNCTIONS:
(c) Author: Zoltan Nadasdy <zoli@md2.huji.ac.il> - if not
indicated otherwise.
Keys:
bold: function name
red:
obsolete
<..> Necessary parameter. If any parameter is missing
the function will run in interactive mode.
[..] key stroke
(...) data type (int, float, string)
function bin(data,binsize);
function [binned_data , centers] = bin(data,binsize);
Bin the data into a coarser time resolution.
INPUT: data is a binned already data
YBS revised 11/99
NOTE - if the data vector length is not a multiple
of the bin size - the 'remaining' part shall be ignored.
Time should run horizontally
See also time2bin
daystrip(fname)
function daystrip(fname)
Use as daystrip('U19AUG99');
Merges and plots all spike files recorded continuously during a session.
The spike trains are shown as continuous recording. Motion data is represented
by the X and Y coordinates in time. It is useful for visualization of the
stability of cells recorded during a whole session.
mrislice3d(fname)
Plot and splice volumetric MRI data comprising a matrix of 256x256x13
pixels.
You set the slice slice coordinates by changing the xslice, yslice
and zslice coordinates.
Example: mrislice3d('set2_full')
Uses: updateslice(xp,yp,zp,v1,v2,b)
play_xyspk(fname1,fname2);
Function for plotting spike events real-time in
superposition of the trajectory of hand movemnent.
fname1=the motion data icontaining the xy coordinates of the
manipulandum. (Sampling inerval 10 msec)
fname2=spike time data. (Sampling interval 1 msec)
Example: play_xyspk('xy_today.006','ses.006.ten.00H.00A');
See also: plot_xyspk
plot_allspktrial_pwdev
Script that calls plotspike_trial_pwdev, the function that plots
the cursor trajectory and the spike trains together.
See also: plotspike_trial_pwdev
plotspike_time_neur
It plots spikes as time(x) vs. neuron (y) extracted from the r
It plots spikes as time(x) vs. neuron (y) extracted from the t-files.
The spike-neuron plot is broken into successive trials.
variables: trials=<int>; electrodes=<int>; neursperel=<int>;
timewindow=<msec>
plot_all_jpst
Same as plot_jpst_loop but it plots all maps of the same type
(sqm, dif or pmap). All variations of the triplets that can be composed
of 3 neurons from a given set of neurons will be represented in separate
tables. Turn pages by keypress.
Variables: the set of neurons and the file prefixes for the files to
compare.
neurons={'0' '1' '2' '3' '4' '5' '6' '7' '8' '9' 'a' 'b' 'c' 'd' 'e'
'f' 'g' 'h' 'i
' 'j' 'k' 'l' 'm' 'n'};
prefix={'s1' 'r' 's2'};
plot_bestcorrtrial_fromto(from,to)
A function that calculates average PSTH-s from multiple files.
It recursivelly calls the function plotspike_trial_xcor.
From = first file number in the self-incrementing list
To = last file number (inclusive).
Output: It generates the 3 important plots:
(1) The charts of average and SD of PSTH-s between
each neuron and tangential velocity peaks averaged accross the files
(2) The corrected charts of average and SD of PSTH-s.
The correction is a time shift that lead to the maximal fit between the
average of preceding trials and the actual trial. The function shifts the
central half of actuifts the
central half of actual PSTH along the central half of the average and calculates
the covariance between the PSTH for each shift positions.
(3) The change of optimal shifts [in bins]
that led to the best fit of the PSTH-s by each trial.
See also: plotspike_trial_xcor
plot_bestcorrtrialx_fromto(from,to)
The same as plot_bestcorrtrial_fromto but it works on the cross-correlation
domain.
It generates the average and SD of crosscorrelograms for each neuron
pairs averaged accross the trials.
It recursivelly calls the function plotspike_trial_xxcor.
See also: plotspike_trial_xxcor
plot_jpst_loop
It plots the whole matrices of JPTH, the joint-probability map and
significance map for triplets of all combinations. It works on the output
of 3seqmapstat. The input necessary to create the maps are the '.sqm',
'.dif' and '.pmap' files of the 3seqmapstat.
Variables: The triplets as they are represented in the filenames: E.g:
name={'CDE' 'CDF' 'CED' 'CEF' 'CFD' 'CFE'; 'DCE' 'DCF' 'DEC' 'DEF' 'DFC'
'DFE'; 'ECD' 'ECF' 'EDC' 'EDF' 'EFC' 'EFD'; 'FCD' 'FCE' 'FDC' 'FDE' 'FEC'
'FED'};
plotspike_trial_pwdev(fname,e,f,g)
function [electrodes,nperel,allhist]=plotspike_trial_pwdev(fname,e,f,g);
Use eg: plotspike_trial('U19AUG9A',0,4lotspike_trial('U19AUG9A',0,4,4);
Function that plots seven charts:
(1) X,t and Y,t coordinates of the cursor positions
(2) The corresponding tangential velocity
(3) The low pass filtered trace of tangental velocity
(4) The symultaneous spike trains by electrodes
(5) The binned spike frequency
(6) The error function of the 2/3-rd power law.
(7) The low pass filtered error function of the 2/3-rd power law.
All charts include the reward markers.
INPUT: The data files are supposed to be extracted from the Abeles-format
files by using t_parser_spk(_mov,_stim) functions. It returns the electrode
number, the neurons per electrodes and the histogram of the temporal cross-correlations
between the maxima of the deviation from 2/3-power law and spike activity.
OUTPUT:
(1) The time of the velocity peaks (peakvel.nnn)
(2) The error function (non-filtered) (error.nnn)
(3) The peak times of the error function (breakp.nnn)
USES: function poverlaw_iv.m
See also: plot_allspktrial_pwdev and plotspike_trial
plotspike_trial_pwdevpost(fname,e,f,g)
Same as plotspike_trial_pwdev but it DOES NOTcompute the deviation
from the 2/3 power law just uses the data have previously been computed
by the function plotspike_trial_pwdev. It is useful for quick testing
the cross-correlations between neural activity and movements without ity and movements without computing
the the 2/3 power law for each files that is quite time consumming. Within
the function script, at the list of constants, you can easily modify the
cross-correlation parameters such as time window and bin width.
See also: plotspike_trial_pwdev and plot_allspktrial_pwdev
plotspike_trial_xcor(fname,e,f,g)
function [electrodes,nperel,allhist]=plotspike_trial_pwdev(fname,e,f,g);
Use eg: plotspike_trial('U19AUG9A',0,4,4);
Function that plots seven charts:
(1) X,t and Y,t coordinates of the cursor positions
(2) The corresponding tangential velocity
(3) The low pass filtered and shifted trace of tangental velocity
(4) The symultaneous spike trains by electrodes
(5) The binned spike frequency
(6) The binned tangential velocity amplitudes
(7) The scatter plot between the actual tangential velocity and the
spike count within the same bin.
(8) The PSTH between the spike velocity peaks which are shifted by
250 ms before the actual peak. These plots are superimosed when the function
is called recursivelly.
All charts include the reward markers.
INPUT: The data files are supposed to be extracted from the Abeles-format
files by using t_parser_spk(_mov,_stim) functions. It returns the electrode
number, the neurons per electrodes and the histogram of the temporal cross-correlations
between the maxima of ns
between the maxima of the deviation from 2/3-power law and spike activity.
OUTPUT:
(1) File: The time of the velocity peaks (peakvel.nnn)
(2) electrodes: number of electrodes
nperel:
the number of neurons per electrodes
allhist: the PSTH amplitudes
for each individual PSTH-s.
Used by: plot_bestcorrtrialx_fromto
See also: plotspike_trial_xxcor, plot_allspktrial_pwdev and
plotspike_trial
plotspike_trial_xxcor(fname,e,f,g)
function [electrodes,nperel,allhist]=plotspike_trial_pwdev(fname,e,f,g);
Use eg: plotspike_trial('U19AUG9A',0,4,4);
Function that plots seven charts:
(1) X,t and Y,t coordinates of the cursor positions
(2) The corresponding tangential velocity
(3) The low pass filtered and shifted trace of tangental velocity
(4) The symultaneous spike trains by electrodes
(5) The binned spike frequency
(6) The binned tangential velocity amplitudes
(7) The scatter plot between the actual tangential velocity and the
spike count within the same bin.
(8) The xcorrelation matrix of each pairs of neurons. These plots are
superimosed when the function is called recursivelly.
All charts include the reward markers.
INPUT: The data files are supposed to be extracted from tosed to be extracted from the Abeles-format
files by using t_parser_spk(_mov,_stim) functions. It returns the electrode
number, the neurons per electrodes and the histogram of the temporal cross-correlations
between the maxima of the deviation from 2/3-power law and spike activity.
OUTPUT:
(1) File: The time of the velocity peaks (peakvel.nnn)
(2) electrodes: number of electrodes
nperel:
the number of neurons per electrodes
allhist: the cross-correlogram amplitudes
for each individual cross-correlograms.
Used by: plot_bestcorrtrialxx_fromto
See also: plotspike_trial_xcor, plot_allspktrial_pwdev and plotspike_trial
plot_trigtripmov(dirname);
Plot all the spike-triplet triggered motions performed during a day
(session).
Usage plot_trigtripmov('dirname');
Example: plot_trigtripmov('u19aug99');
plot_xyspk(fname1,fname2)
Function for plotting the spike events in superposition with the trajectory
of hand movemnent.
fname1= xy movement data file
fname2=root file name of spike density data
E.g: plot_xyspk('xy_today.092','ses.092.ten')
The example above will plot the set of ses.092.ten.00?.00? files.
Different electrodes and spikes are colorcoded.
See also: play_xyspk
plot_xytoday(fname)
Plot all the movements file-by-file performed during a day (session).
Usage plot_xytoday('filename').
Example: plot_xytoday('u27jun99').
plot_xyvelspk(fname1,fname2,fname3)
Function for plotting the spike events in superposition with the trajectory
of hand movemnent.
In a separate figure it also plots the X against time, the Y against
time, tangential velocity against time and the spike trains.
fname1=generic xy data file
fname2=root file name of spike density data.
fname3=mat file from the ./motion directory.
Example: plot_xyvelspk('xy_today.022','U19AUG9Z.022.spk','U19AUG9A.020.mat');
Spikes are imported from a spike density data file.
Different electrodes and spikes are colorcoded.
spikescope
Spikescope is for plotting multiple spike train data in a scope window
as time (x) and neuron (y) coordinates. The input files are defined as
filenames and they must be a two column ASCII file containing the time
and the neuron ID data, each line. The function plots the spikes in a time
window which can be advanced over the entire data, rewind, zoom-in/out
and increase/decrease time window.
Sub functions: spkscp_frameadv.m
for frame advancement.
function group stability
(by Yoram Ben-Shaul, May of 2000)
function superpos_xyspk(fname1,fname2,marker,markersize);
Function for plotting spike events in superposition with the trajectory
of hand movemnent.
fname1=the motion data icontaining the xy coordinates of the manipulandum.
(Sampling inerval 10 msec)
fname2=spike time data. (Sampling interval 1 msec)
marker= Matlab definition of markers (e.g. 'g+', 'bo','r.');
markersize= markersize [1..100] (int)
Example: superpos_xyspk('xy_today.006','ses.006.ten.00H.00A','ro',10);
function time2bin(data, binsize);
function [binned_data , centers] = time2bin(data,binsize);
Bin the data into a coarser time resolution.
INPUT: data is an array of time data.
YBS revised 11/99
NOTE - if the data vector length is not a multiple
of the bin size - the 'remaining' part shall be ignored.
Time should run horizontally.
See also bin