# Measures of orientation and direction selectivity

**Orientation and direction selectivity**

Neurons in the visual cortex generally exhibit some degree of **orientation selectivity** (that is, selectivity for bars or edges that are close to the cell's preferred orientation). In addition, some cells also exhibit **direction selectivity**; that is, they respond to stimulation in one direction more than the opposite direction. Direction selectivity is particularly common in carnivores (see Van Hooser 2007 for a description of properties in different species).

**Experimental assessment**

We typically assess orientation or direction selectivity by showing bars or gratings moving in different directions. In most experiments, the **direction of motion** **of the bars is orthogonal to the orientation of the bars** (though see Basole et al. 2003) and the **direction of motion is represented by the angle θ, so that the orientation of the bars is θ+90° (modulo 180° so that orientation is between 0° and 180°)**. Note that many coordinate systems for representing direction (and the corresponding orientation angle) are possible, such as **Cartesian** (0° points to the right, and increasing angles go around counter-clockwise) or **compass** (0° points up, and increasing angles go around clockwise). In our lab we typically use compass coordinates, but we try to use terms like "up" "down" "left" and "right" when possible so people do not need to understand our coordinate system to follow our arguments.

**Removal of background activity**: Responses to each orientation are typically reported relative to "spontaneous" or "ongoing" activity that is unrelated to the stimulus. We can obtain a measure of the background activity by measuring the response of each cell to a "**blank**" **stimulus** (that is, the presentation of a gray screen for the same duration as a regular grating stimulus). The index values below are calculated with this background activity subtracted off (although we usually plot raw responses such as those above, with the background firing rate indicated as above).

**Orientation selectivity**

**Language**: Cells that exhibit orientation selectivity are called orientation-selective cells. (Orientation-selective is typically a hyphenated adjective.)

We typically have the following questions regarding the responses of a given cortical cell:

**How tuned is it?**We can answer this question from at least 2 different points of view: 1) Over what orientation range around its preferred orientation does the cell exhibit substantial firing? That is, what is the cell's**tuning width**?; and 2) How much does the cell respond to stimulation at its preferred orientation as compared to the opposite orientation? This is sometimes termed the**orientation selectivity index**.**Is it significantly orientation-tuned?**That is, does the cell exhibit some tuning that is significant in some sense, or is the cell indifferent to orientation?

**How we might extract these quantities:**

1. **Degree of tuning**:

**Fit methods**: A study has shown that gaussian or skewed gaussian fits provide the best fits of extracting parameters such as the **tuning width** and **orientation selectivity index** (Swindale, 1998). In our lab we typically use a double-gaussian fit from Carandini and Ferster (2000):

where **R(θ)** is the response of the cell, **Roffset** is a constant offset that does not depend on the stimulus orientation, **Rpref** is the peak response of the gaussian above the offset, **θpref** is the preferred orientation, **ang(θ) **is a function that "wraps" angular differences around 180° such that ang(0°-180°)=0 and ang(180°-45°)=45, and **σ** is a width parameter. The mathematical definition of ang for orientation is **ang(θdiff) = min(abs([θdiff;θdiff+180;θdiff-180]))**.

From this fit, we can extract 2 of the parameters we are interested in:

**Tuning width** is typically expressed as **half the width of the gaussian at half its height**, which in this equation is equal to

.

**Orientation selectivity index** is expressed as **(PREFERRED_RESPONSE - ORTHOGONAL_RESPONSE)/PREFERRED_RESPONSE**, where **PREFERRED_RESPONSE = R(θpref)** and **ORTHOGONAL_RESPONSE = R(θpref+90°)**.

For well-oriented cells, there is evidence from Swindale (1998) that this function does a better job than other functions in extracting orientation preference angle, orientation selectivity index, and tuning width.

**BUT...**what if a cell does not exhibit great tuning. What does the output of the fit look like? Here is a cell that I generated artificially that has no tuning but of course there is noise in the recording (which was done over 7 simulated trials):

The fit suggests orientation tuning / direction tuning when there is none.

OR...what if we don't sample the space very well? The following cell should look exactly like the well-tuned cell above except there were only 4 directions sampled:

So we see that with a fit, **garbage in** means you get **garbage out** (**GIGO**). This means we have to make sure we show enough step sizes and get enough repetitions to characterize the curve. Further, we must restrict our interpretation of fit data to cells that exhibit some significant tuning (as in part 2 below), or we have to adopt some method that does not depend on a fit.

**Fit-less methods**: Because of this garbage in/garbage out problem with fits, investigators have developed various methods that do not depend on fits (so called fit-less or fit-free methods), such as **vector methods** (compared to fits in Swindale, 1998) or **fourier analysis of the tuning curve** (Stryker and Chapman 1993). In the vector method, one places the response of each trial as a point Pt on the complex plane ("x" axis corresponds to real component, "y" axis corresponds to imaginary component):

.

Note that the factor of 2π/180° allows the circle to vary from 0° to 180°. For the 2 orientation curves above, the vector coordinates for each trial looks like:

In this figure, we have plotted the orientation vector responses for 7 stimulus repetitions and the mean value (black arrow). The extracted angle in this example is 38°, and the underlying gaussian that generated the data had a value of 40°.

We can calculate the preferred angle by the vector around the complex plane by writing the complex variable in the form **Pt = R*exp(sqrt(-1)*θpreff)** (see functions **abs()** and **angle()** in MATLAB).

The vector method is a popular fit-less method for finding the orientation preference, but the vector magnitude will underestimate the response of an orientation-selective cell whose preference falls between 2 of the sampled orientations (Swindale, 1998); when one normalizes by the greatest individual response, then the vector magnitude will be an overestimate. Further, because the estimate of the angle location is linear whereas most neurons actually exhibit a more gaussian shape, vector methods for orientation selectivity also have larger errors than fit methods, provided the cell is well tuned (Swindale, 1998).

The deficiencies of vector methods and the problems of garbage in/garbage out for fits of weakly tuned cells leave us in need of a decent fit-less characterization of the degree of orientation tuning in a cell. In 2002, Ringach and colleagues devised a new measure they termed **circular variance**, calculated as

.

The circular variance is a single number that combines tuning width and preferred/orthogonal response characteristics. Note that this formula is 1 - [vector magnitude]/[total response]. If a cell responds to 1 and only 1 stimulus around the circle, then the circular variance is 0. If a cell responds to every orientation equally, then the circular variance is 1.

This measure has noise advantages over the strategy of computing the "**simple fit-less orientation selectivity index**" that simply finds the **θbest**, that is the angle with the strongest response, and calculates (**R(θbest)-R(θbest+90°))/R(θbest)**because, in the circular variance, the "comparison rate" is the response over all of the angles, whereas, in the fit-less orientation selectivity index, the "comparison rate" is arbitrarily chosen as 90° away from the strongest response. For strongly selective cells, these differences are moot. However, unselective but noisy cells often show large fit-less orientation selectivity index values if their largest value and a small response values happen (by chance) to be offset by 90° of angle (the big one becomes **R(θbest)** and the small one becomes **R(θbest+90°)**).

Therefore, the **circular variance** is, to my knowledge, the most robust fit-less measure of orientation selectivity.

The figure shows the results of vector magnitude (red), simple fit-less OSI (green), and 1-circular variance (so that highly tuned neurons have values near 1) of artificially-generated data with different theoretical simple fit-less OSI values plus noise. Note that 1-circular variance exhibits the least noise. For cells that are weakly tuned, (theoretical OSI=0.18 or so), the simple fit-less OSI can vary from about -0.2 to 0.3, while the 1-circular variance measure ranges from 0.01 to 0.08 over the same range.

2. **Significance of tuning**:

If one uses fit-less methods, one can make an arbitrary cut off for tuning widths or index values, but this isn't very satisfying. What we have done in the past to determine statistical significance is to look at the cloud of points in the vector representation of orientation tuning, and ask, using a 2-dimensional T-test, if the point is significantly different from the point (0,0). This 2-dimensional t-test is known as Hotelling's test. We obtain a P value from this test, which gives us the probability that the mean value of the cloud of points in orientation vector space is equal to (0,0) plus noise.

**Conclusions:**

The **circular variance** is the most robust fit-less measure of orientation selectivity. If one wants to examine orientation selectivity in a large population of neurons, some of which may be well-tuned and some of which may be poorly-tuned, I know of no better method than measuring circular variance for all cells.

Sometimes we are interested in other parameters such as tuning width or preferred/orthogonal comparisons. In this case, **fits** will do the best job of extracting these parameters. However, due to the garbage in/garbage out problem of fits, I know of no good method to compare tuning width and preferred/orthogonal ratios among a large population of cells, some of which are tuned and some of which are poorly tuned. Instead, I only examine fits of cells that exhibit significant orientation tuning as determined by Hotelling's test. In those cells, I examine the **half-width at half-height** for **tuning width**, and the **orientation selectivity index** as defined above.

**Direction selectivity**

We typically want to know one of the following questions:

To what degree does a cell exhibit a

**greater response**to stimulation**in its preferred direction****as compared to the opposite direction**?Does the cell exhibit significantly greater response to stimulation in its preferred direction as compared to the opposite direction?

**1. Degree of tuning**:

Typically, we are interested in trying to calculate some comparison of the response in the preferred direction to the response in the opposite direction. In addition, direction-selective cells exhibit orientation selectivity by definition, so we may also be interested in many of the same parameters, such as tuning width.

**Fit methods: **The most straight-forward way to extract all of these parameters is with a constrained gaussian fit:

.

In the direction equation, **ang(x)** wraps around 360° instead of 180° in the orientation equation above.

The same caveats about garbage in/garbage out apply here as for fits of orientation selectivity: 1) one must sample enough angles around the circle with enough repetitions, and 2) these fits will be garbage if the cell doesn't exhibit significant orientation selectivity.

One can define three related direction selectivity index values based on these fits, which we'll call **DI**, **DIr**, and **DIn**:

,

, and

,

where **PREFERRED = R(θpref)** and **OPPOSITE = R(θpref+180°)**.

These quantities are very similar. The first, **DI**, is nice in that when the preferred response is twice the opposite response, then the index value is 0.5. However, when the opposite response is below the background rate (that is, the opposite response is negative), then the DI can grow to be greater than 1. There is nothing inherently wrong with this, but sometimes for simplicity we'd like all of our values to be between 0 and 1. So, my preferred index is **DIr**, which is simply DI rectified so that it cannot exceed 1. The last measure **DIn** is defined to be between 0 and 1, and treats below-baseline (negative) opposite responses as being equivalent to an increase in response the preferred direction. There is nothing wrong with this definition; if a cell responds twice as much to stimulation in the preferred direction as the opposite direction, then this index value is 1/3.

**Fit-less methods**: Direct application of vector methods do a particularly poor job of extracting direction preference. One might imagine that one could find the direction preference and direction magnitude of a cell by calculating the mean direction vector. For highly direction-selective cells, this is fine, but this situation is intolerable for cells with small amounts of direction selectivity because the magnitude and direction preference values will be heavily influenced by noise (the large responses in the 2 opposite directions cancel, leaving the angle and magnitude of the vector dominated by off-peak responses). If one must use vector methods to calculate direction selectivity, then I recommend first using vector methods to determine the orientation of the cell, and then to calculate the magnitude of the direction response vector that is along the preferred orientation (square root of the dot product of the direction vector with a unit vector with the cell's orientation preference.

**2. Significance of tuning:**

Sometimes we want to know, does a cell respond to the preferred direction more than it responds to the opposite direction in a statistically significant way? The only way I know to address this question is to use the bootstrap to estimate the confidence intervals of the direction preference value above. In the past, I have plotted a histogram of the distribution of our bootstrapped estimates of the direction preference, and have called a cell significant if 95% of the estimates are in a single direction (that is, if our uncertainty, expressed here as unc., is less than 5%):

Distributions of estimates of direction preferences for 6 cells (Li/Van Hooser et al. 2008).

**Conclusions:**

In general, I favor **only computing a direction index for cells that exhibit significant orientation selectivity as defined by the Hotelling's test**. I use the **constrained gaussian fit** and report **DIr** as the direction index for cells.

**Example code:**

The code used to artificially generate tuning curves can be found in our tools, in

**[YOURPREFIX]/vhtools/VH_matlab_code/VHLabTools/Tutorials/**

**OriDirCurveDemo.m**

**TestCircularVarianceVsOIVsVec.m**