Chapter 2: Looking at the Data

Chapter Sections

Chapter Overview

Chapter 1 demonstrated the construction of a small network to visualize the geometry of a mesh. Chapter 2 demonstrates how to extend that net, adding tools to look at data values on the geometry. Specifically, how to visualize a scalar quantity (voltage) on a set of points in space (a PointCloud of electrodes).

In the previous net, three modules were hooked together--FieldReader, ShowField, and Viewer. In the user interface of the ShowField module, the Default Color selector was used to render all geometry in blue.

In this chapter, rather than mapping a single color to the geometry, colors will vary across the mesh based on the data's scalar values.

Bioelectric Field Units

The quantities of interest in bioelectric field problems are conductivity, potentials, electric field, dipole source, current density, and current source density. These quantities and their associated units are listed in the following table:

Quantity Unit
Conductivity (amps / volts) / meter or (siemens / meter)
Potential volts
Electric Field volts / meter
Dipole Source amps / meter
Current Density amps / meter2
Current Source Density amps / meter3

SCIRun doesn't keep track of unit scale factors (e.g. centi-, milli-, etc). SCIRun assumes a dipole source is in units of amps / meter, conductivities are in siemens / meter, model geometry is in meters; results are therefore in units of volts. If this isn't true (e.g. you know that the model is in mm), then you have to carry those scale factors through your computation (e.g. know that the results you get out are in kv).

The rule of thumb is that if we increase the conductivity, then we decrease the potentials by that same scale factor. Conversely, if we increase the dipole source moment, then we increase the potentials by that same scale factor. i.e. V = I / sigma. Similarly, if we hold everything else constant, but increase the size of the domain, then we decrease the potentials by that same scale factor.

For example, the SCIRun Utah Torso model has a length scale of centimeters (10-2 meters) and conductivity units of (siemens / meter), so our output potentials are in hectovolts (102 volts).

Color Maps

A color map is an array of colors that, when used to color data based on the data's value, help the user interpret data more easily. A color map consists of a set of colors that evenly change in red, green, blue, and/or alpha (RGBA). These colors are mapped to a range of data values, as specified by the minimum and maximum data values of the data set in question. An infinite number of color maps can be created. SCIRun provides a large number of predefined color maps for convenience. Figure 2.0 shows several example color maps.

Figure 2.0: Example Color maps provided by the
GenStandardColorMaps module.

Adding Color To Your Net

The first step in this chapter is to map the data value at each node of the mesh to a meaningful color in order to differentiate one data value from another. The GenStandardColorMaps module in SCIRun provides this mapping.

The GenStandardColorMaps module generates color maps in SCIRun. This module contains a selection of default color maps. For each color map, the user controls the opacity (alpha) for each data value, then chooses the number of discrete entries in the color map table (the default is 256 colors).

The color map determines which values in the data are assigned to each color. By default, the minimum/maximum range is -1 to 1.

Using the RescaleColorMap module, set the min/max values by hand, or auto-scale them to correspond with the min/max data value range from a scalar field.

Now, add a GenStandardColorMaps and a RescaleColorMap module to the net created in Chapter 1.

  1. First, open the SCIRun environment and load show-torso-mesh.net located in ../SCIRun/src/nets (as saved in Chapter 1).

  2. Now, add both modules: GenStandardColorMap and RescaleColorMap, located under the SCIRun->Visualization menu (see Figure 2.1).

  3. Connect the output from GenStandardColorMaps to the input of RescaleColorMap.

  4. Connect the output from the FieldReader to the other input port of RescaleColorMap.

  5. Finally, connect the output from RescaleColorMap to the input of ShowField.

The network should be similar to Figure 2.1.

Figure 2.1: Net With Color Map Modules.

The RescaleColorMap, similar to the Viewer module in Chapter 1, is an example of a module with dynamic input ports. If the user connects more than one field into RescaleColorMap, the min/max range for auto-scaling corresponds to the min/max range of data values from all input Fields.

The second input port on the ShowField module accepts a color map that maps the data values in its input Field to a color in the input color map, and renders accordingly. If a color map is present in ShowField, the module ignores the Default Color, and uses the color map values instead. To force ShowField to use the Default Color when a color map is connected, select the "Use Default Color" checkbox for a specific tab.

To complete this net, read in a Field.

  1. Use the FieldReader User Interface (UI) to read in utahtorso-lowres-electrodes.pcd.fld (a point cloud of electrode positions, with voltages measured from a single instant in time). There may be a brief wait while several modules dynamically compile code.

  2. Select the Autoview option in the ViewWindow and rotate the image downward.

  3. In the ShowField UI, change the Node Scale to 6.The Node Display Type should already be set to Spheres.

  4. An image similar to Figure 2.2 should appear in the ViewWindow.


Figure 2.2: ViewWindow showing Utah Torso Electrodes.

GenStandardColorMaps GUI

Now, explore the UIs for the GenStandardColorMaps and RescaleColorMap modules. Upon pressing the UI button on the GenStandardColorMaps module, the user interface shown in Figure 2.3 will appear.

Figure 2.3: UI for GenStandardColorMaps.

Please note the following:

  • A selection of standard color maps appears on the bottom half of the window.

  • The selected color map appears at the top of the window, and has a clickable interface for changing the opacity of each color swatch in the map. The red line in the middle of the color map represents the opacity (alpha) of the color map.

  • To add additional control points, left click on the color map. To remove additonal control points, right click on a control point.
  • The Shift slider skews the color map to the left or right.

  • The Resolution slider sets the number of distinct colors to be stored in the color table.

  • To generate banded colors, choose a low resolution.

  • For smoother color transitions, choose a higher resolution (256 colors).

In GenStandardColorMaps, change the color map from Inverse Rainbow to Inverse Darkhue. This changes the image in the ViewWindow from the image originally generated (Figure 2.2) to the one seen in Figure 2.4.

Figure 2.4: Image Using the Inverse Darkhue Color Map.

RescaleColorMap GUI

The RescaleColorMap module is used to change the way the color map is mapped onto data. This allows the image to be easily interpreted by the user. Figure 2.5 shows the UI for the RescaleColorMap module.

Figure 2.5: RescaleColorMap UI.
  • The minimum/maximum range of the color map can be set manually or automatically.

  • If the range is auto-scaled, it will correspond to the minimum and maximum data values from all input Fields connected to the module.

Change the color map range in the RescaleColorMap UI to a Fixed Scale of -30 to 30 and click Execute. Figure 2.6 shows the image with the Fixed Scale. Notice that by using this range, the electrodes appear very homogeneous.

Figure 2.6: Image Using Auto Scaled Color Map.

Summary

Chapter 2 demonstrated adding GenStandardColorMaps and RescaleColorMap modules. These modules look at data values and varying colors over the geometry, rather than mapping data to a single color.

Chapter 3 features more visualization techniques, and explores inputing and outputing a Field.

Return to Top