Comprehensive Example #2: Neuronal Spike Visualization

Neurons in the brain convey information by firing spikes (also known as action potentials). By placing a wire probe near a neuron, it is possible to record its electrical potential and thus determine when the neuron fired. These spiking events can be related to the behavior of an animal during a task. This is a fundamental technique in cognitive neuroscience.

A recent advancement in extracellular recording is the invention of the tetrode by Bruce McNaughton and colleagues at the University of Arizona. A tetrode is a twisted set of four wires that can be used to resolve the activities of up to 20 neurons simultaneously. The idea is that if a tetrode sits in a bed of neurons, different neurons will have a different signature on the four wires because the electrical potential seen at each wire will depend on its distance from the spiking neuron.

We can see that the amplitudes of the spikes tend to cluster in slightly fuzzy groups. Our goal here is to plot the peak amplitude of the data recorded on the wires in three dimensions and to develop this prototype into an interactive program for isolating these clusters. In the next chapter, we will add a picking behavior so that we can plot the spike waveform for different clusters of spikes. We will also add some Swing user interface components and multiple projections.

The important class in this example is SpikeCloud.java, shown in Listing 11.21, and Figure 11.14 displays the sample output.

Listing 11.21 SpikeCloud.java
import javax.media.j3d.*;
import javax.vecmath.*;
import java.util.Random;
import java.math.BigInteger;

public class SpikeCloud {

   float verts[];
   Point3f[] sCoords;
   Color3f[] sColors;
   int npoints;
   PointArray points = null;
   Shape3D shape;

   public SpikeCloud() {
      ReadSpikes s = new ReadSpikes(1,60000);
      this.npoints = s.nrecs;

      sCoords = new Point3f[this.npoints];
      sColors = new Color3f[this.npoints];

       for (int ii=0; ii<this.npoints;ii++) {

           sCoords[ii] = new Point3f(s.sdata[ii][0].floatValue()/1000,
                                       s.sdata[ii][1].floatValue()/1000,
                                       s.sdata[ii][2].floatValue()/1000);
        sColors[ii] = new Color3f(1.f,0.f,1.f);

        }

      Appearance app = new Appearance();
      points = new PointArray(this.npoints, PointArray.COORDINATES |
                              PointArray.COLOR_3);
      points.setCoordinates(0, sCoords);
      points.setColors(0, sColors);
      shape = new Shape3D(points, app);
   }

   public Shape3D getShape(){
      return shape;
   }
}

Figure 11.14. Screenshot from BasicRecipeJ3D.java with an object of the SpikeCloud class added to the content subgraph.


Note the instantiation of the ReadSpikes class. This class isn't shown because it doesn't specifically apply to Java 3D. However, the class illustrates how to load existing data into Java 3D. For the interested reader, we include ReadSpikes.java in the download from the Web site for the book.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset