Streamlines in SCIRun

The Problem

We want to view current flow within a conductive volume. Further, we want the streamlines rendered in a somewhat intuitive manner, such as the density of lines reflecting the current density.

One Solution

Originally, streamlines in SCIRun were simply drawn along electric field lines. Recall that the electric field is the negative gradient of the potentials within the volume (the hat indicates a vector or vector field):

where E is the electric field vector and V is voltage. The general algorithm is to pick some seed points in the volume and then draw streamlines up and down the voltage gradient from those seed points, as shown here:

streamlines_front.jpg

streamlines_top.jpg

The problem with this approach is that it visualizes the voltage gradient, when what we really want to show is current. Visualizing the gradient alone is not the same - notice how streamlines go directly through axons in the picture.

The solution is to solve for the current density from:

where J is the current density vector and s is conductivity. If s were a scalar value we could just multiply it. But recall that for a volume, s is a tensor so we must find the dot product. Recall also that the dot product of a tensor and a vector is a vector, so the resulting current density is a vector field which can be visualized in SCIRun as follows:

current_density_front.jpg

current_density_top.jpg

Now we can draw streamlines using the current density rather than the electric field. In addition, we use a different method for seeding the streamlines. Ian had the idea of seeding streamlines with a sphere placed around our current source, similar to how streamlines are drawn in 2D on paper. This results in the following, which is more along the lines of our intuition:

new_streamlines_front.jpg

new_streamlines_top.jpg

Note that some streamlines near the axons simply stop.  This results from a mesh that is too course.  A finer mesh should show streamlines flowing around the axons.

Technical Note

It is not advisable to set any part of the volume to zero conductivity. SCIRun solves Poisson's equation for the field potential:

If the conductivity is zero then any value of E will solve this equation. So the solver is likely to do just that - assign any value to E. You don't know what you'll get.

Technical Note II

If the magnitude of the gradient (current or voltage) is numericacally too small (less than about 1e-7) then it will get dropped from the viewer window.  The gradient still exists in the mesh but the vector widgets are too small to visualize.