SCIRun Modules
BIOPSE
Calculates the divergence of a vector field over a surface. It is designed to calculate the surface integral of the vector field (gradient of the potential in electrical simulations).
Builds the surface portion of the RHS of FE calculations where the RHS of the function is GRAD dot F.
Detailed Description
Input
- A FE mesh with field vectors distributed on the elements (constant basis).
Output
- The Grad dot F
BrainSimulator
Calculation of magnetic field at given detector points due to specified dipoles.
Detailed Description
The modules calculates the magnetic field due to given dipoles at specified detector positions based on the Biot-Savart law.
Bundle
This module retrieves a field object from a bundle.
Detailed Description
This module retrieves a field object from a bundle by specifying the name under which the object is stored in the bundle. The module has three output ports that each can be programmed to retrieve a specific field object.
There are two ways of specifying the name of the field object. Firstly one can enter the name of the object in the entry box on top of the menu, secondly one can execute the module, in which case a list of all objects of the field is generated. By selecting the one that one wants on the output port the object can be retrieved from the bundle.
The first bundle output port generates a copy of the input bundle and can be used to attach a second module that retrieves data from the bundle.
This module retrieves a matrix object from a bundle.
Detailed Description
This module retrieves a matrix object from a bundle by specifying the name under which the obect is stored in the bundle. The module has three output ports that each can be programmed to retrieve a specific matrix object.
There are two ways of specifying the name of the matrix object. Firstly one can enter the name of the object in the entry box on top of the menu, secondly one can execute the module, in which case a list of all objects of the matrix is generated. By selecting the one that one wants on the output port the obect can be retrieved from the bundle.
The first bundle output port generates a copy of the input bundle and can be used to attach a second module that retrieves data from the bundle.
This module retrieves a string from a bundle.
Detailed Description
This module retrieves a string object from a bundle by specifying the name under which the obect is stored in the bundle. The module has three output ports that each can be programmed to retrieve a specific string object.
There are two ways of specifying the name of the string object. Firstly one can enter the name of the object in the entry box on top of the menu, secondly one can execute the module, in which case a list of all objects of the string is generated. By selecting the one that one wants on the output port the obect can be retrieved from the bundle.
The first bundle output port generates a copy of the input bundle and can be used to attach a second module that retrieves data from the bundle.
Collects the current environment variables into a bundle.
Detailed Description
InsertEnvironmentIntoBundles reads all the environment variables used in the current SCIRun session and saves them into a bundle for use in the SCIRun Network. It saves each environment variable as a string with the same name as the variable and the contents of the value of the variable. This module is useful in scripting SCIRun because parameters can be set outside SCIRun and passed into SCIRun, e.g. paths to directories were data is stored. Use GetStringFromBundle to read the environment variables saved into the bundle.
This module inserts a field object into a bundle.
Detailed Description
This module inserts a field object into a bundle. In the GUI of this module a name can be specified for the object. The latter will be used to catalogue the object inside the bundle. This module allows for three field objects to be inserted at the same time. In the GUI a name can be specified for each of the field objects by clicking on the tab that corresponds to the input port where the dataflow object is located.
This module inserts a matrix object into a bundle.
Detailed Description
This module inserts a matrix object into a bundle. In the GUI of this module a name can be specified for the object. The latter will be used to catalogue the object inside the bundle. This module allows for three matrix objects to be inserted at the same time. In the GUI a name can be specified for each of the matrix objects by clicking on the tab that corresponds to the input port where the dataflow object is located.
This module inserts a string object into a bundle.
Detailed Description
This module inserts a string object into a bundle. In the GUI of this module a name can be specified for the object. The latter will be used to catalogue the object inside the bundle. This module allows for three string objects to be inserted at the same time. In the GUI a name can be specified for each of the string objects by clicking on the tab that corresponds to the input port where the dataflow object is located.
This module lists all the objects stored in a bundle.
Detailed Description
This module lists all the objects stored in a bundle. The names of all the objects are listed as well their types.
ChangeFieldData
Apply a mapping matrix to project the data from one field onto the mesh of another field.
Detailed Description
Mapping data from a source field to a destination field can be done in a two stage process. First one builds a mapping matrix that describes which linear combination of data values of the source field needs to be taken to form a value in the destination field and secondly one multiplies the data vector of the source data with this matrix to obtain the destination data vector. This module accomplishes the second stage of this process. In order to build a mapping matrix use the module BuildMappingMatrix in the MiscField category. The reason for splitting this process is to improve performance of the mapping.
A second advantage of calculating the mapping matrix is that multiple mapping matrices can be built, which then can be multiplied to create the mapping matrix that spans a series of mesh operations.
This module computes the minimum distance between an object (field or mesh) and the nodes in field or the center of the elements.
Detailed Description
This module computes the minimum distance between a node or an element (center of element) and a mesh. In case the object field is a point cloud the module computes the distance to the closest node, in case the object mesh is a curve it will find the closest distance to the curve, etc. The result is a field where the scalar values refer to the distances to the object field. The first input of this module is the field at which the distance field needs to be calculated, the second input port defines the field the distance to which needs to be calculated.
If the original field has the data located on the nodes of the mesh, these nodes are used to calculate the distance to the field object, if the data is located on the elements the distance to the center of the elements is calculated. If no data is stored in the field, the distance to the nodes is calculated.
This module computes the minimum distance between the boundary of the field and the nodes in field or the center of the elements.
Detailed Description
This module computes the minimum distance between the boundary of the field and the nodes in field or the center of the elements. The first input of this module is the field on which we want to calculate the distance, the second input port is the field/mesh the distance to which we want to compute. If the input field has data contained on the nodes, the distance to the nodes of the mesh will be calculated, if the data is located at the elements, the distance to the center of the element will be calculated. If the input field contains no data, the distance to its nodes will be calculated.
This module calculates a new value for each value in the Field data based on a user defined function. This function is based on a series of variables that is available for each data location. Once the function is defined, the module will walk through each data value and apply the function.
Detailed Description
This module allows the computation of a new scalar, vector or tensor value for each data location in the Field. The user defined function can depend on a number of variables that are defined for each location:
Input Variables
-
DATA
: This is the current value stored in the Field (either on the element or the node location). -
X,Y,Z
: Cartesian coordinates of the node or element (center of the element) -
POS
: Vector with Cartesian coordinates of the node or element -
A,B,C,...
: Input from additional Matrix ports. The input Matrix can have either 1 row or the same number of rows as there are values in the Field. In case the Matrix has one value this value is the same for each data location, in case it has multiple values the module iterates of the values in the same way it iterates over the data values of the Field. The Matrix input can have either 1 column, 3 columns, 6 or 9 columns. In case the Matrix has 1 column values are assumed to be scalar values, in case the Matrix has 3 columns it is assumed to contain vector values and in case it has either 6 or 9 columns it is assumed to be a tensor value. A 6 valued tensor is defined as xx, xy, xz, yy, yz, and zz. -
INDEX
: The index number of the element or node. -
SIZE
: The number of elements or nodes in the Field (depends on the input Field mesh type). -
ELEMENT
: Special access variable to access properties of the element. Currently only length, area, and volume are available to be called on this entity. In case one is iterating over the nodes, the node point is assumed to be the element, in case one is iterating of the elements, this variable is referring to the full element.
Output Variable
The output needs to be stored in the variable RESULT
.
Available Functions
A list of available functions is available in the GUI of the module. The Parser Helpbutton brings up a list of available functions to do scalar/vector/tensor algebra and to view the functions that can be applied to the ELEMENT
variable.
Input Ports
The first input is the Field whose data needs to be recalculated using a function. The second port is an optional port that allows the user to script the module with a user defined input function. This function will override the function entered in module GUI. The third and next ports are used to import a Matrix. The first port corresponds to Matrix A, the next to Matrix B and so on. These ports can be used to do algebra with values stored as a Matrix or can be used to enter scriptable scalar/vector/tensor values that can be defined elsewhere.
Output Port
The module has one output port that has the newly defined values.
Example Functions
Suppose one wants to set the data values to a certain value:
RESULT = 2;
This will set every data value inside the Field equal to the value 2.
Similarly one can set the data value to a value specified inside the first Matrix on the input ports:
RESULT = A;
If the Matrix contains only one value each data point is set to that value, if it contains the same number of values as datalocations, it will map each value in the Matrix to one value in the Field.
One can as well query the positions of the data point:
RESULT = X+Y;
This will store X+Y in each data location.
This same module can be used as well to generate vector or tensor data:
RESULT = Vector(X,Y,cos(A));
This will take the X, Y, position and the cos applied to the values in the Matrix A to create a new vector.
One can reuse the value that are there as well:
RESULT = DATA+A+B*C;
Output Data Type
As the function is parsed using the compiler, the output type cannot be guessed by the module, hence it needs to be set by the user to the correct data type.
This module computes the derivative of a scalar field and output it as a vector field.
Detailed Description
The CalculateGradients module computes the derivative of a scalar field and converts it to a vector field. The gradient is the derivative of three dimensions; the first component in the X direction, the second component in the Y direction, and the third component in the Z direction grid, computing the general direction of “flow” at a specific point on the geometry.
Not all field types are supported by the CalculateGradients module. At this time only derivatives of TetVolMesh and LatVolMesh are supported. The CalculateGradients module has no GUI. If CalculateGradients recieves as input a Field type it does not support, an error message appears in the Error frame of the SCIRun environment.
This module detects whether a node or a cell is inside any of the object fields. The output field will be indexed according to the object it is in, starting with index 1. Index 0 is reserved for the part of the field not in any of the object fields.
Detailed Description
This module detects whether a node or a cell is inside any of the object fields. The module uses the location of the node or the center of the element to test whether a node or element is inside any of the object fields. The output field will be indexed according to the object it is in, starting with index 1. Index 0 is reserved for the part of the field not in any of the object fields. The module has two options in the GUI, the first one determines whether the detection of the position has to be done for nodes or for elements and the second option allows the user to change the type of field that is generated, the output data will be cased to the selected output type. Also there are options to choose the sampling scheme and the sample points that need to be inside the field.
Creates a field with distances to a closed volume; inside the closed volume the field is positive and negative outside.
Detailed Description
This function needs an object field that is a volume or a closed surface. When inside the object the distance field is positive, when outside it is negative. The module will fail for not close surfaces as one cannot define inside and outside. Similarly this function will not work for objects that are lines or points. Use the CalculateDistanceToField module for these objects.
Given a field of vectors, this module will calculate the magnitude of each vector.
Detailed Description
Input: This requires a field with vectors at node or element locations.
Output: This will output a field with a scalar at each node or element location. The scalar will be the vector magnitude.
ConvertFieldBasis can modify the location of data in the input field.
Detailed Description
Upon execution the UI will display the input field name and the current location the data values for the that field are located.
The output field’s new data value location is selected from a list of available basis types. The output field will contain the same geometry as the input field with the data value storage at the newly specified location. All output data values are reset to 0.
There is currently support for three basis functions within SCIRun:
-
None, meaning that there is no data associated with the field and that no interpolation is supported.
-
Constant basis, when data is associated with the elements of a field. This data is not interpolated but is constant within each element and non-continuous at element boundaries.
-
Linear, the data is associated with the nodes of a field. Any interpolation will be done linearly within elements (but not across element boundaries).
ConvertFieldDataType is used to change the type of data associated with the field elements.
Detailed Description
ConvertFieldDataType allows the user to change the datatype at each field data_at location. This module also attempts to convert the data in the field to the new type, if possible. If no conversion is possible, the output field will contain default zero values. Note that conversion from a large datatype to a smaller datatype usually results in a loss of precision.
This module takes a field with inidices and puts the data indexed from a matrix in the field.
Detailed Description
This module takes a field with inidices on the nodes or elements of the field and assigns the data indexed from a matrix to the field.
This module calculates a new value for each value in the field data based on a user defined function. This function is based on a series of variables that is available for each data location. Once the function is defined, the module will walk through each data value and apply the function.
Detailed Description
This module allows the computation of a new scalar, vector or tensor value for each data location in the field. This module is closely related to CalculateFieldData, however it does not require any data to be present in the field and the data already in the field is ignored. This module also allows the user to state whether he or she wants to calculate data at the elements or at the nodes of the mesh.
The user defined function can depend on a number of variables that are defined for each location:
Input Variables
-
X,Y,Z
: Cartesian coordinates of the node or element (center of the element) -
POS
: Vector with cartesian coordinates of the node or element -
A,B,C,...
: Input from additional matrix ports. The input matrix can have either 1 row or the same number of rows as there are values in the field. In case the matrix has one value this value is the same for each data location, in case it has multiple values the module iterates of the values in the same way it iterates over the data values of the field. The matrix input can have either 1 column, 3 columns, 6 or 9 columns. In case the matrix has 1 column values are assumed to be scalar values, in case the matrix has 3 columns it is assumed to contain vector values and in case it has either 6 or 9 columns it is assumed to be a tensor value (A 6 valued tensor is defined as xx, xy, xz, yy, yz, and zz). -
INDEX
: The index number of the element or node. -
SIZE
: The number of elements or nodes in the field. (Depending on the input field type) -
ELEMENT
: Special access variable to access properties of the element. Currently only length, area, and volume are available to be called on this entity. In case one is iterating over the nodes, the node point is assumed to be the element, in case one is iterating of the elements, this variable is referring to the full element.
Output Variable
The output needs to be stored in the variable RESULT
.
Available Functions
A list of available functions is available in the GUI of the module. Press on the button available functions to obtain a full overview of the current available functions to do Scalar/Vector/Tensor algebra and to view the functions that can be applied to the ELEMENT
variable.
Input Ports
The first input is the field whose data needs to be recalculated using a function. The second port is an optional port that allows the user to script the module with a user defined input function. This function will override the function given in the GUI of the module. The third and next ports are used to import a matrix. The first port corresponds to matrix A, the next to matrix B and so on. These ports can be used to do algebra with values stored as a matrix or can be used to enter scriptable scalar/vector/tensor values that can be defined elsewhere.
Output Port
The module has one output port that has the newly defined values.
Output Data Type
As the function is parsed using the compiler, the output type cannot be guessed by the module, hence it needs to be set by the user to the correct data type.
Make a new vector field that points to the input point
Detailed Description
This creates a new vector field containing the same geometry and data location as the input field. It works in two modes. If the input PointCloudField contains only one point, all of the vectors in the output field will be attracted to that input point. If the input PointCloudField contains two or more points, the first two points will be used as a line and all the vectors in the output field will be attracted to that line. If the input field contains scalar values, the vectors in the output field will be scaled by those values. Otherwise they will all be normalized.
This will get the data (scalar, vector, tensor) associated with the nodes or the elements of a Field and put them in a Matrix or Nrrd with the first entity corresponding to the first matrix entity.
Detailed Description
Input Port
A Field with data on the nodes or elements.
Output Ports
A Matrix, Nrrd, or complex Matrix with the corresponding data.
This module computes the minimum distance between an object (field or mesh) and the nodes in field or the center of the elements.
Detailed Description
This module computes the minimum distance between a node or an element (center of element) and a mesh. In case the object field is a point cloud the module computes the distance to the closest node, in case the object mesh is a curve it will find the closest distance to the curve, etc. The result is a field where the scalar values refer to the distances to the object field. The first input of this module is the field at which the distance field needs to be calculated, the second input port defines the field the distance to which needs to be calculated.
If the original field has the data located on the nodes of the mesh, these nodes are used to calculate the distance to the field object, if the data is located on the elements the distance to the center of the elements is calculated. If no data is stored in the field, the distance to the nodes is calculated.
This module computes the value of the elements based on the data from the adjoining elements. This module supports various operations to map node data to element data.
Detailed Description
Supported methods are:
- AVERAGE - Compute the average of adjoining nodes
- MIN - Compute the minimum value of adjoining nodes
- MAX - Compute the maximum value of adjoining nodes
- SUM - Compute the sum of the adjoining nodes
- INTERPOLATE - Compute a weighted average of the adjoining nodes
This moduled takes a field and finds data values for the destination geometry and outputs the resulting field.
Detailed Description
This modules takes 2 Fields as input:
- Source contains geometry and data values.
- Destination contains geometry only.
This module will find the corresponding data value in the Source for each node in the Destination field. The data values can be stored at the nodes, cells, edges, or faces of the mesh at either the input or output ports. If the geometries of the input ports are different, the module will calculate data values for the Destination by interpolation.
This module returns 1 output Field:
- Remapped Destination contains the Destination geometry with the Source input.
GUI Options
The user can select the option of choosing the closest element (Constant option) when a data value cannot be interpolated. Otherwise, Linear interpolation can be used. The Maximum Distance option indicates the maximum distance between points of interpolation and data values. The default for unassigned values can be numeric or NaN.
This module maps data from one mesh to another mesh. The output mesh will have the data located on the elements.
Detailed Description
This modules can interpolate a scalar field, or calculate and interpolate the gradient, gradientnorm, or flux.
The first input is the source field. The second input allows you to specify the weights of the interpolation.
The output is the target field containing the interpolated data on the elements.
The GUI options allow you to change if the data is interpolated or taken from the closest element. You can also change how the sampling works within each element.
This module maps data from one mesh or point cloud to another mesh or point cloud. The output mesh will have the data located at the nodes.
Detailed Description
This modules can interpolate a scalar field, or calculate and interpolate the gradient, gradientnorm, or flux.
The first input is the source field. The second input allows you to specify the weights of the interpolation.
The output is the target field containing the interpolated data on the elements.
Maps data centered on the nodes to another set of nodes using a radial basis.
Detailed Description
The first input field is the source field and the second input is the target field. The fields should be formatted for the data to be set on the nodes.
The gui options allow you to set a maximum distance over which to the data will be interpolated. Everything outside that range will be set to the default outside value.
This module allows you to morph using a thin plate spline algorithm one point set or mesh to another point set or mesh. It also has the option for a rigid transformation. Both options require correspondence points from both point sets. This module also requires SCIRun to be compiled with LAPACK or Blas.
Detailed Description
-
InputField: This will read the node locations from an input mesh that is to be transformed.
-
Correspondences1: This reads the node locations from a field of the correspondence points in the new coordinate system
-
Correspondences2: This reads the node locations from a field in the same coordinate system as the InputField
Removes unused nodes from an input mesh.
Detailed Description
Extracts element and node data from the input mesh. Passes through the element data and determines which nodes are being used to define the elements. Any nodes not used to define the elements is eliminated.
Can only be done on unstructured meshes with linear elements.
This module allows you to set the scalar, vector, or tensor entries of an array or single column matrix to the nodes or elements of a mesh. The module checks the size of the array and compares it to the number of elements and nodes in order to determine where to put the data. The first entry in the array is applied to the first location on the mesh and this continues sequentially.
Detailed Description
The first input takes a field and it expects a mesh or a point set.
The second input takes an array of data or matrix.
The third input takes NRRD data: this can be used instead in place of the matrix.
This module sets field data to a given scalar value on a new output field based on the input field geometry.
Detailed Description
This module sets field data to a scalar value provided by the user in the GUI on a new output field created with the same geometry as the input field. The field basis type can be changed in the output field, or left the same as the input field (default). The scalar value can be set to any type supported by SCIRun (char, short, unsigned short, unsigned int, int, float, double), or left the same as the input field (default).
This function smooths vectors assigned to the elements of a mesh using a median filter. The filter creates a neighborhood by asking for elements that share faces two levels deep. The current vector is replaced by the vector with the median vector angle.
Detailed Description
Input requires a mesh with vectors assigned to the elements. The output produces the same mesh with a smooth vector field based on the median filter of the vector angle.
This module adds and removes data from a field.
Detailed Description
This module performs two simultaneous operations.
First the Input Field is split into its mesh part and its data values. The data values are packaged up and passed to the Output Matrix port.
Second the input field geometry is joined with the data from the Input Matrix, and the result is passed out on the Output Field port. If the input matrix is not present, then the second operation is not performed and the Output Field is the same as the Input Field.
The format of the Output Matrix will be a column matrix if the input field was of scalar type. It will be an Nx3 matrix if the input field contained vectors. If the field contained tensors it will be Nx9 matrix, where the tensor is flattened out in left to right, top to bottom order. Column 0 contains (0, 0), column 1 contains (0, 1), column 2 contains (0,2), column 3 contains (1, 0), etc.
The Input Matrix should have the same number of values as the field where the values are to be stored. The type of the Intput Field is preserved in the Output field as well. So for instance if the input field is a vector field, the Output Field will also be a vector field, and the input matrix should be an Nx3 matrix where N is equal to the number of elements to be filled in.
ChangeMesh
Scales, translates, and deforms an Input field to a defined Alignment field based on the volumetric bounding boxes that encompass each of these fields.
Detailed Description
The module extracts the center and size dimensions of each field. The center of the input field is reassigned to center of the alignment field. The size dimensions of the input field are likewise matched to those of the alignment field, proportionally reducing the Euclidean distance between nodes of the input field. The result is a transformed input field that shares the same dimensions and position as the alignment field (without rotation).
This module allows the computation of a new position for each node in the input field. The user defined function can depend on a number of variables
Detailed Description
Overview
Input Variables
-
DATA
: This is the current value stored in the field (either on the element or the node location). The value is only available if the data is located on the nodes. -
X,Y,Z
: Cartesian coordinates of the node or element (center of the element) -
POS
: Vector with Cartesian coordinates of the node or element -
A,B,C,...
: Input from additional matrix ports. The input matrix can have either 1 row or the same number of rows as there are values in the field. In case the matrix has one value this value is the same for each data location, in case it has multiple values the module iterates of the values in the same way it iterates over the data values of the field. The matrix input can have either 1 column, 3 columns, 6 or 9 columns. In case the matrix has 1 column values are assumed to be scalar values, in case the matrix has 3 columns it is assumed to contain vector values and in case it has either 6 or 9 columns it is assumed to be a tensor value (A 6 valued tensor is defined as xx, xy, xz, yy, yz, and zz). -
INDEX
: The index number of the element or node. -
SIZE
: The number of elements or nodes in the Field (depends on the input Field mesh type).
Output Variable
NEWPOS
: The output needs to be stored in the variable NEWPOS.
Available Functions
A list of available functions is available in the GUI of the module. The Parser Help button brings up a list of available functions to do scalar/vector/tensor algebra.
Input Ports
The first input is the Field whose node positions need to be recalculated using a function. The second port is an optional port that allows the user to script the module with a user defined input function. This function will override the function given in the GUI of the module. The third and next ports are used to import a matrix. The first port corresponds to matrix A, the next to matrix B and so on. These ports can be used to do algebra with values stored as a matrix or can be used to enter scriptable scalar/vector/tensor values that can be defined elsewhere.
Output Port
The module has one output port that has the newly defined values.
Output Data Type
As the function is parsed using the compiler, the output type cannot be guessed by the module, hence it needs to be set by the user to the correct data type.
Convert a HexVolField into a TetVolField.
Detailed Description
Given a Hex field (or anything that supports the same interface) as input, produce a TetVol as output – each Hex element gets split into 5 Tets. In order to produce consistent splits across faces, we alternate between two different templates for how to do the split. Currently HexVolMesh, StructHexVolMesh, and LatVolMesh fields can be converted into TetVolMeshes.
Convert input mesh to a PointCloudMesh.
Detailed Description
This converts a mesh to a PointCloudMesh (will not work on non-linear basis). If the input field is a PointCloudMesh, the field will be passed through to the output port. Data values and locations are preserved in the transformation.
Convert a structured mesh into an unstructured mesh for editing. An unstructured mesh is also implicitly irregular.
Detailed Description
This converts a LatVolField into a HexVolField, an ImageField into a QuadSurfField, or a ScanlineField into a CurveField. The structured meshes are not editable, as that operation does not preserve structure. Data values and locations are preserved in the transformation.
Convert a QuadSurfField into a TriSurfField.
Detailed Description
Given a QuadSurfField (or anything that supports the same interface) as input, produce a TriSurfField as output – each Quad element gets split into 2 Tris. In order to produce consistent splits across faces, we alternate between two different templates for how to do the split.
EditMeshBoundingBox is used to transform the field geometry.
Detailed Description
EditMeshBoundingBox can trasform the field geometry via the UI or a widget attached to a ViewScene window.
The output field is the transformed input field.
The output matrix is the resultant transformation matrix used to transform the field. It can be used to transform other fields in SCIRun.
The UI can change the center and the size of the output field. Check the box next to the output attribute you wish to modify. The ‘Copy Input to Output’ button will reset the output values to the input values.
To interactively transform the input field you must attach the Widget Port (the middle output port) to the viewer window.
To move the widget: Shift+LeftClick on the edges of the widget frame and move the transformation box around.
To scale the widget: Shift+LeftClick on the spheres located on each face of the widget and drag. This will scale the output field in a direction normal to the face the sphere is located on.
This modules changes the normal of the face of an element.
Detailed Description
Changes the normal of the face of an element on a surface mesh by reordering how the nodes are ordered in the face definition. It takes a surface of triangles or quads in the field format as an input and outputs the same surface with the normals going in the other direction.
This module loads in a field and returns its nodes in the form of a matrix.
Detailed Description
Input: a SCIRun field. Output: All the nodes of the input field, represented by an N*3 matrix. Each row gives the x-y-z coordinates of one node.
Project a point cloud onto a mesh
Detailed Description
ProjectPointsOntoMesh transforms individual points of a point cloud onto the surface of a mesh. This is a simple projection that finds the locations on the mesh (surface or point depending on the settings) that are closest to each point in the point cloud and uses those locations as the new coordinates for the respective points in the point cloud.
There are two options for projection; projecting points onto the elements or nodes of the mesh. Projecting onto the elements of the mesh will allow the points to be anywhere on the mesh. Projecting onto the nodes will ensure the new points will a subset of the mesh points.
There are two inputs to the module. The first input (Field) is the point cloud. The second input (Object) is the mesh onto which the points will be projected.
The output of the module is the projected point cloud.
Refines an area in a mesh to have elements of smaller size.
Detailed Description
RefineMesh is meant to make a portion or all of the elements of a mesh a smaller size. The refinement effectively divides each element so that the edge lengths are half, yielding four in the case of hex elements and eight in the case of tet elements. This module works on both hex and tet elements but works best on structured meshes.
The inputs of RefineMesh are the field containing the mesh that you wish to refine and a matrix input for the isovalue used to define the refinement region.
The outputs are a field containing the refined mesh and a mapping matrix that maps data from the unrefined mesh to the refined one.
There are several options in the RefineMesh UI that control the refinement strategy and the region of refinement. The first parameter sets the refinement strategy to the default or an expanded region to improve quality. The second parameter defines the portion of the mesh to refine. There must be non-uniform data on the mesh to specify a region to refine. The options are to refine all (no contraint), refine less than isovalue, refine unequal to isovalue, refine greater than isovalue, or refine nothing. The isovalue can be set in the provided field. The most common way to set a refinement region is to create a distance map determine the desired distance to use. CalculateDistanceToField can create a distance map to another mesh.
The RefineMesh algorithm expects the input field to contain data values. Data can be created on an input field using the CreateFieldData module.
This module aligns the normals in one direction.
Detailed Description This module aligns the normals of the meshes in one direction. It works for open surfaces and not for crossing surfaces. If there are any cross surfaces then they need to be isolated and then Reordering needs to be done.
Resample a regular mesh, such as a LatVol, in order to increase or decrease the number of elements and interpolate the data onto the new regular mesh.
Detailed Description
The input is a field containing a regular mesh. The GUI allows you to change the resolution of the output and to change the interpolation method.
Applies a scale factor to the node locations of the data and/or the data itself. The scale factor can be multiplied to nodes by shifting the centroid to zero and then shifting it back. Or the scale factor can be applied without bringing the centroid to zero. The latter will scale the mesh around zero, and the former will scale the mesh about it’s centroid.
Detailed Description
Input requires a mesh in a field format with or without data assigned to the nodes or elements. The second and third inputs are optional matrix fields were you can input the scale factor for the mesh and the scale factor for the data.
Changes the location of the nodes in a mesh.
Detailed Description
SetFieldNodes replaces the nodes in a mesh with nodes provided in a matrix. This handles most mesh types supported by SCIRun, but the simplest application is with tri or quad surface meshes. This module very simply replaces the old nodes with the new ones, without regard for quality of elements or other considerations, so care must be taken to ensure the nodes are in the same order.
The inputs of SetFieldNodes are the original mesh with nodes and connections, and the matrix of new nodes. The matrix must be Nx3, where N is the number of nodes in the original mesh, so that there is an x,y, and z coordinate for each node. The output is the mesh with the new node locations.
Non-interactive geometric transform of a field.
Detailed Description
This module is used to non-interactively transform the geometry of a field. The transform is passed in to the Transform Matrix port as a 4x4 matrix. There is no GUI for this module. The transform is generally computed by a different module, such as AlignMeshBoundingBoxes . For interactive geometry transforms, use the CreateGeometricTransform module.
Note that for fields containing vectors and tensors, the direction of the data will be altered by the transform.
Converters
Takes a 1x1 matrix, or a 1x1 subset of a matrix, and converts it to a scalar data type.
Detailed Description
This module prints the contents of a matrix into a string.
Detailed Description
For a dense matrix it outputs all the rows and columns of the matrix. For a sparse matrix only the non zero elements are printed.
This module takes a Nrrd and puts the data into a field.
Detailed Description
Nrrd is both a library and a file format. The full documentation can be found at http://teem.sourceforge.net/nrrd/index.html
The Data Location parameter lets you choose where to set the data in the field. The Field Type parameter determines the data type that the field is composed of. The Convert Parity parameter either does not correct, inverts the current parity or converts to a right handed coordinate system(RHS).
Note about RHS The Teem documentation is not specific on how to deal with RHS and LHS. Hence we interpret the information as following: (1) if a patient specific orientation is given, we check the parity of the space directions and the parity of the objective and convert if needed, i.e. either coord parity or space parity is LHS, then we mirror. (2) if ScannerXYZ is given, nothing is assumed about coord parity and space parity, as it is not clear what has been defined. (3) in case SpaceLeft3DHanded is given, we assume space parity is LHS and coord parity is not of importance.
This module takes 3 optional Nrrd input ports and puts the data into a matrix.
Detailed Description
Nrrd is both a library and a file format. The full documentation can be found at http://teem.sourceforge.net/nrrd/index.html
This module may convert the Nrrd data to a ColumnMatrix, DenseMatrix, or SparseMatrix depending on which ports are connected. The 3 input ports are Data, Rows, and Columns, respectively.
This module takes the real and imaginary components, in separate matrices, and concatenates them such that the resultant matrix contains the real and imaginary component of each component of the matrix.
Detailed Description
A detailed description of this module is not available at this time. For assistance please contact:
scirun-users@sci.utah.edu
This module takes a field and puts splits the data into 3 Nrrd ports.
Detailed Description
Nrrd is both a library and a file format. The full documentation can be found at http://teem.sourceforge.net/nrrd/index.html
This module creates 3 output ports which are Data, Points, and Connections, respectively.
DataIO
This module reads a bundle from file.
Detailed Description
This module reads a bundle from file. A bundle file has a .bdl extension and can be written with the WriteBundle module. In a .bdl file every component is stored. Hence it can be used to group a lot of different SCIRun objects together and store it in one file.
This module has one input port through which the user can define the name of the file that needs to be read. If this port is connected to a string dataflow object, this name is used instead the one entered in the GUI.
This module has two output ports: the first port contains the bundle that was read and the second port contains a copy of the filename. Hence, if one wants to annotate the results, this filename can be displayed using the ShowString module.
This module allows the user to load any of the SCIRun supported Field file types and then sets that field in the module’s output port.
Detailed Description
Upon opening, the ReadField GUI defaults to reading a single file in the directory where the user’s SCIRun executable resides, but also allows the user to navigate to the directory that the user sets for their SCIRUN_DATA environment variable through the Directory widget. The default file type is “*.fld”. Other supported file types are listed in the Files of type widget; these are generally NRRD, Matlab and mesh types. Files generally contain point cloud, surface or volume geometry such as point cloud points, triangle surface points and elements, tetrahedral mesh points and elements etc.
A typical way to import data into SCIRun is to read in geometry, and then also files containing data, then apply the data using a module like SetFieldData .
If the user attempts to read in a file other than a SCIRun supported file type, or uses an incorrect file format, an error message will be logged on the SCIRun module. Clicking the Set button will load the file. Clicking the Execute button will send the loaded field downstream if other modules are connected to the ReadField module’s output port.
The Time Series tab allows the user to load files numbered sequentially with a common basename with an optional delay. The playback controls allow the user to play through the files, or step forward and backwards.
This module reads a persistent matrix from a file and outputs that matrix to another module.
Detailed Description
Upon opening, the GUI defaults to the directory that the user sets for their SCIRUN_DATA environment variable. Otherwise, the GUI will default to the directory where the user’s SCIRun executable resides.
The current directory defaults to only show files with an .mat extension which helps the user determine the difference between matrix files and other files. However, the ReadMatrix can read-in a file with any extension so long as the data has the correct format.
If the user attempts to read-in a file that is other than a SCIRun supported matrix, or uses an incorrect file format, an error message appears.
This module allows the user to load Nrrd files and then sets that Nrrd data in the module’s output port.
Detailed Description
Nrrd is both a library and a file format. The full documentation can be found at http://teem.sourceforge.net/nrrd/index.html
This module is a wrapper around the Nrrd library’s function loadNrrd()
.
Upon opening, the ReadNrrd GUI defaults to reading a single file in the directory where the user’s SCIRun executable resides, but also allows the user to navigate to the directory that the user sets for their SCIRUN_DATA environment variable through the Directory widget. The only supported file type is “*.nrrd”.
If the user attempts to read in a file other than a SCIRun supported file type, or uses an incorrect file format, an error message will be logged on the SCIRun module. Clicking the Set button will load the file. Clicking the Execute button will send the loaded field downstream if other modules are connected to the ReadField module’s output port.
This module saves persistent field objects received from upstream modules.
Detailed Description
Upon opening, the GUI defaults to the directory that the user sets for their SCIRUN_DATA environment variable.
Otherwise, the GUI will default to the directory where the user’s SCIRun executable resides. The user can enter the name of a file that the matrix saves to. The file should have a .fld extension. The default file name is MyField. The user may also choose between a Binary or ASCII file format.
This module saves a persistent representation of a matrix to disk.
Detailed Description
Upon opening, the GUI defaults to the directory that the user sets for their SCIRUN_DATA environment variable.
Otherwise, the GUI will default to the directory where the user’s SCIRun executable resides. The user can enter the name of a file that the matrix saves to. The file should have a .mat extension. The default file name is MyMatrix. The user may also choose between a Binary or ASCII file format.
FiniteElements
The ApplyFEMCurrentSource module builds the right-hand side (ColumnMatrix) to reflect monopolar and dipolar current sources for finite-element based bioelectric field problems.
####Inputs:
####Outputs:
The first output, RHS, is the right-hand-side vector to be used with the stiffness matrix. The size of the vector is the number of nodes of the input mesh.
The second output, Weights, is a vector giving the weight of each component of the current source. When dipole sources are used, Weights contains the x/y/z-component of each dipole moments.
Detailed Description
If an input RHS ColumnMatrix is present, this module adds the contributions for the current sources into that matrix (i.e. multiple ApplyFEMCurrentSource modules can be cascaded together). If no RHS is present, this module will generate one. The RHS ColumnMatrix will be of length n, where n is the number of nodes in the finite element mesh.
We assume the mesh will be stored in a TetVolMesh, a HexVolMesh, or a TriSurfMesh.
There are two types of current sources supported by this module: dipoles, and sources-and-sinks.
With dipoles, the user must pass in a PointCloudField
In contrast to the dipole model, the sources-and-sinks option has several sub-models. To activate any of these, the user must select the “sources and sinks” option from the UI. The values that are used for sources-and-sinks are a combination of: the source and sink indices entered in the UI; a PointCloudField
- if we don’t have a Mapping matrix, we use the source/sink indices from the UI as node indices from the volume mesh between which one unit of current is passed;
- if we have a Mapping matrix, but we don’t have a Source field, then the source/sink indices refer to the PointCloud and we use the Mapping matrix to get their corresponding volume node indices, and we then pass one unit of current between them;
- if we have a Mapping matrix AND a Source field, then ignore the source/sink indices from the UI, and assume that the Mapping matrix maps the PointCloud nodes to Volume mesh nodes and that the data values (doubles) from the PointCloud indicate the strength (current density) for each point source.
The module changes/creates the right-hand side (RHS) and forward matrices for voltage (Dirichlet) boundary conditions.
Detailed Description
The ApplyFEMVoltageSource module creates and fills a new ColumnMatrix, according to mesh and dipole parameters in situations where it does not locate a ColumnMatrix on its input that contains an RHS to modify, or when the module finds a ColumnMatrix of a different size than the number of nodes in the mesh.
This module sets up a mesh with conductivity tensors for bioelectric field problems.
Detailed Description
The module provides basic means for construction of the FE matrix with linear elements for bioelectric field problems (discretization of Poisson equation for volume conductor problem).
The input field should be a Field (TriSurf, HexVol, or TetVol) of either Tensors or integers, with the data values defined at the elements (constant over each element). If it is a Field of Tensors, each Tensor indicates the local conductivity tensor at that location in the mesh. If it is a Field of Integers, then each integer is an index into a lookup table, where the table contains a set of conductivity tensors.
When using the index/table approach, a conductivity_table property must be stored with the Field, where the conductivity table is of type pair<string,Tensor> (i.e. the individual material types can have descriptive names). The BioPSE::Modeling::ModifyConductivities module can be used to generate (as well as to modify) the conductivity_table property. The BioPSE::Forward::IndicesToTensors and BioPSE::Forward::TensorsToIndices modules are useful for converting between the index/table (Field of integer with a conductivity_table Propert) and the full Tensor (Field of Tensors) representations.
BioPSE::Algorithm::BuildFEMatrix::build_FEMatrix performs the actual computation of the matrix. Other modules or any other code may use the algorithm for other kinds of problems involving discretization of the Poisson equation by linear finite elements.
The discretization of the Poisson equation on the supplied mesh is performed by linear finite elements using Galerkin approach.
This module calculates the divergence of a vector field over the volume. It is designed to calculate the volume integral of the vector field (gradient of the potential in electrical simulations).
Then, it builds the volume portion of the RHS of FE calculations where the RHS of the function is GRAD dot F.
Detailed Description
The input is a FE mesh with field vectors distributed on the elements (constant basis).
The output is the Grad dot F.
FlowControl
Compare one or two matrices using boolean operators, and send different outputs, or quit SCIRun, depending on the result of the boolean comparison.
Detailed Description
The BooleanCompare module will evaluate one or two input matrices and return different results based ont the evaluation. The module will evaluate either the values, size, or norm of each of the matrices with boolean operations, and can return any one of three inputs, as well as quit SCIRun. The inputs will be compared element by element based on the criteria chosen in the Condition option and perform the actions chosen in the Then option if true and Else option if false. Module also send the result of the comparison as the seond output matrix.
Inputs
- MatrixA - (Required) First matrix for comparison.
- MatrixB - (Optional) Second matrix for comparison. If this port is not used, most of the comparsion options will not be possible.
PossibleOutput - (Optional) Possible matrix to send as an output to the module.
Outputs
- OutputMatrix - The output matrix of the module. This will be identical to one of the three inputs of the module, or will be null depending on the inputs and options of the module.
- BooleanResult - Matrix of 1x1 containing either 1 or 0 indicating the result of the boolean comparison performed by the module.
Options
Any combination of the values (default), size, and norm (except a size and norm) of the first two input matrices can be compared as long as the resulting size of the objects are the same. The size of one matrix can be compared to the values of the other matrix if it has two entries. Likewise, the norm of one matrix can only be compared to the value of another matrix if it is 1x1.
The condition option sets the method of comparing the input matrices. If the operator is true, then the module will result in the action chosen in the Then_Option menu, and if false it will perform the action selected in the Else_Option menu. Operator options are:
- ‘A is non-zero’ - (default) true if there are any non-zero entries of A .
- ‘A and B are non-zero (and)’ - true if any corresponding entries of A and B are both non-zero.
- ‘Either A or B is non-zero (or)’ - ture if either A or B has non-zero entries
- ‘A is greater than or equal to B (>=)’ - true if entries of A are greater than or equal to B’s.’
- ‘A is greater than B (>)’ - true if entries of A are greater than B’s.
- ‘A is equal to B (==)’ - true if all the entries of A are the same as B.
- ‘A is less than B (<)’ - true if entries of A are less than B’s.
- ‘A is less than or equal to B (<=)’ - true if entries of A are less than or equal to B’s.
There can be ambiguous scenarios with the greater or equal, greater, less, less or equal options in the module if the input matrices have a size of more than one. In these cases, ie, if there are a set of entries which are both less than and greater than, the number of entries and the magnitude of the difference will determine which input is greater or less. Consider comparing the matrix norms to avoid ambiguity of the results. If there is no second matrix input, the first matrix can only be evaluated by non-zero entries (or size or norm) of the matrix.
The results options establishes the output of the module based on the result of the comparison. If the condition returns true, the action indicated in the Then option will be performed, If false, the Else option will be performed. Possible actions are:
- ‘Return First Input’ - (Then default) returns the first matrix input.
- ‘Return Second Input’ - returns the second matrix input.
- ‘Return Third Input’ - returns the third matrix input.
- ‘Return null’ - (Else default) returns an emplty matrix handle.
- ‘Quit SCIRun’ - Quit the current instance of SCIRun.
If the second or third inputs are selected for output and no matrix is input into these ports, the module will return null.
Choose one of any number of inputs (of any type) to send to the output.
Detailed Description
The ChooseInput module allows users to send any one of several inputs as an output to the module. This module can be used to quickly switch between data sent to other modules. Input Data can be of any type (Field, Matrix, String, etc), and the output will be the type (and the same data) of the chosen input. Choose which input to send by setting the input port number in the module UI. There are no constraints on type or size of the input data, therefore the user should consider the output destination ensure that all the input data to the ChooseInput module is compatible with the destination port.
Forward
The module solves a discretized model of Laplace’s equation in a 3D volume conductor model using “surface method”, given a particular type of boundary condition.
Detailed Description
The specific problem the authors had in mind was the forward problem of electrocardiography which consists of calculating, for a given time instant, the potential distribution generated at the surface of a specified volume conductor due the presence of the selected equivalent sources on a surface inside the conductor (The module should work for other problems which fit the same physical description, but has only been tested for forward electrocardiography.) In surface methods, the different volume conductor regions are assumed to have a constant and isotropic conductivity, and only the interfaces between the different regions are triangulated and represented in the numerical model. This module uses the “Transfer-Coefficient Approach” or “solid-angle method” developed by Barr et al. [i], as extended to include torso inhomogeneities in [ii] and with an improved algorithm for computing the solid angles [iii].
[i] R.C. Barr, M. Ramsey, and M.S. Spach, “Relating epicardial to body surface potential distribution by means of transfer coefficients based on geometry measurement,” IEEE Trans. Biomed. Eng., vol. BME-24, pp. 1-11, 1977.
[ii] P.C. Stanley, T.C. Pilkington, and M.N. Morrow., “The effects of thoracic inhomogeneities on the relationship between epicardial and torso potentials,” IEEE Transactions on Biomedical Engineering, BME-33, pp.273-284, 1986.
[iii] J.A. De Munck, “Linear discretization of the volume conductor boundary integral equation using analytically integrated elements,” IEEE Trans. Biomed. Eng., vol. 39, no. 9, 1992.
This module requires the triangulated surfaces of all the objects as inputs and creates the forward solution matrix as output. The geometric relationships of the surfaces are defined as described below, as are the boundary conditions to apply.
The number of input fields is two or greater and can be unlimited but one of them must be defined as the “source surface” where the Dirichlet boundary condition is given and another one defined as the “measurement surface” where the quantity of interest is to be calculated. To do this we use a “SetProperty” module for each of these two designated surfaces with Property
= in/out
and Value
= in
for the “source surface” and Value
= out
for the “measurement surface”. Insulating boundary conditions (Neumann boundary conditions) are assumed on the outermost surface.
To define the geometric relationships of the various fields, for each of the input fields use a “SetProperty” module with Property
= Inside Conductivity
and Value
= the numerical value of the internal conductivity of the corresponding homogeneous region.
The output is the forward solution matrix. This matrix can be multiplied to a Dirichlet boundary condition on the “source surface” to result in the boundary values on the “measurement surface”. This matrix is needed as an input for the modules “TikhonovSVD”, “Tikhonov” and “TSVD”.
Calculates the transmembrane action potentials given the input parameters generated from ECGSim
Detailed Description
###Inputs as matrices - These can be generated by ECGSim
- Amplitude
- Depolarization Times
- Depolarization Slope
- Plateau Slope
- Repolarization Slope
- Resting Potential
###Output
- Transmembrane potentials for one cardiac cycle.
Compute the current density vector field
Detailed Description
CalculateCurrentDensity calculates the current density vector field.
Required inputs are the electric field and mesh with conductivities.
Technical note: The current density vector field J is the product of sigma and -del V. The minus sign is added in CalculateCurrentDensity, so the electric field input should be positive (which is the unmodified output of the ChangeFieldData ::CalculateGradients module).
Insert electrodes into a finite element mesh.
Detailed Description
Insert electrodes into a finite element mesh.
Inverse
This module solves a linear inverse problem with a truncated singular value decomposition (TSVD).
Detailed Description
One can compute the inverse of an invertible matrix from its SVD. Specifically, an invertible matrix A=USV’ has an inverse inv(A)=Vinv(S)U’ (where “inv()” means matrix inverse). Since the matrix S is a diagonal matrix, its inverse is just the scalar inverse of its diagonal elements. However, when A is not invertible or it is ill-conditioned, a more stable solution to the inverse problem may be obtained by omitting the small or zero-valued singular values from the SVD-based matrix inverse computation, which is the method implemented in this module. This solution is mathematically equivalent to solving the inverse problem only in the subspace spanned by the right singular vectors (rows of V) corresponding to singular values that were not discarded.
This method is sometimes referred to as a pseudo-inverse when only the zero-valued singular values are discarded.
SolveInverseProblemWithTikhonov solves the inverse problem as a (weighted) minimum norm problem by applying a Tikhonov L2-norm regularization. It solves the minimization problem: \(\hat{x}=argmin_x \|Ax -Ly\|^{2}_{2} + \lambda\|Rx\|^{2}_{2}\)
Detailed Description
The module has four inputs, three outputs, and a graphical user interface (UI) where the regularization parameter can be chosen or computed. All inputs can be generated by SCIRun, or created elsewhere or loaded from Matlab files or the Matlab interface.
Input
- Forward problem matrix, \(A\): This matrix describes the relationship between solution and measured signals \(A x = y\).
For example, this matrix can be computed by solving the forward problem e.g. using finite or boundary element methods (see modules in BioPSE Forward, FiniteElements category).
-
Solution constraint matrix, \(R\): This matrix is used to constrain the solution. It imposes some a priori knowledge upon the minimization problem to select solutions with specific properties (expressed as a solution covariance e.g. to achieve maximally smooth solutions). If no input is given the identity matrix will be used.
-
Data vector, \(y\): These are the measurement data which have to be provided as matrix which should only contain one column.
In case of having a time series (multiple columns), it is recommended to use the module SelectSubMatrix to iterate over the different time instances (columns). In more detail, for each time instance, SelectSubMatrix would provide the data of the current time instance for SolveInverseProblemWithTikhonov to perform an estimation of the inverse solution. -
Residual constraint matrix, \(L\): This matrix is used to weight the measurements (e.g. by an inverse covariance matrix of the measurement channels). If no input is given, the identity matrix will be used.
IMPORTANT: Both, residual constraint as well as the solution constraint matrix can be used in single matrix form (such as \(L\) and \(R\)) in the minimization problem or as a squared matrix version (such as \(L^T L\) and \(R^T R\)) respectively. This option must be properly selected by the user in the UI:
Output
-
Inverse solution, \(\hat{x}\): computed solution estimate.
-
Regularization parameter, \(\lambda\): used regularization parameter.
-
Regularized inverse matrix, \(G\): linear inverse operator that gives a solution estimate equation \(\hat{x} = G y\). It actual value depends on the selected formulation (underdetermined or overdetermined) and requires the inversion of a matrix. It is only calculated if this port is connected to another module’s input port. The user can select between the formulations using the module GUI (see section Computation).
- underdetermined:
- overdetermined:
Computation
The algorithm has two different ways of computing the solution: the underdetermined and the overdetermined formulations. To choose which one will be solved the module has three options:
- Automatic selection. The algorithm will select underdetermined or overdetermined based on the dimensions of the Forward matrix.
- Manual selection of the undetermined formulation.
- Manual selection of the overdetermined formulation.
These options are presented in the GUI as follows:
Both cases use Gaussian elimination to calculate the unknown \(\hat{x}\), but they differ in the equations to solve for:
- underdetermined:
- overdetermined:
However, If the output port of the inverse operator is connected to another module’s input the inverse operator \(G\) is used to compute the solution estimate \(\hat{x}\) such as \(\hat{x} = G y\).
In both cases the used regularization parameter can be chosen in the UI. The available options are:
- Fix \(\lambda\) manually.
-
Automatic selection of \(\lambda\): the corner of the L-curve is determined by maximal curvature. A number of regularization parameter points (different \(\lambda\) values) can be specified in the L-curve plot which are than equally distributed over the range (“Lambda Range”, see below) of \(\lambda\)’s to be used in the L-curve computation.
-
Fix \(\lambda\) manually based on the range of regularization parameters (\(\lambda\)) specified by the “Lambda Range” input.
For the options that use the L-curve, the user can define the range and step size in the UI:
This module solves a linear inverse problem with Tikhonov regularization. It uses the singular value decomposition (SVD) or generalized SVD (GSVD) to compute its result.
Detailed Description
This module computes Tikhonov regularization as in SolveInverseProblemWithTikhonov but in a computationally efficient manner for multiple repetitions are needed since it uses the SVD (or GSVD if there is a regularization matrix) decomposition of the forward matrix. Thus, the optimization problem being solved is:
.
Where the forward matrix is expected to be given decomposed in its SVD terms that can be obtained with the module CIBC:Documentation:SCIRun:Reference:SCIRun:ComputeSVD. Note that computeSVD module returns the right singular vectors in rows and not in columns as it is required for SolveInverseProblemWithTikhonovSVD.
The GSVD should be used when the regularization matrix is different than idenity matrix (e.g. approximate Laplacian operator on a meshed volume or surface).
The solution is dependent on a scalar regularization parameter that can be specified directly using the User Interface of this module or can be determined automatically using the L-curve method. The automatic determination of the regularization parameter with the L-curve method requires computing several solutions to the inverse problem for a range of regularization parameters.
Input
-
Left Singular Vectors matrix, .
-
Singular Values vector, .
-
Right Singular Vectors matrix (vectors in columns), .
-
Measured ECG vector,
IMPORTANT NOTE: unlike some other software packages, this module expects the right singular matrix to contain its singular vectors in the columns. That is the matrix in the decomposition .
Output
-
Inverse solution, : computed solution estimate.
-
Regularization parameter, : used regularization parameter.
-
Regularized inverse matrix, : linear inverse operator that gives a solution estimate equation . It actual value depends on the selected formulation (underdetermined or overdetermined) and requires the inversion of a matrix. It is only calculated if this port is connected to another module’s input port. The user can select between the formulations using the module GUI (see section Computation).
Math
This module deals with solving a linear system A*u=b
when some values of the vector u is already known. The module will modify the linear system according to the known values.
Detailed Description
This module takes 3 inputs:
- LHS Matrix is an NxN Matrix (must be a SparseRowMatrix).
- RHS Vector is the right hand side vector, an Nx1 Matrix.
- X Vector is an Nx1 Matrix specifying the known variables in the linear system LHS. If the kth variable is known,
x(k)
is its value, otherwisex(k)
should be set NaN.
This module returns 2 outputs:
- OutPutLHSMatrix is an NxN Matrix.
- OutPutRHSVector is an Nx1 Matrix.
The solution:
inv(A2)*b2
has the same value as x at the non-NaN positions.
AddLinkedNodesToLinearSystem will link nodes in a finite element mesh and solve them as a single value.
Detailed Description
AddLinkedNodesToLinearSystem works with AddKnownsToLinearSystem and SolveLinearSystem to force nodes in a finite element mesh to solve to the same value. This module is useful in solving for regions with homogeneous field properties, such as with a perfect conductor in an electric field. The algorithm to do this involves combining rows in the stiffness matrix corresponding to the nodes to solve together. The module also creates a mapping Matrix that will map the results of the solved linear system to the original mesh.
Input Ports
This module takes 3 inputs. The first two are the NxN Matrix (LHS) and the right hand vector (RHS), which is a Nx1 Matrix, for a linear system (Ax=b
) and correspond to the two outputs of the AddKnownsToLinearSystem
module.
The third input is a matrix (LinkedNodes) representing the data marking the nodes to link on the same mesh used in the BuildFEMatrix module. The nodes should be marked with an integer value so that nodes to be linked will have the same value. Any number of linked node sets can be used by using a different value, i.e., independent sets of nodes to be linked must be marked 1,2,3 creating three regions of linked nodes. The remaining nodes should be marked NaN. This can be accomplished be using MapFieldDataOntoNodes and using the Default Outside Value of NaN option and a Maximum Distance of some value that is small relative to your mesh size. Then use GetFieldData to port the matrix into this module.
Output Ports
This module returns 3 outputs. The first two are the reduced Matrix (OutputLHS) and right hand vector (OutputRHS), which is a Nx1 Matrix, for a linear system to use in SolveLinearSystem . The third is a mapping Matrix (Mapping) to restore the data (solution vector from linear system solution) to the proper size. To do this, multiply the mapping matrix and the first output of SolveLinearSystem . The resulting vector can then be applied to the original mesh used in the calculation.
This module appends the rows or columns of SecondMatrix, and optionally other matrices, to FirstMatrix.
Detailed Description
This module appends Matrix from the SecondMatrix input port, and optionally other matrices from dynamic Matrix ports, to the base Matrix from the FirstMatrix input port. The user can use the GUI to select whether the rows or the columns of the input Matrix are appended to the base Matrix.
This module appends/replaces a column or a row in/to a matrix while looping through a network.
Detailed Description
This module appends, replaces, or prepends a column or row of a matrix. This module does one of these operations each time the module is executed. Hence, the appending or replacing operation is in time.
This module has two input ports:
-
base matrix, which is read the first time the module is executed
-
the matrix that needs to be appended is entered through the second input port
When the user wants to restart the network, he or she needs to clean this module as it would continue to collect matrices. To clear the matrices in the buffer of this module, hit the Clear Output button in the GUI, which will reset this module. The UI has options to allow the user to select:
Use the GUI to specify the operation which has to be performed each cycle of a network execution: the first column in the GUI specifies whether the module works on rows or columns, the second specifies whether one wants to add or replace the last column or row. The last column specifies whether a column/row is replaced at the start of the matrix (row 0 or column 0) or at the end of the matrix.
A Description of this module is not available at this time. For assistance please contact:
scirun-users@sci.utah.edu
Detailed Description
This module computes the singular value decomposition (SVD) of a matrix.
Detailed Description
This module takes a matrix as input, converts it to a dense matrix, computes its SVD, and outputs its three SVD matrices. The three matrices are the left singular vectors (stored in the columns of ‘LeftSingularMat’), singular values (in decreasing order, stored in the column matrix “SingularVals”), and the right singular vectors (stored in the rows of “RightSingularMat”). The number of elements in “SingularVals” is equal to the smallest dimension of the input matrix.
This module requires a version of SCIRun built with LAPACK support.
This module casts a matrix.
Detailed Description
Displays type of the input matrix.
Allows you to let the matrix stay the same and just pass through, or cast it to a ColumnMatrix, DenseMatrix or SparseRowMatrix.
This module allows users to input, manually, complex numbers that are then cast into the complex data type. Only one data entry possible per line.
Detailed Description
A detailed description of this module is not available at this time. For assistance please contact:
scirun-users@sci.utah.edu
This module builds a 4x4 geometric transformation matrix capable of translation, scaling, rotation, sheering and permutation.
Detailed Description
Default
The default transformation matrix offers no translation, scaling, rotation, shear, or permutation. The output under default settings is a 4x4 identity matrix. By default the module also only applies a single transformation option. For example, if the translate feature is applied the result will only translate, once the user switches to another option (say rotation) the output transformation matrix will return to the original identity matrix and only apply rotation. In order to apply multiple transformations, the user must first click the “composite transform” button so that the transformation remains. Once this button is pushed, the output transformation now becomes the default matrix.
Input Port
The module accepts a 4x4 matrix as an input transformation matrix and populates the output to reflect the input matrix. If a matrix of any other size is used as an input, no error is thrown but the matrix is not recognized - resulting in the same, default 4x4 identity matrix.
UI Features:
Each UI feature is selectable via radio button.
Translate
Translate allows the user to define the x, y, and z directions for translation via UI sliders.
Scale
Scaling is manipulated by logarithmic sliders at the bottom of the page. A Log Calculator (base 10) is provided at the bottom of the window for convenience.
Above the scale sliders, translation options are also given as X, Y, and Z, sliders; however, the translational shift is also determined by the log scale factor of the respective cardinal direction. For example, the x translation is augmented or diminished by the Log ScaleX slider.
Rotate
Rotation allows the user to define the angle (theta) of rotation on the bottom most slider bar. This rotation angle is applied to a portion of the rotation axes (labeled “Rotate Axis X/Y/Z”). For example, if the Rotate Axis Z is set to 1.00 and the Rotate Theta angle is set to 90. The transformation matrix will rotate an object around the Z axis by 90 degrees (centered at the origin - more on this below). If the X and Z axes are equal to each other, the transformation gives equal weight to rotation in the X and Z directions, no matter the magnitude of each slider value.
The origin can be defined by the slider bars above under the heading “Rotation Fixed Point.” If X, Y, and Z are set to 0 in this section, the origin corresponds to the original origin of whatever mesh the module is applied to.
Shear
The shear stress component of the module allows the user to define a shear stress vector in the upper panel of the UI. The vector is defined using X, Y, and Z force components. The lower half of the component has allows the user to define fixed plane components with A, B, and C representing the X, Y, and Z directions. The final component D defines the offset from the origin (in the direction of the stress vector) after the stress is applied.
Permute
The permute feature allows the user to flip axes. With the FlipX/FlipY/FlipZ commands, the signs of the respective axis are reversed. With the Cycle+/Cycle- options, the axes themselves are alternated (ex. x = y, y = z, z = x). This does not actually change the coordinate system of the field that is being translated. It only alters the matrix to flip over the axis lines.
Widget
In order to use the widget feature, the visualization output port must be attached to a viewer window. Once attached a small cubic widget appears on the screen. The widget can be scaled using the Uniform Scale slider (but it does not allow for singe directional changes i.e. you cannot scale in only the X direction…all cardinal directions scale together). Two other features appear in the UI: 1 - Resize Separable adds rotation spheres to the widget (more on this below) and 2 - Ignore changes allows the user to place, scale, and adjust the widget as they choose without applying assigning the transformations in the output matrix. A user may use the Ignore feature to adjust the size and shape of the widget to fit their geometry before they actually start manipulating the transformation.
Once the widget is in place, the user can manipulate it in the viewer window. By holding the shift key and clicking on a portion of the widget, the user can “grab” the widget and move it. Caps Lock also works to capture the widget. If the Resize Separately box is checked in the UI, spheres appear at the center of each of the 6 faces of the cube. Additionally, the user can turn on these spheres by clicking on the widget while holding down the shift+opt key on a mac (EDIT REQUIRED TO ACCOUNT FOR WINDOWS AND LINUX CONTROLS).By so clicking, the user cycles through all of the widget options (turning them on and off with each click). Shift+clicking each part of the widget allows for the following transformations:
Gray Widget Border:
–Translation
Blue Sphere:
–Rotation
Green Cylinders:
-
Scaling (if the widget has not been rotated while Ignore Changes was applied)
-
Shearing (if the user has rotated the widget with the Ignore Changes applied).
This module lets the user create a small dense matrix manually.
Detailed Description
This module lets the user create a small dense matrix manually. In the GUI, one can type the contents of an arbitrarily sized matrix. First set the dimensions of the matrix, then type its contents. After setting matrix dimensions, use either the Update button or press the enter key to update matrix size.
This module lets the user create different kinds of standard matrices of any sizes like matrices of ones, zeros, nans, identity and series matrix.
Detailed Description
This module lets the user create different kinds of standard matrices of any size(mxn). Different standard matrices include matrices of ones, zeros, nans, identity and series matrix. In the GUI, one can choose the type of matrix and size of the matrix (by defining the number of rows and columns). Also to create a series matrix the user has the flexlibility to choose the starting pointer of the matrix and the step size of the matrix.
This module performs one of a number of selectable matrix operations using the two input matrices.
Detailed Description
One of a number of binary matrix operations can be selected from the GUI and is then applied to the two input matrices to produce a new matrix that is then sent to the output port. The operations are X, +, Normalize, Select Rows, Select Columns, or Function.
“A X B” does a matrix multiply of the two matrices. The number of rows in the first matrix must match the number of columns in the second matrix. The output matrix has the same number of columns as the first matrix and the same number of rows as the second.
“A + B” performs a matrix addition. The two input matrices must be the same size. The elements are added in a piecewise fashion. This is equivalent to selecting “Function” and using ‘x+y’ as the function description
“Normalize A to B” computes the min and max values of the second matrix, and then linearly transforms all of the elements in the first matrix so that they fall within the range of those min and max values.
“Select Rows” uses the values in the B input matrix as row indices to extract from the A input matrix. The B input matrix must be a Column Matrix containing valid row index values into the A matrix. For example, if the B matrix contains [3 5] and the A matrix is 100x200, then the resulting matrix will be 2x200 and contain rows 3 and 5 from the A matrix.
“Select Columns” uses the values in the B input matrix as column indices to extract from the A input matrix. The B input matrix must be a ColumnMatrix containing the valid column index values into the A matrix. For example, if the B matrix contained [3 5] and the A matrix is 100x200, then the resulting matrix will be 100x2 and contain columns 3 and 5 from the A matrix.
“Function” allows an arbitrary function of two variables to be evaluated for each number pair in the two input matrices. This requires that the two matrices are the same size. The variable representing the element from the A matrix is ‘x’, and the variable for the element from the B matrix is ‘y’. The function is specified using SCIRun’s simple function parser. There are a number of mathematical functions available for use. They are:
Operators:
- +:Add two numbers:
4+3 = 7
- -:Subtract one number from another:
4-3 = 1
- Multiply two numbers:
4*3 = 12
- Divide one number from another:
12/3 = 4
- sin:Sine of a number in radians:
sin(x)
- cos:Cosine of a number in radians:
cos(x)
- sqrt:Square root of a number:
sqrt(4) = 2
- sqr:Square of a number:
sqr(2) = 4
- ln:Natural logarithm of a number:
ln(x)
- exp:e raised to the nth power:
exp(ln(x)) = x
- log:Log base 10 of a number:
log(100) = 2
- abs:Absolute value of a number:
abs(-3) = 3
- pow:One number raised to the power of another:
pow(3, 2) = 9
- random:Return a uniform random number between 0 and 1:
random()
Performs one of a number of selectable unary matrix operations to the input matrix.
Detailed Description
One of a number of unary matrix operations can be selected from the GUI and is then applied either to the whole matrix or to each element in the matrix, depending upon which operation is selected. The operations are Round, Ceil, Floor, Normalize, Transpose, Sort, Subtract Mean, or Function.
Round, Ceil, and Floor are used to convert each element in the input matrix into an integer value.
Normalize linearly transforms each element such that they all end up between 0 and 1.
Transpose constructs a new transpose matrix containing the same elements as the input matrix. For example, if the input matrix was of size 4x20, the output matrix will be of size 20x4.
Sort does an insertion sort on the elements of the input matrix. The elements will be sorted such that the smallest element will be at the top of the matrix and the largest element will be at the end. If the matrix is not a row or column matrix, the matrix is sorted in a row-scanline order. For example, in a 2x30 matrix, the first row would contain the lower half of the values and the second row would contain the upper half.
Subract Mean computes the mean value of the matrix, and then subtracts that value from each element in the matrix.
Function allows an arbitrary function to be evaluated for each element in the matrix. The current value is represented as the variable ‘x’. For instance, the default ‘x+10’ function adds 10 to each element in the matrix. A function of just ‘10’ would set each element in the matrix to be 10. The function is specified using SCIRun’s simple function parser.
There are a number of mathematical functions available for use:
Operators
- +:Add two numbers:
4+3 = 7
- -:Subtract one number from another:
4-3 = 1
- Multiply two numbers:
4*3 = 12
- Divide one number from another:
12/3 = 4
- sin:Sine of a number in radians:
sin(x)
- cos:Cosine of a number in radians:
cos(x)
- sqrt:Square root of a number:
sqrt(4) = 2
- sqr:Square of a number:
sqr(2) = 4
- ln:Natural logarithm of a number:
ln(x)
- exp:e raised to the nth power:
exp(ln(x)) = x
- log:Log base 10 of a number:
log(100) = 2
- abs:Absolute value of a number:
abs(-3) = 3
- pow:One number raised to the power of another:
pow(3, 2) = 9
- random:Return a uniform random number between 0 and 1:
random()
This module enables report field info on complex data such that complex analytics can be performed.
Detailed Description
This module reports the attributes of matrices.
Detailed Description
ReportMatrixInfo is purely an informational Module. It performs no modification on input data. Upon execution it displays attributes about the input matrix in the UI.
Matrix Attributes displayed:
-
Name - The Matrix name. May be blank.
-
Generation - The Matrix internal object id.
-
Typename - The C++ typename of the input Matrix Type.
-
Rows - The number of rows in the input matrix.
-
Columns - The number of columns in the input matrix.
-
Elements - The size of the matrix. This is Rows x Columns for non sparse matrices. For sparse matrices this is the number of nonzero elements in the array.
This module lets the user resize their matrix to the desired size.
Detailed Description
This module lets the user resize their matrix to the desired size. In the GUI, one can choose the size of the matrix (by defining the number of rows and columns). If the number of elements in the original matrix is less than the (no. of column)X(no. of rows) then the new matrix will be padded with zeros. If the number of elements in the original matrix are more than the (no. of column)X(no. of rows) then the matrix will be truncated. Users can also choose between the row or columns major ordering of the resizing.
This module chooses a submatrix based on user input. The matrix may be chosen by column and/or row ranges through the user interface or by array or matrix inputs defining desired row or column indices.
Detailed Description
There are two methods to chose a submatrix:
User Interface method: The user may select a range of rows/columns by opening the user interface window, selecting the check box associated with rows or columns and providing the desired range. Default values are -1 and does not clip the matrix.
Input Matrices method: Two additional input ports allow the user to define arrays or matrices of desired matrix indices. If the row or column matrices are nx1, the module will output a new matrix with rows/columns defined by the values in of the array. If matrices are NxM it will output a new matrix with rows/columns defined by the matrix values in a left-to-right top-to-bottom manner. If the input matrix has non-integer values, the number will be truncated (not rounded) and only the integer value will be used.
Examples:
-
Removing columns: Columns can be removed from the front or the back of the matrix using the user interface. Alternatively, a matrix can be fed into the ‘Matrix ColumnIndices’ input port and will be defined by the rules in the above paragraph. Rules apply to the row input port.
-
Re-ordering rows: Rows can be re-ordered by supplying the ‘Matrix RowIndices’ with a matrix that defines the order in which the user wants the rows to be ordered. Input port ordering is defined in the paragraph above. Rules apply to the column input port.
-
Cherry-picking matrix values: By supplying matrices to both ‘Matrix ColumnIndices’ and ‘Matrix RowIndices’ values for the output matrix will be defined by the associated row and column values.
Redefines a specified region of an input matrix to new, user-defined values.
Detailed Description
This module will replace existing values within a matrix with new values defined by the user. The module has 3 input ports. The first input port reads in the matrix the user wishes to change. The second port reads in the values that the user wishes to place inside the existing matrix. The third port is optional and reads in a 2x1 or 1x2 matrix that defines at which row and column the replacement will begin. The first number in the third port input matrix defines the initiating row. The second defines the column. If the third port is left empty the module defaults to row 0 / column 0, but these values can be altered manually within the UI.
Example 1:
Input port 1 =
[1 9 -13; 20 5 -6]
Input port 2 =
[a b]
Input port 3 =
[1 1]
Output =
[1 9 -13; 20 a b]
Example 2:
Input port 1 =
[1 9 -13; 20 5 -6]
Input port 2 =
[a; b]
Input port 3 =
[0 1]
Output =
[1 a -13; 20 b -6]
Note: The size of the input matrix cannot be altered by the size and starting points of the replacement and position matrices. In other words, if the resulting matrix would have larger dimensions than the original input matrix, the module with throw and error.
The SolveLinearSystem module is used to solve the linear system \(Ax=b\), where the coefficient matrix \(A\) may be dense or sparse, \(b\) is a given right-hand-side vector, and the user wants to find the solution vector \(x\).
Detailed Description
The SolveLinearSystem module takes two input matrices and returns three matrices. The first input port takes the coefficient matrix \(A\), which may be a dense \(n \times n\) matrix or a sparse \(n \times n\) matrix. The second input port takes the right hand side vector \(b\) as an \(n \times 1\) dense matrix. Here, the module is assuming that an \(n \times n\) system is being solved.
The first of the three output ports returns the solution vector \(x\) as an \(n \times 1\) dense matrix. The second output port returns the number of iterations required to reach convergence as a \(1 \times 1\) dense matrix and the third output port returns the norm of the residual vector, again as a \(1 \times 1\) dense matrix.
The GUI for this module is used to define the solution method for the module and monitor the convergence towards the solution.
Methods Tab
The Methods tab allows the user to select one of four solution algorithms for numerically solving sparse systems of linear equations:
- Conjugate gradient
- Biconjugate gradient
- Jacobi
- MINRES
Each solution method comes with the option of choosing a preconditioner for the numerical solution algorithm, which is set with the Preconditioners tab:
At present, only the Jacobi preconditioner is available. However, there is the option of using no preconditioning.
Convergence Criteria
The next section of the GUI sets up the convergence criteria for the numerical solution.
To achieve convergence of the numerical solution, the norm of the residual must be less than the target error as given in the slider. The next slider sets the maximum number of iterations that are allowed to achieve solution. This can take a value anywhere between 0 and 20000.
The module has the ability to write solutions at regular intervals and this flag is set by clicking on the Emit partial solutions check-box. The frequency of writing the solutions is set with the next slider.
Finally, the option Use the previous solution as initial guess, which is set by clicking the check-box, allows the user to either continue a simulation run looking for better convergence, or run a second simulation for which it is expected that the second solution may be close to the first.
A useful strategy for solving simulation problems is to begin with a small number of iterations to check that the solution will converge and then use the Use the previous solution as initial guess option to continue the simulation. Alternatively, to stop a diverging, or at least non-converging, simulation the Target error can be dynamically changed to a residual error level already obtained by the solver.
Iteration Progress
The bottom section of the GUI shows how the solution is progressing.
There is an iteration counter to show how many iterations have been completed, the value of the original error (this will be 1.0 unless the Use the previous solution as initial guess option has been used) and thevalue of the current error. These quantities are summarised graphically in the convergence plot.
Further reading: [http://www-users.cs.umn.edu/~saad/books.html Y. Saad, Iterative methods for sparse linear systems, second edition (2000)].
This module computes the minimal norm, least squared solution to a Nx3 linear system.
Detailed Description
Given four input ColumnMatrices (v0,v1,v2,b), it finds the three coefficients (w0,w1,w2) that minimize:
| (w0v0 + w1v1 + w2v2) - b |
If more than one minimum exists (the system is under-determined), the coefficients such that (w0,w1,w2) has a minimum norm is selected.
The outputs are a vector (w0,w1,w2) as a row-matrix and the ColumnMatrix (called x), which is:
[ w0v0 + w1v1 + w2v2 ]
MiscField
Build a mapping matrix; a matrix that says how to project the data from one field onto the data of a second field.
Detailed Description
This module builds a mapping matrix which contains information about how to interpolate the data from the source field onto the geometry of the destination field. The resulting mapping matrix can then be used by the ApplyMappingMatrix module to map the values from a field similar to the source field onto the destination field.
The source field for BuildMappingMatrix and ApplyMappingMatrix must contain the same geometry and data locations, however they do not have to contain the same data values or value types. For instance, both a TetVolField of doubles with data at the nodes and a TetVolField of Vectors with data also at the nodes can be used as input fields for BuildMappingMatrix.
MapFieldDataFromSourceToDestination can be used instead of BuildMappingMatrix and ApplyMappingMatrix if the mapping is not to be reused, as it does the same interpolation without building the intermediate mapping matrix. This should be used if the source field changes much more often than the destination field.
This module calculates area weighted normal vectors per node.
Detailed Description
For each node in the input surface mesh, find the attached faces, and average the face normal weighted by area for that node. Output a Nx3 DenseMatrix where N is the number of nodes in the input surface mesh. This matrix can be passed to SwapFieldDataWithMatrixEntries to map this data back to a vector field with the same mesh.
The module computes the center of a mesh based on a predefined method, chosen by the user.
Detailed Description
The module computes the center of a mesh and outputs it as a single node. The user can chose the method with which the center is determined from the following options-
Average of Node Locations Node locations within the defined mesh are averaged. The output center will favor areas of high node density.
Average of Element Locations Element locations within the defined mesh are averaged. The output center will favor areas of high element density.
Volumetric Center (Default) Calculates the center of mass for the defined mesh, irrespective of node location, element location or Cartesian, bounding box.
Bounding Box Center Calculates the center based on Cartesian bounding box dimensions. That is, a rectangular prisim region, that completely encompasses the mesh will be generated. The mesh center will be defined as the center of the rectangular prism mentioned above.
Middle Index Node Defines the center as the central node index number. Consider a LatVol mesh of dimension 4 x 4 x 4. Such a mesh would have node index numbers 0 thru 63. The center would be defined as node number 32.
Middle Index Element Defines the center as the central element index number. Consider the same 4x4x4 LatVol mesh from above. Such a mesh would have element index numbers 0 through 26. The center would be defined as element number 13.
Note: The above Middle Index examples would have the center defined at the volumes edge (Middle Node) or at the volumes center (Middle Element). Mesh centers are determined entirely by index numbering.
Calculates mesh quality based on several generally accepted algorithms. Default: Scaled Jacobian
Detailed Description
Mesh quality reporting options: Jacobian/Scaled Jacobian – Jacobian and Scaled Jacobian are based on accepted mesh quality metrics as calculated by the Verdict software library. In brief, for a single node, the Jacobian matrix is defined as:
| x_1 - x_0 x_2 - x_0 x_3 - x_0 |
A_0 = | y_1 - y_0 y_2 - y_0 y_3 - y_0 |
| z_1 - z_0 z_2 - z_0 z_3 - z_0 |
The minimal determinant of these matrices for each node of an element is known as the ‘Jacobian’ of the element. (Callahan et al. 2009)
Volume – Returns the volume of each element.
Scaled Inscribed/Circumscribed Ratio – Mesh quality is determined by the ratio between the radii of the largest possible inscribed sphere compared to the smallest possible circumscribed sphere of each tetrahedral element. The radius is normalized against he ratio of an equilateral tetrahedron 1:3.
Build a densematrix, where each row is a particular measure of the input Field (e.g. the x-values, or the element size).
Detailed Description
ReportFieldGeometryMeasures outputs a NxM matrix filled with values associated with the input mesh measures at selected mesh locations.
First the user selects the measues location in the top half of the UI. The number of measure locations equals the number of rows (N) in the output matrix.
Then the user selects what measures are sampled at each location in the bottom half of the UI. The number of measures selected equals the number of columns (M) in the output matrix.
Description of Measures:
-
X position - The X coordinate of the center of the measure location.
-
Y position - The Z coordinate of the center of the measure location.
-
Z position - The Z coordinate of the center of the measure location.
-
Index - The index used by the code to reference the measure location.
-
Valence - The # of similar measure locations that share a connection with the measure location. This varies by mesh and is not defned in all circumstances and thus equals 0 in these cases.
-
Size - The Euclidean Volume of the measure element. Ex: length for edges or 0.0 for points.
This module is used to view the attributes of fields.
Detailed Description
ReportFieldInfo is purely an informational Module. It performs no modification on input data. Upon execution it displays attributes about the input field in the UI.
Field Attributes displayed:
-
Name - The Field name. May be blank.
-
Generation - The Field internal object id.
-
Typename - The C++ typename of the input Field Type.
-
Center - The X,Y,Z coordinates of the average center of the nodes in the Field.
-
Size - The X,Y,Z coordinates of the grid-aligned bounding box that encloses the Field.
-
Data min,comax - Only valid for scalar type input fields. Prints the respective min and max scalar values of the data associated with the input field.
-
Nodes - The number of X,Y,Z points in the input field.
-
Elements - The number of highest dimension elements in the input field. Ex. For a PointCloudField this would equal the number of nodes. For a TetVolField this would equal the number of tetrahedral cells in the input field.
-
Data at - The location of the data values associated with the input field.
NewField
This module selects a subset of a field.
Detailed Description
The ClipFieldByFunction module clips out a subset of a field by preserving all of the elements in the input field for which the user specified expression evaluates to true at the specified test location. As a side effect of this algorithm is that any degenerate non-element items in the input field are discarded by the clip.
The type of the field is preserved in the clip, as well as the data values if possible. Some field types are structured and thus not clippable. This includes the LatVolField, ImageField, and Scanline field types.
The expression should be a SCIRun parser expression. The module UI has a help button that will bring up documentation for the parser which can also be found here. For node centered data, select clipping location from One Node, Most Nodes or All Nodes. For cell centered data, select Element Center.
The ClipFieldByFunction module takes an input field, and optionally a function string and/or one or more additional matrices that may be used in the function.
The ClipFieldByFunction module has two output ports: the clipped field and a mapping matrix.
This module clips a mesh to another mesh.
Detailed Description
Clip the first input to the second mesh. Both meshes need to be volumetric meshes such as tetrahedral rather than surface meshes.
The output is the clipped mesh and a mapping matrix that allows you to apply data to the clipped mesh from the original using the module ApplyMappingMatrix .
This module clips a scalar field to a specified isovalue.
Detailed Description
The ClipVolumeByIsovalue module is used to clip a TetVol, HexVol or TriSurf field along a particular isovalue. The isovalue is specified by the entry in the GUI. The new field can contain either the values less than or greater than the isovalue, as selected by the user.
In order to compute where the cuts are to be made, the input field must contain scalar values at the nodes. If the input field contains element centered data, use modules in the ChangeFieldData category (MapFieldDataFromSourceToDestination , MapFieldDataOntoNodes , MapFieldDataFromElemToNode , etc.) to interpolate data from elements to nodes.
Only TetVol, HexVol and TriSurf fields (unstructured, irregular mesh types) are supported by this general clipping. Other fields should be converted into these types if they are to be clipped.
This module constructs a mesh from raw matrix data.
Detailed Description
ConvertMatricesToMesh takes in raw position and connectivity data as matrices and uses them to construct a new mesh. The ‘Mesh Positions’ data should be an Nx3 matrix where N is the number of points in the mesh and each row contains data in XYZ order. The connectivity data should be an MxP matrix where M is the number of elements in the mesh and P is the number of node references per element. Thus for a TetVolMesh, P would be 4. The node references are row indices into the ‘Mesh Positions’ matrix and are indexed starting at zero.
The output field will contain the new mesh and no data. Modules under the ChangeFieldData category, such as CreateFieldData or SetFieldData module be used to attach data to the new field. See also modules in the ChangeMesh category, such as SetFieldNodes , which can be used to attach new positional data to existing meshes but cannot construct a new mesh nor change it’s connectivity information.
This module makes an ImageField that fits the source field.
Detailed Description
Makes an ImageField that fits the source field. The value type of the ImageField is same as that of the input field. If there is no input field specified, then it creates a unit volume of doubles. The size parameters refer to the number of nodes in the volume, not the number of faces. Thus a 2x2x2 node lattice will only contain one facet.
The Pad Percentage parameter is an optional parameter that describes how much larger than the input field the resulting lattice volume should be. For example, a value of 100 would make the image field be three times as far across and contain nine times the area of a image with the default 0 padding. A value of 50 would cause the image to be twice as far across (50% bigger on each side).
No data is generated. In order to map the data mapping modules from SCIRunMapFieldDataOntoElements or MapFieldDataOntoNodes can be used if those values are needed.
This module makes a LatVolField that fits the source field.
Detailed Description
Make a LatVolField that fits the source field. The value type of the LatVolField is the same as that of the input field. If there is no input field specified, then create a unit volume of doubles. The size parameters refer to the number of nodes in the volume, not the number of cells. Thus a 2x2x2 node lattice will only contain one cell.
The Pad Percentage parameter is an optional parameter that describes how much larger than the input field the resulting lattice volume should be. For example, a value of 100 would make the lattice volume be three times as far across and contain twenty seven times the volume of a lattice with the default 0 padding. A value of 50 would cause the lattice to be twice as far across (50% bigger on each side).
No interpolation is done onto the new field. It is recommended that the MapFieldDataOntoElements or MapFieldDataOntoNodes module be used if those values are needed.
This moudle extracts an isopotential surface from a scalar field.
Detailed Description
The ExtractIsosurface module is used to extract one or more isopotential surfaces from a scalar field using the Marching Cubes algorithm. The isopotential surfaces are surfaces for which the scalar value would interpolate to a constant isovalue. The module can output a SCIRun field and geometry (for faster module execution, if only one is needed, deselect the output type that is not needed). The isovalues can be specified in several ways.
Slider
The Slider tab allows the user to select one isovalue using a slider bar or to type in one isovalue manually. The slider bar ranges from the minimum and maximum values of the input field. This can be used with great effect to interactively move the isosurface around when the Update Auto option is specified. Other update options are On Release, which updates the isosurface when the slider button is released, and Manual, which updates the isosurface when the module is executed.
Quantity
The Quantity tab allows for the selection of several regularly spaced isosurfaces (the list of isovalues is not editable). This is particularly useful for isocontouring as it gives a contour-map effect for where the isosurfaces would be located.
List
The List tab allows the user to type in an arbitrary spaced delimited list of isovalues to be used. In addition to hard numbers, percentages relative to the field minimum and maximum may be specified as well. For instance, 50% would specify the isovalue in the center of the min-max range, whereas 50.0 would isosurface at a value of 50.0.
Matrix
Isovalues can be passed into the field in the Optional Isovalues port, which expects a Nx1 matrix. The Matrix tab must be selected and the module executed to populate the list of isovalues from the Optional Isovalues input matrix. A surface will be created for each value in that matrix. The ExtractIsosurface-probe.srn example network demonstrates this using the GenerateSinglePointProbeFromField and SwapFieldDataWithMatrixEntries modules to interactively select the isosurface with a probe using this port.
The Build Output Field option determines whether or not a surface field is created. The Build Output Geometry option determines whether or not geometry data is created. Transparency can be enabled for geometry output by selecting the Enable Transparency option. If there is no ColorMap present then the default color is used for the output geometry.
This module can work on scalar fields with the following mesh type: LatVol, StructHexVol, HexVol, TetVol, Prism, Image, StructQuadSurf, QuadSurf, TriSurf, Scanline, StructCurve, and Curve. Isosurfaces are generated for volume meshes, isocontours are generated for surface meshes, and isopoints are generated for edge meshes.
If the scalar fields contain cell-centered data, the surfaces are created along the appropriate cell faces. In the case where the isovalue exactly equals the scalar data only the face between the cell and its neighbor with a great scalar value will be extracted.
Output
There are four output ports:
- The first output port contains the field
- The second output port is the geometry (useful for large data sets if the extracted surface will only be viewed)
- The third output port contains a mapping matrix to the nodes used to build the isosurface
- The fourth output port contains a mapping matrix to the cells used to build the isosurface.
This module smooths surface meshes without shrinking them.
Detailed Description
Based on the surface smoothing algorithm published by Taubin in 1995 (A Signal Processing Appoach to Fair Surface Design).
User Interface:
- Weighting methods: Equal and curvature normals (default: equal)
- Iterations: Number of times the surface is put through the smoothing algorithm (default: 50)
- Spatial cut off frequency: Similar to low pass filter setting (default: 0.1)
- Relaxation Parameter: negative scale factor – the shrinking term (default: 0.6307)
- Note: an unshrinking term is produced by: Spatial cutoff = 1/Relaxation parameter + 1/Dilation parameter
This modules allows you to set seed points in a given field and interactively change their location.
Detailed Description
The input is a field containing a mesh.
The Geometry output connects directly to the ViewScene module and produces points that can be interactively moved by holding shift while dragging them. This will update the points output to the Field port.
The Field output the points as a point cloud field.
This module generates samples from any type of input field and outputs the samples as a PointCloudField field.
Detailed Description
GeneratePointSamplesFromFieldOrWidget generates samples from any type of input field and outputs the samples as a PointCloudField field. The samples can be generated randomly or user selected via a 3D widget. Use the shift key/left mouse button combination to manipulate the size (resize cylinders), orientation (spheres on the widgets are rotation points) and position of the widgets. Use the same key/mouse combination to move the slider on the rake widget. Use the shift key/right mouse button combination to bring up a dialog box to change widget scale.
The random sampling can be weighted by importance (determined by the data value of the sample) or left unweighted. The random sampling can also be limited to the selection of node points, rather than points from the interior of the fields elements, by clamping the samples to nodes.
The uniform distributions are a uniformly random function over the spacial extents of the field (i.e. the elements are weighted by their volume or area), whereas the scattered distributions are a uniformly random function over the elements only (i.e. all elements have the same weight). The importance weighted distributions multiply the existing weight of a sample by the interpolated data value associated with it, while the not weighted distributions leave the existing weight of a sample unchanged.
This module generates SinglePointProbeFromField values in a field.
Detailed Description
A GUI Point widget is created and can be moved around in the scene. Use the shift key/left mouse button combination to move the widget.
The GenerateSinglePointProbeFromField Point port contains a PointCloudField field with one point in it at the location of the probe. The value at that point is interpolated from the input field. The input field is also used to determine the initial position and relative size of the probe widget. If there is no input field, a default zero valued probe is returned.
The Element Index matrix contains the Index of the item with data that is nearest the cell. If an input field is not available, then there will not be any matrix output.
Computes a point cloud field containing all of the elements for a field. Detailed Description
The Centroids module computes a point cloud field containing all the element /node/face/edge/cell/delement centers for a field. For instance, if the input field is a TetVolField then the output field would contain the center of each tetrahedra. An input point cloud field would return the same data locations.
The output field is always a point cloud field of doubles, and contains no data. If data is needed at those points then a mapping module (MapFieldData module) could be used to recover them.
This module will extract the inner and outer boundaries from a mesh.
Detailed Description
An inner boundary is defined as the boundary between different regions with a different value on the elements.
The outer boundary is the boundary that surround the mesh.
In the GUI one can selectively set which boundaries are extracted from the mesh. One can set the range of values on the segmented field for which one wants to extract the boundary separating the different compartments. Within this range of selected domains one can select only the inner boundaries to this selected domain or one can get the boundary surrounding the selected domains.
This module is intended to extract the boundaries in a segmented field. The module is templated and should work on any mesh type as long as the data is assigned to the elements.
This module extracts a boundary surface from a volume field.
Detailed Description
The GetFieldBoundary module extracts the bounding surface of the incoming field, making it into a new field that it outputs through the BoundaryField port. This module does not have a GUI. It has one input port, Input, and two output ports, Boundary, and Mapping. The GetFieldBoundary module builds an appropriate mesh from the incoming field. GetFieldBoundary will build a QuadSurfMesh, TriSurfMesh, or CurveMesh as appropriate for the boundary type of the input field. The Boundary output port will contain the new boundary mesh with no data interpolated onto it. If the data from the input field is desired on the output field, it is recommended to use the Mapping output, running the results through ApplyMappingMatrix in order to draw values from the input field.
Any interior face should be shared by two cells. The boundary surface is calculated as the module checks each face that is shared by two or more cells. The faces that exist in one cell only are boundary faces. This module can be used as a debugging tool becuase errors or holes in the mesh will show up as boundary faces.
This module reduces the dimension of a topologically regular field by 1 dimension.
Detailed Description
The GetSliceFromStructuredFieldByIndices input port is a field that has regular topology. The field will be reduced by 1 dimension and piped to the output port.
The user must supply two input values either via the module GUI, or from an optional input matrix: the axis the field is reduced along, and location along the selected axis. If supplying an matrix of clipping locations, the matrix must either be 1x1 or 3x3 and have data entries that follow this pattern:
-
If 3x3 matrix, row index is the axis: row 0 = axis i, row 1 = axis j, row 2 = axis k (only select one at a time)
-
Column 0 is the selected axis to slice
-
Column 1 is the slice index (location along the selected axis where the field will be sliced)
-
Column 2 is the data dimensions
A 3x3 matrix containing selected axis, slice index and data dimensions following the above pattern is also output.
Takes a field entry and converts it into a Cleaver2 mesh using the parameters listed in the module UI.
Detailed Description
This module is a port to open and run Tetgen, a delauney tetrahedralization software package, within SCIRun.
Detailed Description
InterfaceWithTetGen is a module that will make a tetrahedral mesh from a trisurf mesh or a point cloud. This is the easiest way to turn a surface mesh into a volume in SCIRun. Using delauney tetrahedralization, tetgen will find the tetrahedral mesh that will connect the input points with the highest quality elements, i.e., the element face area are as equal as possible. For more information about tetgen an its capabilities, please refer to the TetGen website.
In order for tetgen to run effectively, the flags must be properly set. If using a surface input, the mesh must be a valid trisurf mesh that is completely inclose and without overlapping/crossing elements. If using only a point cloud input, the first option (Tetrahedralize a piecewise linear complex (PLC)) must be disabled. In the case of a point cloud only input, the output will be a convex hull of the points. If this module is taking too long (several minutes) and you are not sure why, try getting rid of any quality or size constraints (should finish quickly, as fast as a few seconds depending on the mesh) and then gradually reintroducing them. The few the options enabled, the faster and more likely to solve the tetrahedralization.
There are four inputs:
-
Main (Required): The main field to be processed by tetgen. The outer surface or Tetrahedral volume field to refine.
-
Points (Optional): If there is a PointCloud attached to this input, the point in it will be included in the output tetvol. Data on this field is meaningless.
-
Region Attribs (Optional): If a PointCloud is attached the points will be considered points inside the different regions. The data will be used as the volume constraint for that region. For the volume constraint to be respected you must pass the ‘a’ command line switch.
-
Regions (optional): This is a dynamic input, each input should be a surface field, that defines a region inside the Main Input.
The module outputs a tetrahedral mesh.
This module glues any number of input fields into one output field.
Detailed Description
JoinFields takes in an arbitrary number of input fields and gathers them all up into one output field. If the input fields all have the same editable mesh type then the output field will also be of the same type. If the meshes are not editable (LatVol, Image and Scanline) the mesh type is not perserved because they cannot be arbitrarily glued together while maintaining their mesh type. Instead, appropriate equivalent mesh types will be produced (HexVol, QuadSurf).
Options available through the UI include:
-
Force PointCloudField as output
-
Merge duplicate nodes (default)
-
Merge duplicate elements
-
Only merge nodes with same value
-
Merge mesh only, do not assign values
The user may also set a tolerance defining the distance between nodes and/or elements to be merged.
This module splits a domain into separate fields as defined by the input field’s connectivity.
Detailed Description
This module divides a single input field into as many as 8 output regions. Separate regions may also be collected and bundled. Connected regions are not defined by label masks. They are defined, rather, by node and/or element connectivity. For example, a continuous, tetrahedral mesh may use label masks to define domains, but this module will produce only one output field given that all tets within the mesh are connected.
A common use for this module, then, is to separate distinct field surfaces, to split away small mesh islands that are not connected to the main mesh, or to break up a fractionated mesh into its individual regions.
Domains can be sorted in two ways: Sort Domains by Size or Sort Ascending. Domain size refers to the overall surface area (if domains are surfaces) or volume (if domains are 3-dimensional). The ascending sort refers to the value assigned to each domain in the original field.
This module splits a domain with predefined domains (i.e. label masks) into separate fields.
Detailed Description
This module accepts a single input field with predefined domains and splits each domain into separate fields. New fields are output as individual fields, or as a bundle of distinct fields. Up to 8 distinct possible output fields are available per module. If additional splits are needed, the module can be repeated as often as necessary on the final output field port. Domains can be sorted in two ways: Sort Domains by Size or Sort Ascending.
Domain size refers to the overall surface area (if domains are surfaces) or volume (if domains are 3-dimensional).
The ascending sort refers to the label mask that defines each domain in the original field.
The resulting output will be ordered relative to the values used to define the input field’s domains.
Python
This module allows you to take an input (String, Matrix, or Field) and perform Python-based algorithms on the input code. The module UI allows you to name each of the inputs and outputs which can then be referenced in the pasted code block.
Detailed Description
A detailed description of this module is not available at this time. For assistance please contact scirun-users@sci.utah.edu.
Render
This module displays interactive graphical output to the computer screen. Use the ViewScene to see a geometry, or spatial data. The ViewScene provides access to many simulation parameters and controls, thus, indirectly initiates new iterations of the simulation steps important to computational steering.
Detailed Description
Autoview restores the display back to a default condition. This is very useful when objects disappear from the view window due to a combination of settings.
Set Home View captures the setting of the current view so you can return to it later by clicking the Go home button. Go home restores the current home view.
Views lists a number of standard viewing angles and orientations. The view directions align with the Cartesian axes of the objects. The Up vector choice sets the orientation of the objects when viewed along the selected axis.
From the ViewScene window, the left corner of the control panel contains performance indicators that document the current rendering speed for the display. More advanced graphics performance results in a higher drawing rate.
The Viewer can be cloned with the NewWindow button in the menu. When a new window is created it is locked to the original window, meaning that rotations in one are copied to the other window. This mode is called the ‘View Locking Mode’ and is indicated with a little ‘L’ in the lower right corner. To independently rotate the viewers, release the lock by pressing ‘L’ in the window that needs to be unlocked. If one presses ‘L’ again the window will return to locking mode in which all the mouse movements are copied to all other windows that have locking mode switched on.
To improve navigation in 3D data and help facilitate the placement of widgets, it is suggested to use multiple windows that view the object from different angles. By pressing 1-8 in the window one can quickly move through different views, that look at the object from different angles.
A small plus sign (+) appears in the lower right corner of the ViewScene window. Clicking on the plus sign reveals the extended control panel.
The ViewScene module also supports a series of hotkeys:
-
1-8: Standard views that align with the cartesian axis.
-
CTRL 1-9: Import view from Viewer Window 1-9.
-
0: Restore display back to default view (Autoview).
-
CTRL H: Capture current view and store it (Set Home View).
-
H: Go to captured view (Go Home).
-
A: Switch Axes ON/OFF.
-
B: Switch Bounding box mode ON/OFF.
-
C: Switch Clipping ON/OFF.
-
D: Switch Fog ON/OFF.
-
F: Switch Flat shading ON/OFF.
-
I: Display latest information on hotkeys.
-
K: Switch lighting ON/OFF.
-
L: Switch view locking ON/OFF.
-
O: Switch orientation icon ON/OFF.
-
P: Switch orthographic projection ON/OFF.
-
U: Switch backculling ON/OFF.
-
W: Switch wireframe ON/OFF.
String
This module can be used to create a string.
Detailed Description
This module allows the user to create a string by typing the string into an edit box in the GUI.
This module retrieves the name of the current network.
Detailed Description
GetNetworkFileName retrieves and sends the name of the current network to a String port. If a network has not been loaded, the module generates a default.
This module merges multiple strings into one string.
Detailed Description
This module merges multiple strings into one string. The strings are read from the left most port to the right most port and are put into one string. (The string of the left most input port is the first string in the merged data and the one on the right is the last one).
A description of this module is not available at this time. For assistance please contact:
scirun-users@sci.utah.edu.
Detailed Description
Detailed Description
A detailed description of this module is not available at this time. For assistance please contact:
scirun-users@sci.utah.edu.
This module does a sprintf with input matrices into a new string.
Detailed Description
This module module takes in a formatted string (a string with %01d, %4.5f, %g etc) and takes the numbers of the input matrix and puts these formatted numbers into the string. The input matrix can be a scalar but can as well be a full dense matrix. The module takes each number out of the matrix and puts it in the formatted number string. For example in order to plot the contents of a 1x3 vector one may choose a formatstring of ‘%f %f %f\n’, which will put all three value in the matrix in the formatted string. If there are more numbers in the matrix than in the format string then the current format string will be reused again and the format string is filled out from the first entry again. Hence, to get the contents of a 4x4 matrix in a comma seperated list one can choose a format string of ‘%5.5f, c’. This will apply this format string to each number in the matrix. In case multiple matrices are supplied, first all the values of the first matrix will be used, then all the numbers of the second matrix, etc. When there are more positions in the matrix where one can fill out a number then the rest will be padded with the value 0.0.
The format string to be used can be either entered in the GUI or on the first input port. If a string is found at the first input port, this one is automatically inserted in the widget on the GUI and is the one to be used.
Note: the format string may contain ‘%s’, which will remain in the format string and is not touched by this module. To insert strings use PrintStringIntoString instead.
This module prints a string into a formatted string.
Detailed Description
This module performs a sprintf operation with strings, whereever a ‘%s’ in the format string is found the input string will be pasted. This module takes in a new string for each ‘%s’ encountered in the format string. If not enough string are supplied an empty string is used.
Note: This module leaves any numeric formatting untouched. Hence statements like ‘%d’ or ‘%f’ remain in the string. To insert numbers, use the PrintMatrixIntoString module.
This module can be used to display the contents of a string.
Detailed Description
This module shows the contents of a string.
This module splits a filename in: pathname, filename (base), and extension.
Detailed Description
This module splits the complete filename into its three base components: pathname, filename, and extension. These three string are in the first, second, and third ports respectively. To get the full filename back, just merge the three resulting strings together. The forth port contains the filename and extension (i.e. removes the base path).
Visualization
This module generates fixed Colormaps for visualization tools.
Detailed Description
This module is used to create some “standard” non-editable colormaps in Dataflow/Uintah. Non-editable simply means that the colors cannot be interactively manipulated. The module does, allow for the the resolution of the colormaps to be changed. This class sets up the data structures for Colormaps and creates a module from which the user can choose from several popular colormaps. By clicking in the Color band the user manipulate the transparency of the color. This is useful, for example, when volume rendering, though many visualization tools ignore the transparency data.
Most of the important work for this module is performed in the CreateStandardColorMaps.tcl file. There you can easily add new colormaps by making the obvious changes to the buildColorMaps function and the UI function (where the make_labeled_radio buttons are created). The C++ code merely queries the tcl code and fills the Colormap.
This module visualizes vector fields by generating curves that interpolate the vector of vectors in a Field.
Detailed Description
The Vector Field input port is the vector field on which the path intergration of the seed points will be performed. This may be a vector field with any volume geometry type. Surfaces and lower order fields do not currently work due to numerical error.
The second input port, Seeds, contains the initial values for which the vector will be computed. This may be a field of any type, as just the node positions are used. Seeds which are not contained within the vector field are just discarded. The module requires use of both field inputs in order to execute.
The GenerateStreamLines module has one output, Streamlines, a CurveMesh, representing a collection of stream lines computed for the Vector field given the set of initial seed points.
This module uses one of several similar numeric integration methods. They are taken directly from Numerical Analysis by David Kincaid and Ward Cheney, c1991. Adams-Bashforth is a Multi-Step method that offers the fastest performance by reusing existing samples when possible. It presents some interesting artifacts on discontinuous models such that it is easy to visualize where those discontinuities take place. Heun is a second order Runge-Kutta solver, and is sufficient for most smoothly varying fields, such as linearly interpolated gradient fields over volume elements. Classic 4th Order Runge-Kutta is presented for reference and provides excellent results in general. Adaptive Runge-Kutta-Fehlberg is a 5/6 order solver which provides the best overall results at the cost of more computation time. It is also the only adaptive method, meaning the step size of the algorithm is adjusted dynamically as the stream moves through the vector field.
All of the computation methods are similar in that they take a step, (based upon the Step Size indicated) examine the derivative at that point, and then procede in that new direction. Adaptive Runge-Kutta-Fehlberg also determines if a stepsize correction is necessary. This determination is based upon the Error Tolerance value.
The GenerateStreamLines GUI includes text fields for Error Tolerance, Step Size, and Maximum Steps. The Error Tolerance text field represents the margin of error when doing an adaptive calculation of the stream lines. Maximum Steps represents the maximum number of iterations.
The user can specify whether streamlines are computed in negative and/or, positive directions by changing the Direction radio buttons. The Color Style options are based on either the seed number, integration step, distance from the seed, or the total distance, which will affect how values are attached to the output field. By selecting seed number, the output field will range from zero to the number of seed points so that every stream line has exactly one value. The integration step option changes the value of output field such that they start at zero where the seed point is at and go up by one for each integration step away in either direction. The distance from seed is similar to the integration step but based on the cord length distance from the seed. Whereas the total length is based on the total cord length from the seed point.
The Filter Colinear Points check box is a postprocess on the streams. It passes over the streams and removes all points that are too close together, as well as points that are colinear. It is useful for rendering the streamlines as it greatly simplifies them while retaining their visual appearance.
This module allows the user to manually or automatically set the range of scalar values that map to the ColorMap. RescaleColorMap is an example of a module that has dynamic ports, because each time the user connects a Field module to the RescaleColorMap Field input port, another Field input port appears.
Detailed Description
In the GUI, the Auto Scale check box uses the minimum and maximum values found in the ScalarField and maps the ColorMap to that range. The Fixed Scale check box allows the user to manually select for the range of scalar values to which the colors map by adjusting the minimum and maximum values in the appropriate text fields. After changing the range to which the colors map, a new ColorMap passes downstream to the connecting module.
This module displays a ColorMap with index values.
Detailed Description
ShowColorMap creates a geometry overlay containing the input colormap and numerical values for its range.
This module visualizes the geometry that makes up a Mesh inside a Field. When possible and selected, the field takes its color from the data values that permeate the field.
Detailed Description
The field in the first input port holds the mesh that is to be visualized. By default is will be displayed using the the default colow, which is editable from the UI. If there is a color map attached to the second input port, and there is valid data in field, then the data can be used as an index into the color map, and the mesh is rendered with appropriate colors. In addition, if there is valid data is field the data itself can be converted into a color. Scalar data creates a gray scale mapping, vector data (normalized) creates RGB colors, and the principle Eigen Vector (normalized) of tensor data also creates RBG colors.
Nodes can be rendered as points (default) or as spheres. Edges can be rendered as lines (default) or cylinders. If the nodes and edges are rendered as spheres and cylinders respectively they may be sized. Faces and Text can be rendered or not.
This module visualizes the data that makes up a Field. When possible and selected, the glyph takes its color from the data values that permeate the field.
Ports
This module has 6 input ports, 3 field inputs and 3 color map inputs. The only required port is the first field input port because that holds the data that is visualized. By default, ports will be set to primary input.
Secondary and Tertiary Ports
The secondary and tertiary ports can be used to scale vector parameters like width.
Ex: When rendering vectors as a cone the orientation and length of the cone are determined by the primary field, but the secondary field can be used to change the radius of the cone.
They can also be used to assign colors based on data besides the primary field. Ex: If you want to render scalars in RGB, you can give a secondary input of a vector or tensor and set the coloring to RGB Conversion through the secondary input.
Color
By default, glyphs is displayed using the default color, which is editable from the GUI.
Color Map
If there is a color map and field attached to the selected input port, then the data in the selected field input is used as an index into the corresponding color map, and the glyph is rendered with the color at that point.
Type | Description |
---|---|
Scalar | Uses scalar value as index |
Vector | Uses vector’s length as index |
Tensor | Uses the vector magnitude of the 3 eigenvalues as the index |
RGB Color Conversion
If there is a field attached to the selected input port, then the data in the selected field is converted into a color. The RGB color components are generated by the absolute value of vector x, y, z components:
(R = |x|, G = |y|, B = |z|)
Type | Description |
---|---|
Scalar | Creates gray-scale mapping |
Vector | Normalized vector creates RGB colors |
Tensor | Principle eigenvector(normalized) creates RGB colors |
The ShowMeshBoundingBox Module renders a semented red-green-blue 3D grid around an arbitrary field
Detailed Description
ShowMeshBoundingBox queries the generic mesh interface to get the BBox of the Field, and then renders a “cage” of that bounding box. The user specifies nx/ny/nz (number of “bars” in each direction) via text entry in UI. The cage is rendered with red/green/blue lines corresponding to x/y/z.
This module puts the contents of a string in the viewer window.
Detailed Description
This module is able to display multiple lines of information into the viewer window. The module takes a string as input and displays the contents on top of the viewer window. If there are ‘newlines’ in the string multiple lines are displayed (up to ten lines). In the GUI the font size and color can be altered as well as the location of where to plot the text. This module is intended to provide the user with a means to put any arbitrary information about the data being shown inside the figure.