Notes on the Use of PCV, a Windows based visual stimulus and single-unit data collection program, compatible with optical recording using ORA and optrec

List of Topics:

Units of Measurement

Files Needed to Run PCV

Contrast, Backgrounds and Stimulus Types

Bars and Spots

Gratings

Edge Stimuli

Arbitrary Images as Visual Stimuli

Eye Shutters

Stimulus Sequencing

Using PCV to Study Units

Using PCV for Analysis Only

Saving and Restoring

Output files

Use with Optrec and ORA

Stopping PCV

Using PCV with continuous acquisition of analog traces for spike sorting

Units of Measurement

All stimulus positions and motions are in real absolute units (eg, degrees of visual angle, seconds, etc). In order to convert these real units to screen positions, PCV MUST know the screen distance (set in UserInfo) and something about the screen that you are using (set in the config.vsg file, which is specific to the particular stimulus monitor on which the stimuli are displayed.

X-position and y-position are in degrees with respect to area centralis. Area centralis is in degrees with respect to the upper left corner of the screen. The most convenient way to set the area centralis position is to use the AdjustStimulus dialog box and move a spot to the Right AC position, and then press SetRAC, and then move to the Left AC position and press SetLAC. This will set the x-position and y-position to 0, and the current position to the position of the respective area centralis. [Go to list of topics]

Files Needed to Run PCV

The lookup table files (red.lut green.lut blue.lut) are also specific to the particular stimulus monitor on which the stimuli are displayed. Generally, the PCV.EXE executable file is in the c:\bin directory together with vsg16.dll, the .lut files, and a scriptfile called pcvmoves.obj and the program files dspcore.hex and gspcore.out. Currently, all these files (.dll .hex .out) are from version 5.021 of the VSG software, but whatever version is used, they MUST all be from the same version.) [Go to list of topics]

Contrast, Backgrounds and Stimulus Types

PCV makes two general kinds of stimuli (set by Stimulus Type): non-periodic (bars and spots and dipole spots), and periodic (gratings or grating-like patterns). The brightness of bars and flashes is set by BackgroundLux (in lux = cd/m) and Contrast, which is in log units above (for + values) or below (for - values) the Background. For DipoleSpots, there is an outer ring 3 times the diameter of the inner spot the brightness of which is controlled by OuterContrast (and is taken to be equal to Contrast if OuterContrast is zero). The average brightness of periodic stimuli is also set by BackgroundLux (in cd/m), but the Contrast has a different meaning: it the Michaelson Contrast Ratio, a value between 0 and 1, where 0 means no contrast and 1 means that the darkest parts of the bars are pure black (zero intensity) and the brightest parts are twice Background.

If the monitor is not physically capable of making the stimulus that you specify, the Stimulus and AdjustStimulus dialog boxes will give you an error message and will refuse to let you exit with OK until you make a contrast and background that can actually be produced on your display. The maximum intensities of which the Nokia monitors are capable is about 80 lux and the minimum a bit less than 1, so with a BackgroundLux of 40, the maximum Contrast setting for a bar would be about 0.3 log units (a factor of 2) brighter, or about -1.4 log units darker. [Go to list of topics]

Bars and Spots

The non-periodic stimulus trials can be either a Sweep or a Flash (Trial Type). In a Sweep or a Flash, the stimulus is drawn at a position in display memory corresponding to the lower right corner of the screen, and then the position in display memory corresponding to the center of the screen is moved so that the stimulus appears in different portions of the screen.

For a Sweep, the motion is centered on the x-position and y-position coordinates, and is Sweep/Length long, at a speed of speed degrees/sec. The Sweep has a number of distinct phases: First, the unit spike time recording is turned on. Then nothing happens for PreShutter msec. Then the stimulus comes on, but does not begin sweeping for PreSweep msec. Then the stimulus sweeps for SweepLength/Speed secs. The orientation of a bar and the direction of motion of either bars or spots is controlled by Orientation in degrees. Then it stops for PostSweep msec, goes off but with unit recording staying on for PostShutter msec, and finally the unit recording is turned off and the data are stored and plotted on the raster display. The sweep is in one direction only, unless the Dwell (Reverse) time is set to a non-zero value, in which case the stimulus sweeps forward as described above, then waits the dwell time, then sweeps back, without turning off the unit recording. The sweep program now does not multiple cycles if the StimulusCycles is set to some value greater than 1; ordinarily this is not recommended for single-unit recording, but it may be useful for imaging experiments.

For a Flash, the stimulus is also centered on the x-position and y-position coordinates, and is OnTime msec plus OffTime msec long, for StimulusCycles cycles. It often makes sense to use values of StimulusCycles greater than 1 for flashes. The Flash has a Preshutter and Postshutter period like the sweep, but it does not have PreSweep and PostSweep periods. [Go to list of topics]

Gratings

The periodic stimuli have a StimulusType of SquareGrating, SineGrating, MeanGrating, UniformGrating, PerSquareImage, and PerSineImage (for the image types, see Arbitrary Images as Visual Stimuli below). The Sine and Square gratings refer to the spatial profile of luminance, at SpatialFrequency cycles/degree. The MeanGrating is just the background luminance (used only for special cases in control experiments). The UniformGrating is a uniform area equal in intensity to the bright bars of a SquareGratingit is useful for whole-field flashes. The TrialType for periodic stimuli can be PerSquareMod, PerSineMod, PerDrift, and PerFlash. PerDrift is a drifting grating that keeps the same spatial profile but moves at TemporalFrequency cycles/sec, with the motion starting out at TemporalPhase degrees of phase angle. The motion continues for StimulusCycles cycles. PerSquareMod keeps the grating in the same place (set by SpatialPhase in degrees) but changes its contrast from +1 to 1 times the Contrast setting, so that the black bars appear abruptly to alternate position with the white bars at TemporalFrequency cycles/sec. PerSineMod is similar but with the contrast changing gradually in a sinusoidal fashion. PerFlash is like PerSquareMod except that the stimulus goes from mean luminance to whatever Contrast is set to.

All of the periodic stimuli appear in a Length X Width degrees window at X-position,Y-position, unless Length and Width are both set to zero, in which case these periodic stimuli cover the whole screen. If Length is non-zero and Width is zero, then Width is taken to be equal to Length, making a square window. [Go to list of topics]

Edge Stimuli

A series of OnEdge and OffEdge stimuli have been devised that work almost identically to the StimulusType SquareGrating, but have (for OffEdge stimuli) a progressive sweep of a dark area across each line of the display, which is white until occluded by the sweeping curtain. All of the normal settings that affect gratings, including SpatialFrequency and TemporalFrequency, StimulusCycles, and the BackgroundLux and Contrast settings, also affect these stimuli in the expected ways. The TrialType for these stimuli should be PerDrift. Like the gratings, these stimuli appear in a Length X Width degrees window at X-position,Y-position, unless Length and Width are both set to zero, in which case these periodic stimuli cover the whole screen. If Length is non-zero and Width is zero, then Width is taken to be equal to Length, making a square window. [Go to list of topics]

Arbitrary Images

PCV can also display arbitrary images and move them using lookup table animation, just in the way that it moves the gratings. The images must be stored in separate files and described by an ImageTableFile which is stored as a text file in the current local data directory (set in UserInfo). The format of the images is as raw unsigned-byte images with no header, stored left to right, top to bottom, with each byte of the image having a value between 0 and ImagePeriod -1, where ImagePeriod is the number of separate positions of the image during the animation. Currently all the images in use have a sawtooth profile, ie, they consist of neighboring lines of values 0,1,2,3, up to ImagePeriod -1. The ImageTableFile has one line for each image, with a total of Nsteps lines. Each line of the ImageTableFile consists of 4 fields separated by whitespace: the period of the image as an ASCII integer, the width (x-direction), its height (y-direction), and the full pathname (filename) of the file containing the raw image for that stimulus condition. Generally images 1024 wide by 768 high are used. [Go to list of topics]

Eye Shutters

PCV also makes TTL outputs from the DIO board and from the UnitClock to control separate shutters for the two eyes. If Eye == 0, then both shutter are closed. Eye == 1 means that the left eye is closed and the right eye is opened; Eye == 2 means that the right eye is closed and the left eye is opened; and Eye == 3 means that both eyes are open. [Go to list of topics]

Stimulus Sequencing

The sequencing of stimuli within each repetition is determined by the Series, Variable, Start, Stop, and Nsteps. Each repetition also has a Nsponts spontaneous activity trials, in which everything is the same as the first stimulus in the sequence but no visual stimulus is presented. (Usually it is wise to set Nsponts to about to 1/12 of the number of stimuli in each repetition.) The whole sequence is repeated Nreps times, with (if Randomize is checked) a differently shuffled random order.

The different kinds of Series are Arithmetic, Geometric, CenteredArithmetic, CenteredGeometric, Single, Arbitrary, and List. In the first 4 kinds of series, the first stimulus (or the center stimulus) is the Start value; the last (or the extreme, for the centered cases) stimulus is the Stop value, and the Variable determines which thing is varied. It is also possible to have a Secondary Variable which is given each of its values for each value of the primary variable. To tell which stimuli are being made, please experiment by pressing Refresh and looking at the list of stimulus values in the little list box. [Go to list of topics]

If the Nsteps of the primary variable is 0 or 1, or if you set Single, then you get Nreps repetitions of the single stimulus specified in the Stimulus Parameter boxes to the left (Start and Stop are ignored), with Nsponts spontaneous trials mixed in. To get out of this single mode, you must change BOTH the Series and the Nsteps before pressing refresh or OK.

If Series is set to Arbitrary, then you use the Set and Examine boxes in the lower left to make whatever stimulus you want, with each one acting like a single, but using as many as you like (up to 64).

If Series is set to List, then you type the Nsteps stimulus values that you want into the List box. This works only with the primary variable. Nsteps for the secondary variable should be set to 1 in this case. [Go to list of topics]

Using PCV to Study Units

PCV normally knows when single units fire by recording the times of TTL pulses that are connected from some sort of hardware window discriminator the output from which is connected into PCV's digital inputs numbers 0 through 7. We have now added the capability to fold into PCV the firing times of spikes that are recorded as analog traces and discriminated later using Mark Kvale's SpikeSort program off-line. SpikeSort runs on the Unix system and reads raw 16-bit digitized versions of the output from the microelectrode amplifier, normally sampled at about 25 kHz per channel. These raw files are normally created by a LabView program running on the life-support computer, which digitizes the analog traces in real time. SpikeSort makes output files that list (in text format) the the unit numbers and spike times for the spikes discriminated from this analog record. The File>>SaveSpikeSortFile command is used to create a new PCV file that substitutes the spike times as discriminated by SpikeSort for those discriminated by the hardware discriminators at the time of the experiment (but keeps the original stimulus event times). The dialog box for this function allows you to assign different unit numbers (0-7) to the different channels discriminated by SpikeSort, and to assign several SpikeSort channels to the same unit number, useful either for putting together the traces from spikes that change in size during a burst or for collecting a single multi-unit record.

When you use PCV during a recording experiment, DO NOT FORGET to fill in the data showing unit number, electrode depth, etc., for each single unit at each site that you study. PCV records up to 8 units (although it currently plots only the first two, unit 0 and unit 1), and you can fill in a ElectrodeInfo dialog box for each unit. If you do not do so, you will be lost when you look at the data later. Also, if you are saving the analog traces for later analysis off-line, make sure before you start that the PCV and LabView computers have their time of day clocks set to exactly the same time, or you may have trouble keeping track of which PCV files go with which raw spike files.

[Go to list of topics]

Using PCV for Analysis Only

The current version of PCV is also capable of running in analysis-only mode, for use on any of the desktop PCs without the special hardware needed for collection of spikes and visual stimulation. To run in analysis-only mode, you must add the -a option to the command line that starts PCV, which causes the program to gray out the Adjust and Run menu items and to avoid instructions that would make the computer crash .

To install the analysis only version of PCV on your machine, copy the two files PCV.EXE and VSG16.DLL from \\mps-pc23\distribution\ directory to some directory on your machine (ie, to c:\temp). Then, in Explorer, drag the PCV.EXE icon to the desktop with your right mouse button, and "Create shortcut here". Then, right-click on the shortcut and add the letters -a to the Target dialog box (ie, change target from c:\temp\pcv.exe to c:\temp\pcv.exe -a). On aesthetic grounds, you might also want to change the shortcut's icon to the tree (using the Change Icon button. After doing all these things, you may double-click the icon (whether or not you have changed it), to start executing the PCV in analysis-only mode.

The very same version of PCV runs on the data collection computers (where it is normally run without the -a option), but additional helper files are needed on those machines for setting up the video hardware.

[Go to list of topics]

Saving and Restoring

Data files are saved in the LocalDirectory set in the Userinfo dialog box. Make sure this is a directory that you create with File Manager or Explorer that is the name or your animal. The files have the name FilenameRoot.XXX, where XXX is a 3-digit number beginning with FileNumber in the UserInfo box. Please make sure that all of the directories in your pathnames used with PCV are legal with the DOS conventions for filenames (ie, no more than 8.3 characters, no punctuation or spaces).

PCV automatically saves the last stimulus that was successfully Run in a machine-readable file called "statefil.pcv" in the bin or current directory. When you start up, you should have the same setup that you last used.

PCV can also save a human-readable parameter file with the SaveParameters option in the File Menu. This can be modified with Notepad, and read in with GetParameters, a feature that is useful if you have some standard set of parameters that you want to run, as is the case with optical recording. [Go to list of topics]

Output files

PCV can save its raster and histograms as text files (suitable for import into a graphing program) or as WindowsMetaFile (.wmf) pictures, read by Corel or PaintShopPro or other Windows applications. The histogram pays attention only to the data in the interval between tstart and tstop msec in the Plot>>Analysis dialog box, and only to units whose number Ored with UnitMask is non-zero (to be safe always leave this as the hexadecimal number FF), and only to repetitions between startrep and stoprep in this same dialogue box. The tstart and tstop times are shown by vertical lines on the raster. The maximum value on the histogram is set to HistogramFullScale in this box.

File>>Open [Current,Previous,Next] can be used to review and replot the rasters and histograms until they look good. File>>OpenDialog gives you a dialog box that allows directory navigation, and then opens the selected PCV file.

The .wmf files apparently lack some of the Win95 and later header information, so the best way to open them is with PaintShopPro (after first setting the WMF file type preference to ask for width and height if it can not be read from the header) and give 1000 for width and 600 for height. With older versions of PaintShopPro, you must then SaveAs the drawing in Macintosh PICT (.pct) format to make a file that CorelDraw will open and otherwise deal with properly; the newer versions seem OK without this craziness. The size of the image in the .wmf files will depend on the size of the window in which you view the plots in PCV, so don't make them too small when you want to keep the output files. PaintShopPro is on \\keck-nt1\shared\software\psp41.zip, and it may be installed on any of our computers.

[Go to list of topics]

Use with Optrec and ORA

PCV can also run in SlaveMode, where the choice of stimuli is determined with inputs on the 37-wire DIO board cable. Everything is the same, except that the Optrec or ORA computer sets things in motion. SlaveModeWithUnits works but is untested; in this case, PCV runs in SlaveMode but chooses the stimiulus (between 0 and Nsteps-1) and saves the spikes and stimulus events in a normal PCV output file as well.

[Go to list of topics]

Stopping PCV

While PCV is running, you can press a or s on the keyboard to make it stop at the end of the current or next stimulus presentation, giving you a message box asking for confirmation of the stop and asking (if you hit s) whether you want to save the (truncated) data file. Generally dont touch the keyboard if you dont want it to stop. At present, if PCV is left running in slavemode and Optrec/ORA is stopped, then PCV hangs waiting for the signal to go from Optrec/ORA, and it does not look at the keyboard, so there is no way to stop PCV except with Ctrl-Alt-Delete. This bug will eventually be fixed.

[Go to list of topics]

Using PCV with continuous acquisition of analog traces for spike sorting

It is now possible to use PCV with a recording setup that permits the later isolation of spikes from multiple single units. At the time of the experiment, one must run the LabView program "Cont Acq" on the life support computer. This program is started and stopped by the "Cue" signal from PCV, and it makes long files consisting of a continuous analog data from the microelectrode amplifier output during each PCV run. If you start the LabView program with "Run Continuously", it re-opens a new file immediately after is closes each one, and it names the files with the date and time at which they are opened. Please make sure that both the PCV computer and the life support computer are set to the same date and time. You should make note of the file name of the analog file associated with each PCV run, so that you will have it for later use. (Normally, one also sets a hardware window discriminator to isolate single of multiple units in the conventional way.)

After the experiment, each of the analog files should be archived on a CD. These files are later used as the input to Mark Kvale's SpikeSort program, which runs on the Keck Center Unix system. It has a great help file, but get someone who knows how to use it to show you the first time. The output file from SpikeSort is a plain text list of unit numbers with their spike times and should be names "something.spk". To display the single units as sorted by SpikeSort, run PCV and select File>>SaveSpikeSortFile and you will get a dialog box asking you which spikesort file to open. You then get a second dialog box that asks to make a table showing which SpikeSort units will correspond to which PCV units in the files that PCV will save. The default for this is usually good enough, but it is often the case that a real single unit is sorted into two categories by SpikeSort, and you can use this table to combine the two categories so that come out as a single unit as far as PCV is concerned.

Once you have finished with the SaveSpikeSortFile dialogs, a new PCV output file is created, with a name that you will select, and it contains the units as they were discriminated by SpikeSort (and potentially combined with the table described at the end of the previous paragraph). You can open this new file with PCV and plot the units just as if they were the ones that you had saved from the hardware window discriminator.

 

 

--Michael Stryker, September, 1999