SCI Home Software Documentation Installation User's Guide Developer's Guide

CIBC:Documentation:SCIRun:Tutorial:BioPSE:Chapter 6

From SCIRun Documentation Wiki

Jump to: navigation, search

Prev Next Contents


Contents

Chapter 6: Putting Simulation and Visualization Together

Chapter Sections

Chapter Overview

Chapters 1-4 demonstrated the construction of a set of visualization networks to explore scalar and vector fields. Chapter 5 implemented a network to solve a bioelectric finite element problem. Output of the network was a solution vector, Image:phi.gif, containing the potential at each node in the finite element mesh.

Chapter 6 uses the finite element simulation network from Chapter 5, and the visualization network from Chapter 4. The final piece is a module that connects the solution vector of scalar values to the nodes of the tetrahedral finite element mesh. The SwapFieldDataWithMatrixEntries module (SCIRun->ChangeFieldData) accomplishes this task. It is described in the following sections.

SwapFieldDataWithMatrixEntries

The SwapFieldDataWithMatrixEntries (SCIRun->ChangeFieldData) module performs two simultaneous operations. First, the module splits the input Field into a mesh and data values. The data values pass through the output matrix port. Second, the module combines the mesh with the matrix input, creating a new Field output.

There are a few rules that increase the module's versatility and complexity:

  • If the module has no input matrix, the output Field is the same as the input Field.
  • If the input Field's data are scalar, the output matrix is a column matrix.
  • If the input Field's data contains N vectors, the output matrix dimension is Nx3.
  • If the Field contains N tensors, the output matrix dimension is Nx9 where the tensor is flattened out in left-to-right, top-to-bottom, order.
  • The number of rows in the input matrix should equal the number of data values in the input Field.
  • The output Field's type is the same as the input Field's type. For instance, if the input Field is a vector Field, the output Field is also a vector Field. The input matrix must be Nx3 where N is equal to the number of data values in the input Field.

Combining Simulation and Visualization

Use the File->Insert option to combine the finite element simulation net from Figure 5.2, with the visualization net from Figure 4.2. Add a SwapFieldDataWithMatrixEntries module between them. The net should look similar to Figure 6.1. Notice that in Figure 6.1, the modules have a more horizontal layout then in Figure 4.2. Note that all modules that were connected to the left ReadField module in the chapter 4 net, are now connected to the SwapFieldDataWithMatrixEntries module. Notice also that the RescaleColorMap module is getting input from the MapFieldDataFromSourceToDestination module.

Image:6_1.gif
Figure 6.1, Chapter 6 network

After executing the network, the image in the ViewWindow should look similar to Figure 6.2. Press the Autoview button to center the dataset in the view window.

Image:6_2.gif
Figure 6.2 shows net with SwapFieldDataWithMatrixEntries module

Summary

Chapter 6 demonstrated how to combine two existing networks, reusing the finite element simulation network from Chapter 5, and the visualization network from Chapter 4. The SwapFieldDataWithMatrixEntries module was used to connect the solution vector of scalar values to the nodes of the tetrahedral finite element mesh.

Chapter 7 illustrates how to add a feedback module, and interactively visualize the results.

Return to Top


Prev Next Contents

Personal tools